ads
GET /v1/ads/connections/{connection_id}/x/campaigns
An X Ads account's campaigns with their daily and total budgets and 7-day spend (za-43).
Authentication
Send an API key as a bearer token. The key must carry the ads.view permission; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X GET https://api.zinndigital.com/v1/ads/connections/{connection_id}/x/campaigns \
-H "Authorization: Bearer zdk_live_…"Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Gated on ads.view. Read from X now (docs/1006 §35 "Budgets"): one row per campaign with its status, currency, daily and total budget (micros of the account currency, null when the campaign has none) and its spend over the last days days. sandbox is true for an X sandbox account. 422 xBudgetsXOnly for a connection that is not X, 422 xReadFailed when X did not answer (try again), 422 needsReconnect when X refused the token. An xReadFailed refusal carries error.failure (§2.57 VendorFailure): provider_outage with X's status board for a 5xx, a rate limit or no answer, credential_problem with X's billing door for a 402, our_fault for any other 4xx or our own deadline. needsReconnect (401/403, or X's token codes on a 400) carries none: its remedy is "connect it again", which the refusal says.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
connection_id (path) | string | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
connection_id | string | Yes | — |
sandbox | boolean | Yes | — |
days | integer | Yes | — |
data | AdsXCampaign[] | Yes | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429