API reference
Ad spend
What was spent per channel and campaign.
GET/spend
List spend
Needs the permission attribution:read.
| Parameter | In | Type | Notes |
|---|---|---|---|
from | query | string | |
to | query | string |
curl -X GET https://crm.anibrosdesign.com/api/v1/spend \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 400 401 403 429
POST/spend
Create a spend
Needs the permission attribution:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
Idempotency-Key | header | string | Any unique string up to 128 characters. Repeating the request with the same key returns the first response. up to 128 characters |
| Body field | Type | Notes |
|---|---|---|
source required | one of website, referral, portal, direct, meta_ads, google_ads, walk_in, other | |
campaign | string or null | |
periodStart required | string | |
periodEnd required | string | |
amount required | number | at least 0. up to 999999999999 |
note | string or null |
curl -X POST https://crm.anibrosdesign.com/api/v1/spend \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"source":"website","campaign":"text","periodStart":"text","periodEnd":"text","amount":0}'Responses:
201 400 401 402 403 429
POST/spend/import
Import (spends)
Needs the permission attribution:manage.
| Body field | Type | Notes |
|---|---|---|
csv required | string | at least 1 characters. up to 900000 characters |
dryRun | boolean | default false |
curl -X POST https://crm.anibrosdesign.com/api/v1/spend/import \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"csv":"text","dryRun":false}'Responses:
200 400 401 402 403 429
PATCH/spend/{id}
Change a spend
Needs the permission attribution:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
| Body field | Type | Notes |
|---|---|---|
campaign | string or null | |
periodStart | string | |
periodEnd | string | |
amount | number | at least 0. up to 999999999999 |
note | string or null |
curl -X PATCH https://crm.anibrosdesign.com/api/v1/spend/{id} \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"campaign":"text","periodStart":"text","periodEnd":"text"}'Responses:
200 400 401 402 403 404 412 429
DELETE/spend/{id}
Delete a spend
Needs the permission attribution:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X DELETE https://crm.anibrosdesign.com/api/v1/spend/{id} \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
204 400 401 402 403 404 429
Something missing or unclear? Tell us.