Errors

The error envelope, every error code the API returns, and which errors are worth retrying.

Every error has the same body: a human-readable English error and a stable machine-readable code.

json

{ "error": "No such booking.", "code": "not_found" }

Branch on code, never on error. The messages are written for a person reading a log and we improve them without notice; the codes are part of the contract. Some codes carry extra fields next to error and code — they are listed in the table.

Error codes#

CodeStatusMeaningExtra
api_key_missing401No Authorization: Bearer header
api_key_invalid401Unknown key
api_key_revoked401The key was revoked — stop retrying
api_key_expired401The key expired — stop retrying
app_not_enabled403The API is not open for this organisation — no key or webhook has been created under SettingsAppsFor developers
plan_upgrade_required403The organisation's plan does not include the API
site_unavailable403The organisation is suspended or deleted — every key and webhook is off. Stop retrying until the merchant tells you otherwise
insufficient_scope403The key lacks a scoperequired_scope
not_found404No such resource — also the answer for another organisation's id
site_not_found404The key authenticated but its organisation could not be read
experience_date_not_found404No such departure when creating a booking
validation_failed400 / 422See belowissues[]
payload_too_large413The request body exceeds 64 KB
idempotency_key_required400This endpoint requires an Idempotency-Key
idempotency_key_reused422That key was already used with a different body
idempotency_in_progress409A request with that key is still running
insufficient_capacity409Not enough seats left on the departureseats_available
conflict409The request contradicts the current state
webhook_url_invalid422Not an https URL, contains credentials, or is an IP address in a private range. Host names are checked again at every delivery, so a name that points inward fails there insteadissues[]
webhook_endpoint_limit422The organisation already has 10 webhook endpoints
webhook_delivery_not_retryable409That delivery already succeeded, or is queued
rate_limited429Too many requests — see Rate limits
internal_error500Something broke on our side

Which of these a given endpoint can return is listed per operation in the API reference.

Validation errors#

validation_failed is 400 for unparseable JSON, a bad query parameter or a starting_after cursor that was modified (cursors are signed — pass them back untouched). It is 422 when the body parsed but is not acceptable. Either way it lists what was wrong, field by field:

json

{
  "error": "The request body is not valid.",
  "code": "validation_failed",
  "issues": [
    { "path": "guests.0.count", "message": "Expected number, received string" },
    { "path": "customer.email", "message": "Invalid email" }
  ]
}

What to retry#

StatusRetry?
429Yes, after retry-after seconds (or the window in x-ratelimit-reset)
5xxYes, with backoff — and the same Idempotency-Key
409 idempotency_in_progressYes, after a moment, same key
Other 4xxNo. Fix the request first

401 api_key_revoked, 401 api_key_expired and 403 site_unavailable in particular will not fix themselves — stop and alert a person. See Idempotency for why a retry with the same key is always safe.

Getting help#

When you contact Awrora support about an error, bring the code from the response, roughly when the request was made, and the key's prefix (the first twelve characters shown in Awrora). Never send the whole key. Every authenticated call is logged with its path, status and duration, so the request can usually be found quickly. 429 responses are sampled — at most one log row per key per minute.