Docs
Contact

Errors and rate limits

What a refused request answers, how to repeat one safely, and when to wait and try again.

Errors

A refused request answers one of these statuses:

StatusMeans
400The request lacks something every such request needs, such as a required Idempotency-Key
401No token, or an expired or unknown one: get a new one, see Authentication
403The token is valid, but lacks the route's scope
404Nothing of yours at this address: an unknown id, or another organization's
409The request does not fit the resource's state, or repeats an Idempotency-Key with another body
422A field is missing or not valid
429Too many requests: wait for Retry-After seconds
500The API failed: quote the request_id when you ask for help
503Not now: wait for Retry-After seconds, then send the same request again

The body is a Problem document (RFC 9457), sent as application/problem+json:

{  "type": "about:blank",  "title": "Forbidden",  "status": 403,  "code": "insufficient_scope",  "request_id": "0193b2f4-6c1d-7a3e-9b52-8f3c1d2e4b5a"}
FieldMeans
codeWhat happened, in snake_case. Codes are stable: branch on them, not on title
request_idThe request, as YOU(th)'s logs name it. Quote it when you ask for help
codeStatusMeans
idempotency_key_required400The route requires an Idempotency-Key, and the request has none
idempotency_key_invalid400The Idempotency-Key is empty, or longer than 255 characters
invalid_token401No token, an expired or unknown one, or one asked for without scope
integration_revoked401The integration was revoked: use another one's credentials
insufficient_scope403The token lacks the route's scope
not_found404Nothing of yours at this address
idempotency_conflict409The Idempotency-Key was used with another body
idempotency_in_progress409A request with the Idempotency-Key runs now: wait for Retry-After
internal_error500The API failed
identity_unavailable503The API cannot check the token now: wait for Retry-After
timed_out503The API gave up on the request: wait for Retry-After
temporarily_unavailable503The API can't finish the request now: wait for Retry-After

A route's own page lists the codes only it answers. New codes can appear: treat one you do not know by its status.

Repeat a request safely

Send an Idempotency-Key header of your own, a UUID for example, of at most 255 characters, with a POST that creates something. Within 24 hours of the latest attempt, the same key with the same body answers what the first request answered, and creates nothing new. Use it whenever you try again after a timeout. A request that was refused or failed keeps nothing: the same key and body try again, and go on with what it left half done.

RequestAnswers
The same key, the same bodyWhat the first request did
The same key, another body409, idempotency_conflict
The same key, while a request with it runs409, idempotency_in_progress, Retry-After
No key, on POST /v1/access-code-batches400, idempotency_key_required

Ordering a batch requires the key, because a repeat without one would order twice. Every other POST that creates something accepts it.

Rate limits

A client that sends too many requests gets 429, and a request the API cannot serve now gets 503. When the answer carries a Retry-After header, wait that many seconds, then try again; without one, wait a few seconds, and longer after each failure. Go by the status of a 429, whatever its body.

Ordering access codes also has a daily limit: your organization's batches ordered in one day, from 00:00 UTC, hold at most 1,000 codes together, unless your YOU(th) contact had it raised. An order past it answers 422 count_over_limit and makes nothing: see The daily limit.

A CSV file of access codes holds at most 50,000. A list longer than that answers 422 too_many_codes: filter it by batch_id or a time range, or read it a page at a time as JSON. See Read the codes.

Last updated