Errors
Errors use RFC 9457 problem details with the media type application/problem+json. Every problem has a title, the HTTP status, a stable machine-readable code and a human-readable detail. Upload errors also include the upload’s trace_id.
{ "title": "Conflict", "status": 409, "code": "result_pending", "detail": "The document is still processing."}Branch on the HTTP status and code. Show detail to people, but do not parse it: its wording can change.
Error codes
Section titled “Error codes”This table is rendered from the contract’s error mapping in api/specs/service-interfaces.md.
| Where | Status and code | Meaning |
|---|---|---|
| Any authenticated operation | 401 invalid_api_key | Bearer credential missing or invalid. |
| Document read or ticket request | 404 document_not_found | ID unknown or outside the caller's scope. |
| Upload | 400 invalid_request, 413 upload_too_large, 415 unsupported_media_type, 422 invalid_options | Malformed request, size limit exceeded, wrong content type, or invalid chunk size, profile, or export selection. |
| Upload | 422 invalid_pdf | Admission detected an empty or invalid PDF. A parse failure discovered after acceptance instead appears in the document snapshot. |
| Result or file read on an authorized document | 409 result_pending or 409 document_failed | The document is still processing or ended in failure. A status read returns 200 in either case. |
| File read on a successful document | 404 artifact_not_found | The requested name is absent from the published manifest. Only listed filenames identify downloadable files. |
| History read | 400 invalid_request or 409 event_cursor_unavailable | Invalid pagination parameters, or a valid cursor outside the retained replay window. |
| Upload or owner route | 503 owner_busy or 503 owner_unavailable | Admission capacity is exhausted or the owning instance is offline. An offline owner cannot serve its existing documents. |
Retrying
Section titled “Retrying”| Response | Retry? |
|---|---|
429 quota_exceeded, 503 owner_busy |
Yes, after the Retry-After seconds |
409 admission_in_progress |
Yes, after Retry-After, with the same Idempotency-Key |
409 result_pending |
Yes, once the status shows succeeded; read the status instead of polling the manifest |
503 owner_unavailable, 503 control_plane_unavailable |
Yes, with backoff |
| Network errors and timeouts on upload | Yes, with the same Idempotency-Key |
Other 4xx |
No. Fix the request first. |
Processing failures after upload are not HTTP errors: the upload succeeded, and the document’s status reports failed with a failure object.