Skip to Content
API referenceAuthentication

Authentication

Every partner endpoint takes an API key in a request header. Health checks and tracking URLs take no key.

Headers

ProductX-API-Key: <key>Authorization: Bearer <key>
UGC API (/v1/ugc)YesNo
AI API (/v1/ai)YesYes
Publisher insights (/v1/publisher/insights)YesYes
Ads API (/v1/ad-manager)YesYes
  • Header names are case-insensitive.
  • If a request carries both headers, Adzen uses X-API-Key.
  • On the Ads API, send Authorization: Bearer <key>. Its error bodies carry the codes listed in Errors.
curl -X POST https://api.adzen.ai/v1/ugc/process \ -H 'X-API-Key: YOUR_UGC_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ ... }'
curl https://api.adzen.ai/v1/ad-manager/organization \ -H 'Authorization: Bearer YOUR_ORGANIZATION_KEY'

Key types

KeyWorks onIssued by
UGC API keyUGC APIAdzen
AI API keyAI API and Publisher insightsAdzen
Reporting keyPublisher insights only. Web publishers’ only key, and UGC partners’ key for reporting.Adzen
Organization keyAds API, every ad account in your organizationAdzen
Advertiser keyAds API, one ad accountYou, with the organization key. See Advertiser API keys.

A key works only on the products in its row. A key sent to another product gets 401, the same answer as an unknown key.

Treat a key as an opaque string. Formats differ by key type. Do not parse or validate them.

Getting a key

  1. Contact your Adzen account representative, or contact Adzen , to be onboarded.
  2. Adzen issues the UGC API key, AI API key, reporting key or organization key for the products you use.
  3. Create advertiser keys yourself with the organization key.

Each key is shown once, when it is issued or created. Store it then. A new key works on its first request.

Sandbox keys are separate from production keys. See Sandbox.

Rotating keys

KeyHow it rotatesOld key
AI API keyAdzen rotates it when you ask your account representative.Works for 14 days after the rotation, then stops.
Organization keyAdzen rotates it when you ask your account representative.Works for 14 days after the rotation, then stops.
UGC API keyAdzen rotates it when you ask your account representative.Keeps working until Adzen retires it. Tell your account representative when you have switched.
Advertiser keyYou create a new key, switch to it, then revoke the old one. See Advertiser API keys.Stops working within 30 seconds of the revoke.

Deploy the new key before the old one stops working.

Errors

Auth errors use a different body on each product.

ProductStatusBodyWhenRetry?
UGC API401missing X-Api-Key header (plain text)No X-API-Key headerNo
UGC API401unknown API key (plain text)Unknown key, or a key for another productNo
AI API401{"error": "missing profile id"}The key is missing, unknown or for another productNo. Check the key.
AI API401{"error": "unknown profile"}The key is valid, but your account is not set up for the AI APINo. Contact your account representative.
AI API403{"error": "publisher profile is disabled"}Your account is disabledNo
Publisher insights401Envelope, code missing_api_keyNo keyNo
Publisher insights401Envelope, code invalid_api_keyUnknown key, or a key for another productNo
Publisher insights403Envelope, code account_disabledYour account is disabledNo
Publisher insights503Envelope, code authentication_unavailableA temporary errorYes, with backoff
Ads API401Envelope, code missing_api_keyNo keyNo
Ads API401Envelope, code invalid_api_keyUnknown key, or a key for another productNo
Ads API403Envelope, code account_disabledThe organization or ad account is disabledNo
Ads API503Envelope, code authentication_unavailableA temporary errorYes, with backoff
All products403Not JSONThe request came from an IP address outside the USNo

Publisher insights and the Ads API return this envelope (Ads API example):

{ "error": { "type": "authentication_error", "code": "missing_api_key", "message": "an API key is required: send it as Authorization: Bearer <key>", "param": null } }

On Publisher insights, the missing_api_key message is an API key is required: send it as X-API-Key: <key> or Authorization: Bearer <key>.

Statustype
401authentication_error
403permission_error
503api_error
  • A 401 from Publisher insights or the Ads API carries WWW-Authenticate: ApiKey realm="adzen", header="X-API-Key".
  • On the Ads API, a request that sends its key in X-API-Key gets the same status codes with a body of the form {"error": "...", "message": "..."} in place of the envelope. Match on the status code, or send the key as Authorization: Bearer to get the envelope.
  • On the UGC API, a key whose account is disabled gets 200 with "ads": [].

Each product page lists its other errors: UGC API, AI API, Publisher insights, Ads API.

Last updated on