Errors
Every error has the same shape. Branch on the code and the reason, and show the message to people.
Every error has this shape. Branch on the code and the reason. The message is for people.
{
"error": {
"code": "forbidden",
"message": "The vendor agreement has changed. Read the new version, then sign it.",
"reason": "agreement_owed"
}
}| Status | Code | Meaning |
|---|---|---|
401 | unauthorized | No key was sent, or the key can't be used here. The answer is the same for every reason a key can't be used, on purpose. |
403 | forbidden | The key is good and the call isn't allowed: the key lacks the call's scope, or your account can't do this right now. reason says which. |
404 | not_found | What you named isn't on your account. Something that doesn't exist and something of someone else's answer alike. |
422 | invalid | The request was understood and refused. The message says what to fix. A body that isn't JSON at all answers 400, and one over 1 MB answers 413. |
409 | conflict | The call can't be done in the state things are in. reason says why. |
429 | rate_limited | Over a limit. Wait the Retry-After seconds, then try again. |
500 | internal | Something went wrong on the platform's side. Try again in a moment, and tell support if it lasts. |
Reasons
A refusal your software can act on carries a reason. This is each one, and the status it comes with.
| Reason | Status | Meaning |
|---|---|---|
not_a_vendor | 403 | The key's account isn't a lead vendor's account. |
stopped | 403 | Your account is paused or suspended. Reads still work, and nothing can be sent until the platform lifts it. |
cant_post | 403 | Your account can't send anything right now. |
agreement_owed | 403 | The vendor agreement has changed. Sign the new version on the website, then send again. |
attestation_owed | 403 | The feed attestation has changed. Sign the new version on the website, then send again. |
ad_not_found | 404 | That ad isn't on your account. Another vendor's ad reads the same as one that doesn't exist. |
ad_retired | 422 | That ad is retired, so it can't take leads. |
scrub_date | 422 | The scrub date is missing, in the future, or more than 31 days old. |
row_count | 422 | A post holds 1 to 500 rows. |
upload_budget | 429 | You've asked for 20 upload addresses today. Retry-After says when the day turns over, at midnight UTC. |
upload_budget_unavailable | 500 | Your upload addresses for today couldn't be counted just now, so none was made. Try again in a moment. |
file_open | 409 | Another of your files is still being read. Wait for it to finish, then start this one. |
file_too_big | 422 | The file is over 50 MB. |
storage_off | 422 | File uploads aren't available right now. |
upload_not_valid | 422 | That uploadId isn't one this account was given. |
upload_not_found | 422 | Nothing has been put at that upload's address yet, or it has expired. |
upload_size_changed | 422 | The file put at the address isn't the size you asked for. |
upload_already_started | 422 | That uploadId has already started a file on another of your ads. |
idempotency_key_reused | 409 | This Idempotency-Key was sent before with a different body, or to another ad. Make a new key for a new post. |
cant_read | 403 | Your account can't read this right now, usually because something is waiting to be signed. GET /me says why. |
file_not_found | 404 | That file isn't on your account. Another vendor's file, a day's feed and an id nobody has all read the same. |
Any call can be refused for these
| Status | Code | When |
|---|---|---|
401 | unauthorized | No key was sent. The message is Missing API key. |
401 | unauthorized | The key can't be used here, for any reason at all. The message is Invalid or revoked API key. |
403 | forbidden | The key doesn't have the call's scope. The message names it. |
429 | rate_limited | Over the minute's or the day's requests. Retry-After says how many seconds to wait. |