Errors
Every error code the Developer API answers, what it means and what to do.
Every error has the same shape, in all three parts of the API. It is an RFC 9457 problem, sent as application/problem+json, with three fields of TRAKI's own:
{
"type": "https://traki.io/developers/errors#scope_missing",
"title": "Forbidden",
"status": 403,
"detail": "This key does not have the calls:read scope. Add it to the key on the Developers page.",
"code": "scope_missing",
"requestId": "2b1f0c3e-6a1d-4a5e-9f0e-6c1d2b7a8e41",
"docUrl": "https://traki.io/developers/errors#scope_missing",
"errors": { "scope": "calls:read" }
}codeis stable. Write your code against it, not againstdetail, whose wording can change.requestIdis also in theX-Request-Idheader. Quote it when you contact support: it finds the request in your log and in ours.docUrllinks to the code's entry below.errorsis there only when there is more to say, such as the fields that failed or the scope that is missing.
A key that is missing, unknown, revoked or expired gets the same kind of answer whichever account it might belong to. The API never says whether a key exists in another account.
Keys
key_missing
401. The request has no Authorization header. Send Authorization: Bearer <your key>.
key_malformed
401. The header is there, but what follows Bearer is not a TRAKI key. Every key ends in a checksum, so a key that was cut short or mistyped is refused before anything else is checked. Copy the key again.
key_unknown
401. The key has the right shape but TRAKI does not know it. It may have been rolled, or it belongs to no account. Many unknown keys from one address in a minute get that address blocked for a while (see ip_blocked).
key_revoked
401. The key was revoked on the Developers page. Make a new one.
key_expired
401. The key reached its expiry date. Make a new one on the Developers page.
key_suspended
403. TRAKI suspended this key, usually because it looked leaked or misused. Contact support.
key_in_url
400. The key was sent in the address. Addresses end up in logs and browser history, so the API refuses it. Send the key in the Authorization header, and roll the key, since it may have been recorded.
key_in_body
400. The key was sent in the request body. Send it in the Authorization header instead.
wrong_api
403. The key opens a different part of the API. An Account API key only opens addresses under /v1/account/, a Buyer API key only /v1/buyer/, and a Publisher API key only /v1/publisher/.
scope_missing
403. The key is valid but lacks the scope this route needs. errors.scope names it. Add the scope to the key on the Developers page. Each reference page lists the scope its route needs.
ip_not_allowed
403. The key has an IP allow-list and the request came from an address not on it. Add the address to the key's list.
holder_inactive
403. The buyer or publisher that holds this key is paused or archived, or the account switched off its API access. detail says which.
test_mode_unavailable
403. Kept for older integrations: test mode is open now and test keys are not refused with this code.
The account
plan_no_api
403. API access comes with a paid plan, and this account is on a trial. Choose a plan in the portal.
account_inactive
403. The account is suspended or closed, so all of its keys are refused.
api_suspended
403. TRAKI suspended API access for this account. The portal still works. Contact support.
Limits
rate_limited
429. Too many requests in the current minute, for this key, this account or this address. Wait for the number of seconds in Retry-After, then retry. See rate limits.
concurrency_limited
429. This key already has as many requests running as it may. Wait for one to finish.
ip_blocked
403. Requests from this address are blocked, either by TRAKI or because it sent many unknown keys in a short time. An automatic block lifts after 15 minutes.
The request
validation_error
400. The request does not match the documented shape: a wrong type, a value out of range, an unknown field or a cursor TRAKI did not give out. errors lists each problem with its path and message.
not_found
404. No route matches the address, or no record with this ID exists in your account. A record in another account is always "not found", never "forbidden".
version_conflict
409. The record changed since you read it. Fetch it again and redo your change on the new version.
on_behalf_invalid
400. The Traki-On-Behalf-Of header is written wrongly, sent on an Account API route, or names the wrong kind of party for the route. It is written buyer:<id> on Buyer API routes and publisher:<id> on Publisher API routes. A buyer or publisher of another account answers not_found.
origin_not_allowed
403. A browser called from a site that may not use this credential. Only a portal session's own origins (and the docs site's tester, with test keys) may call the API from a page.
Safe retries
idempotency_key_required
400. This change moves money or buys something, so it must carry an Idempotency-Key header. See safe retries.
idempotency_key_reused
422. This Idempotency-Key was already used for a different request. Use a new key for a new request.
idempotency_in_progress
409. A request with this Idempotency-Key is still running. Retry in a moment to get its result.
TRAKI's side
internal_error
500. Something went wrong at TRAKI. It is safe to retry; for a change, retry with the same Idempotency-Key. If it keeps happening, contact support with the requestId.
api_disabled
503. The whole Developer API is switched off for maintenance. Retry later.
api_read_only
503. The API is read-only for a while: reads work, changes are refused. Retry the change later.
route_disabled
503. This one route is switched off for a while. Other routes still work.
Other codes
A route may answer a code from the rest of TRAKI, such as a conflict on a record. Those answers have the same shape. When you meet a code that is not listed here, act on the status.