Reference

Errors

The error format, HTTP status codes and every error code with what to do about it.

Every error has the same JSON body:

json
{
  "error_id": "err_262f371ad0",
  "code": "invalid_request",
  "message": "document_id: Field required"
}
  • Branch on code; it is stable. message is for people and may change.
  • Include error_id when you contact support.
  • 429 responses have a Retry-After header in seconds.

What to retry#

StatusRetry?
400, 401, 403, 404, 409, 413, 415, 422No. Fix the request first.
402After adding credit.
429Yes, after Retry-After seconds.
500, 502, 503, 504Yes, with exponential backoff. Use an Idempotency-Key when creating extractions.

Error codes#

Authentication and access#

CodeStatusMeaning
unauthorized401The key is missing, wrong or revoked. Send Authorization: Bearer <key>.
insufficient_scope403The key lacks the scope this call needs.
mode_mismatch403A test key asked for live data or the other way around.
insufficient_credits402The balance is used up; live extractions and suggestions are blocked.

Requests#

CodeStatusMeaning
invalid_request400, 422A parameter or body field is missing or invalid; message names it.
invalid_metadata400metadata breaks a limit (20 keys, 40-character keys, 500-character string values) or test_outcome is unknown.
invalid_cursor400The cursor is not one returned by this list.
idempotency_conflict409The Idempotency-Key was used for a different request.
not_found404No such endpoint.
method_not_allowed405The endpoint does not support this HTTP method.

Limits#

CodeStatusMeaning
rate_limited429Too many requests per minute for this key. Wait Retry-After seconds.
concurrency_limit429Too many extractions are open at once. Wait for some to finish.
key_limit_reached409The account has the maximum number of API keys. Revoke one first.
webhook_limit_reached409The account has the maximum number of webhook endpoints.

Documents#

CodeStatusMeaning
upload_too_large413The file is larger than the upload limit.
unsupported_media_type415The file type is not supported, or its content does not match its extension. See supported formats.
malformed_document422The file could not be read.
encrypted_document422The file is password protected.
document_limit_exceeded422The document has too many pages, sheets or cells.
document_not_found404No such document in this mode, or it was deleted.
document_in_use409A run on the document is still in progress; delete it when the run ends.

Schemas#

CodeStatusMeaning
invalid_schema422The JSON Schema breaks a rule; message names it.
schema_not_found404No such schema.
schema_version_not_found404The schema has no such version.
schema_conflict409base_version is older than the latest version. Reload and try again.
template_not_found404No such template.

Extractions#

CodeStatusMeaning
job_not_found404No such extraction in this mode.
job_not_completed409The job has no result: it is still running (wait), or it failed or was cancelled (see last_error).
result_requires_pagination413The result is very large; use /result/manifest, /result/collections or /result/export.
not_available_in_test_mode404This route exists only for live jobs.
test_mode_unsupported400The feature (schema suggestions) needs a live key.

Webhooks#

CodeStatusMeaning
invalid_webhook_url400Not an absolute URL, or a live URL that is not public https.
invalid_webhook_events400An unknown event type.
webhook_not_found404No such endpoint.
webhook_delivery_not_found404No such delivery.
webhook_disabled409Enable the endpoint before resending.

Errors inside jobs#

A job that fails after it started has status: "failed" and a readable last_error instead of an HTTP error. Common causes are a model provider outage (retry later), job_time_limit_exceeded or model input limits for very large documents (split the document or narrow the schema).