Error reference
Two things return an error code and a partner cannot tell them apart from the outside, so both are listed here.
An HTTP error answers your request: a non-2xx status carrying
error.code. A job error is a submission we accepted that failed during
analysis; it arrives as HTTP 200 with "status": "failed" and a code in
job.error.code. Read a code together with where it came from, never on its
own.
Branch on the code. Each code has exactly one status and one fixed message,
and every error envelope also carries doc_url, a link to the code’s row on
this page, and retryable — see Errors for the envelope
and the reasoning.
HTTP error codes (29)
retryable: true means: send the same request with the same
Idempotency-Key again, after Retry-After or with backoff — see
Retries and backoff. Every other code needs a change
before it can succeed.
Job error codes (3)
Delivered inside a 200 response, on a job whose status is failed:
Nothing in your HTTP client raises on these. A 200 whose status is
failed reaches code that assumed success unless you check status before
reading output — Asynchronous jobs.
Handling an unfamiliar code
Adding a code is not a breaking change, so your integration will meet one it
does not know. Read its retryable field, and fall back to the status class
rather than crashing: treat an unrecognised 4xx as your own fault and do not
retry it, an unrecognised 5xx as ours and retry it with backoff, and an
unrecognised job error as a terminal failure of that job. Log the code and the
request_id so the gap is visible.
Renaming or removing a code is breaking; see Versioning.