Authentication
Every partner endpoint takes an API key in a request header. Health checks and tracking URLs take no key.
Headers
| Product | X-API-Key: <key> | Authorization: Bearer <key> |
|---|---|---|
UGC API (/v1/ugc) | Yes | No |
AI API (/v1/ai) | Yes | Yes |
Publisher insights (/v1/publisher/insights) | Yes | Yes |
Ads API (/v1/ad-manager) | Yes | Yes |
- 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
| Key | Works on | Issued by |
|---|---|---|
| UGC API key | UGC API | Adzen |
| AI API key | AI API and Publisher insights | Adzen |
| Reporting key | Publisher insights only. Web publishers’ only key, and UGC partners’ key for reporting. | Adzen |
| Organization key | Ads API, every ad account in your organization | Adzen |
| Advertiser key | Ads API, one ad account | You, 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
- Contact your Adzen account representative, or contact Adzen , to be onboarded.
- Adzen issues the UGC API key, AI API key, reporting key or organization key for the products you use.
- 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
| Key | How it rotates | Old key |
|---|---|---|
| AI API key | Adzen rotates it when you ask your account representative. | Works for 14 days after the rotation, then stops. |
| Organization key | Adzen rotates it when you ask your account representative. | Works for 14 days after the rotation, then stops. |
| UGC API key | Adzen rotates it when you ask your account representative. | Keeps working until Adzen retires it. Tell your account representative when you have switched. |
| Advertiser key | You 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.
| Product | Status | Body | When | Retry? |
|---|---|---|---|---|
| UGC API | 401 | missing X-Api-Key header (plain text) | No X-API-Key header | No |
| UGC API | 401 | unknown API key (plain text) | Unknown key, or a key for another product | No |
| AI API | 401 | {"error": "missing profile id"} | The key is missing, unknown or for another product | No. Check the key. |
| AI API | 401 | {"error": "unknown profile"} | The key is valid, but your account is not set up for the AI API | No. Contact your account representative. |
| AI API | 403 | {"error": "publisher profile is disabled"} | Your account is disabled | No |
| Publisher insights | 401 | Envelope, code missing_api_key | No key | No |
| Publisher insights | 401 | Envelope, code invalid_api_key | Unknown key, or a key for another product | No |
| Publisher insights | 403 | Envelope, code account_disabled | Your account is disabled | No |
| Publisher insights | 503 | Envelope, code authentication_unavailable | A temporary error | Yes, with backoff |
| Ads API | 401 | Envelope, code missing_api_key | No key | No |
| Ads API | 401 | Envelope, code invalid_api_key | Unknown key, or a key for another product | No |
| Ads API | 403 | Envelope, code account_disabled | The organization or ad account is disabled | No |
| Ads API | 503 | Envelope, code authentication_unavailable | A temporary error | Yes, with backoff |
| All products | 403 | Not JSON | The request came from an IP address outside the US | No |
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>.
| Status | type |
|---|---|
401 | authentication_error |
403 | permission_error |
503 | api_error |
- A
401from Publisher insights or the Ads API carriesWWW-Authenticate: ApiKey realm="adzen", header="X-API-Key". - On the Ads API, a request that sends its key in
X-API-Keygets 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 asAuthorization: Bearerto get the envelope. - On the UGC API, a key whose account is disabled gets
200with"ads": [].
Each product page lists its other errors: UGC API, AI API, Publisher insights, Ads API.