Skip to Content
API referenceAds APIOrganization and ad accounts

Organization and ad accounts

Each advertiser gets its own ad account, spend cap, statement and API keys.

Organization

GET /organization

Returns the organization your key belongs to. The organization key and advertiser keys can both call it.

curl https://api.adzen.ai/v1/ad-manager/organization \ -H 'Authorization: Bearer YOUR_API_KEY'
{ "id": "org_12", "object": "organization", "name": "Example DSP", "status": "active", "currency": "USD", "time_zone": "America/New_York" }

Every field is read-only.

FieldTypeValue
idstringorg_ and a number
objectstringorganization
namestringYour organization’s name
statusstringactive or inactive
currencystringUSD
time_zonestringYour organization’s IANA time zone, for example America/New_York. UTC if none was set. Insights, statements and invoices use it. A new campaign takes it for its daily budget: see Budgets.

The ad account object

{ "id": "acct_61", "object": "ad_account", "external_id": "adv-3021", "name": "Acme Home Services", "domain": "acme.example", "status": "active", "review_status": "approved", "rejection_reasons": [], "currency": "USD", "spend_limit": { "monthly_spend_limit_micros": 20000000000 }, "created_time": 1791590400, "updated_time": 1791590400 }
FieldTypeRules
namestringRequired on create. Trimmed, 3 to 256 characters, no control characters.
domainstringRequired on create. The advertiser’s website host name, like acme.example. Lowercased. Up to 253 characters, at least two labels. Each label is 1 to 63 of a-z, 0-9 and -, and does not start or end with -. The last label is not all digits. No scheme, path, port or trailing dot. Use punycode for a non-ASCII name.
external_idstringOptional. Your id for the advertiser. 1 to 256 characters, not blank, no control characters. Unique within your organization. null clears it.
spend_limitobjectOptional. { "monthly_spend_limit_micros": <integer> } caps the account’s spend per calendar month. The value is 1 to 1,000,000,000,000,000 ($1B) and a multiple of 10000 (whole cents). Send "spend_limit": null, or "monthly_spend_limit_micros": null, to remove the cap. With no cap the object returns "spend_limit": null.
statusstringRead-only: active, paused or archived. Change it with the status endpoints.
review_statusstringRead-only: pending, approved or rejected. Adzen’s review of the account.
rejection_reasonsstring[]Read-only. Always present on an ad account. [] unless review_status is rejected; then 1 to 10 reasons, each up to 200 characters. (An ad leaves the field out instead when it is not rejected.)
currencystringRead-only. USD.
created_time, updated_timeintegerRead-only. Unix seconds.

status is what you set. review_status is Adzen’s decision. An ad account serves only while status is active and review_status is approved.

Create an ad account

POST /ad_accounts

Only the organization key can create ad accounts. A new account has status: active and review_status: pending. You can create and activate campaigns, ad sets and ads in it while it is in review. Nothing in it serves until Adzen approves the account.

You can create campaigns in a new account as soon as the create call returns. Use the create response as the account’s first state: a GET or list can take a few seconds to include a new account.

HeaderRequiredValue
AuthorizationYesBearer YOUR_ORGANIZATION_KEY
Content-TypeYesapplication/json
Idempotency-KeyNo1 to 255 visible characters. See Idempotency.
curl -X POST https://api.adzen.ai/v1/ad-manager/ad_accounts \ -H 'Authorization: Bearer YOUR_ORGANIZATION_KEY' \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: 6f0b1f0e-acct-3021' \ -d '{ "name": "Acme Home Services", "domain": "acme.example", "external_id": "adv-3021", "spend_limit": { "monthly_spend_limit_micros": 20000000000 } }'

The response is 200 with the ad account object.

Retrieve, list and update

MethodPathNotes
GET/ad_accountsThe accounts your key reaches. List parameters, plus external_id.
GET/ad_accounts/{id}
POST/ad_accounts/{id}Update name, domain, external_id or spend_limit. Returns 200 with the ad account. A name or domain change sends the account back to review.

Review

Adzen reviews every new ad account. review_status and rejection_reasons show the outcome.

  • A change to name or domain sends an approved or rejected account back to pending and clears rejection_reasons. The account stops serving until Adzen approves it again.
  • A change to external_id or spend_limit does not affect review.
  • To have a rejected account reviewed again, change its name or domain.

Change status

MethodPathEffect
POST/ad_accounts/{id}/pauseStops serving every ad in the account. Campaign, ad set and ad statuses do not change; each reports a paused serving issue with source.object ad_account.
POST/ad_accounts/{id}/activateLifts the account pause. Everything that served before serves again.
POST/ad_accounts/{id}/archiveStops serving every ad in the account permanently.

Each call returns 200 with the ad account object. Repeating the current status returns 200. Archive is final: updating, pausing or activating an archived account is 409 archived, and creating or changing anything in it is 409 ad_account_archived.

Which key can do what

ActionOrganization keyAdvertiser key
GET /organizationYesYes
Create ad accountsYesNo: 403 organization_key_required
Read, update, pause, activate and archive an ad accountEvery account in the organizationIts own account
Campaigns, ad sets, ads, files, conversions and insightsEvery account in the organizationIts own account
Create, list and revoke API keysYesNo: 403 organization_key_required

Advertiser API keys

An advertiser key reaches one ad account. You create, list and revoke advertiser keys with the organization key. Each ad account can have up to 20 active keys. A new key works on its first request, as soon as the create call returns. A revoked key stops working within 30 seconds of the revoke.

MethodPathEffect
POST/ad_accounts/{id}/api_keysCreates a key. The secret is returned only in this response.
GET/ad_accounts/{id}/api_keysLists the account’s active and revoked keys in the list envelope. Takes limit, after, before and order. Secrets are never returned.
POST/ad_accounts/{id}/api_keys/{key_id}/revokeRevokes a key and returns it with status: revoked. Revoking a revoked key returns 200 with the same object.

Create a key

The body takes one field:

FieldTypeRequiredRules
namestringYesA label for your reference. Trimmed, 1 to 256 characters, no control characters.

Any other field is 400 invalid_value.

curl -X POST https://api.adzen.ai/v1/ad-manager/ad_accounts/acct_61/api_keys \ -H 'Authorization: Bearer YOUR_ORGANIZATION_KEY' \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: 2b7e-acct_61-key-1' \ -d '{ "name": "Acme production" }'
{ "id": "key_93", "object": "api_key", "ad_account_id": "acct_61", "name": "Acme production", "secret": "adz_sk_live_7Rk2...x7Qp", "last_four": "x7Qp", "status": "active", "created_time": 1791590400, "last_used_time": null }
FieldTypeRules
idstringkey_ and a number
ad_account_idstringThe ad account the key reaches
namestringYour label
secretstringOnly in the create response. Store it then. adz_sk_live_ followed by 43 characters; treat it as an opaque string.
last_fourstringRead-only. The last four characters of the secret.
statusstringRead-only: active or revoked.
created_timeintegerRead-only. Unix seconds.
last_used_timeintegerRead-only. Unix seconds when the key last made a request, accurate to about one minute. null if it has made none.

A retry of a create with the same Idempotency-Key returns 409 secret_shown_once and no secret. List the account’s keys to find the key. If you lost the secret, revoke the key and create a new one.

To rotate an advertiser key, create a new key, switch to it, then revoke the old one.

Budgets and billing

Delivery stops at whichever limit is reached first:

LevelControlHeadroom returns
Campaignbudget.daily_spend_limit_microsAt the campaign’s midnight. See Budgets.
Campaignbudget.lifetime_spend_limit_microsWhen you raise or remove it
Ad accountspend_limit.monthly_spend_limit_microsAt the start of the calendar month in your organization’s time zone, or when you raise or remove it
OrganizationYour credit limit with AdzenWhen Adzen records a payment against your invoices, or raises the limit

Each limit that stops delivery shows as a serving issue.

Each ad account gets a monthly statement, and your organization gets one invoice that covers them all. Both use your organization’s time zone. A statement’s total is the ad account’s spend_micros for that month in Insights, rounded half up to the cent.

Error responses

These are the codes specific to ad accounts and keys. Every code is in the error catalog.

StatuscodeWhenRetry?
400invalid_valueA field failed validation, or the body has a field the endpoint does not take. param names it.No
403organization_key_requiredAn advertiser key tried to create an ad account or use an /api_keys route.No
404not_foundNo such ad account or key in your organizationNo
409external_id_conflictAnother ad account in your organization already uses this external_idNo
409archivedThe ad account is archived and cannot changeNo
409ad_account_archivedYou created or changed something in an archived ad accountNo
409managed_by_adzenAdzen manages this object; it can be read but not changed.No
409organization_inactiveYour organization is not activeNo
409ad_account_inactiveThe ad account is not active and cannot get new keysNo
409key_limit_reachedThe ad account already has 20 active keysNo. Revoke a key first.
409secret_shown_onceA retry of a key create that already succeededNo
503upstream_unavailableA temporary error. Send the same request again.Yes, with backoff
Last updated on