Errors and idempotency
Error schema, HTTP mappings, recovery actions, and replay semantics.
On this page
Error envelope
{
"request_id": "00000000-0000-4000-8000-000000000001",
"error": {
"code": "concurrency_limited",
"message": "The company has reached its limit of active readings. Follow Retry-After.",
"action": "retry_later"
}
}
| Property | Type | Contract |
|---|---|---|
request_id | String | Correlation identifier; does not guarantee job reservation. |
error.code | String | Machine-readable error identifier. |
error.message | String | Human-readable English message; not a stable parsing interface. |
error.action | String enum | Recovery classification defined below. |
Network and edge-generated failures can lack this envelope. HTTP status alone does not determine whether a reading unit was reserved.
Actions
error.action | Semantics |
|---|---|
fix_request | Input or route correction required; expired results remain unavailable. |
check_api_key | Authentication failure. |
replace_images | Input image replacement required; an existing reserved key cannot accept different bytes. |
retry_later | Retryable condition with the same key, bytes, mode, and profile; delay in Retry-After when present. |
check_quota | Account allowance exhausted. |
check_status | Original outcome requires resolution through the known job identifier. |
contact_support | No automatic recovery defined. |
Actions are independent of quota accounting. A credit does not imply a retry.
Request and access errors
| Code | HTTP | Cause |
|---|---|---|
invalid_api_key | 401 | Missing, malformed, invalid, or revoked key. |
invalid_idempotency_key | 400 | Missing key or invalid characters/length. |
invalid_content_type | 415 | Body is not multipart. |
invalid_form | 400 | Unparseable multipart or an unknown field. |
invalid_options | 400 | Unsupported, duplicated, or route-incompatible mode/profile. |
missing_images | 400 | Image-field cardinality does not match mode. |
invalid_image | 400 or 422 | Invalid image bytes, type, container, or animation. |
file_too_large | 413 | Image or multipart body exceeds its limit. |
image_dimensions | 422 | Decoded dimensions or pixel area exceed the limits. |
identical_sides | 422 | Identical front/back bytes. |
image_too_complex | 422 | Generated detail images exceed the preparation size limit. |
idempotency_conflict | 409 | Reserved key with different bytes, mode, or profile. |
method_not_allowed | 405 | Unsupported method; accepted method in Allow. |
not_found | 404 | Unknown route or job outside the authenticated account. |
result_expired | 410 | Result-access window ended. |
A rejection before reservation creates no new job and does not modify an existing reservation for the same key. Fingerprint conflicts apply to reserved keys.
Admission errors
| Code | HTTP | Delay or limit |
|---|---|---|
rate_limited | 429 | Retry-After: 1–60, according to the rolling window. |
concurrency_limited | 429 | Normally Retry-After: 2. |
admission_changed | 429 | Reservation availability changed; normally Retry-After: 1. |
quota_exceeded | 429 | Monthly quota exhausted; no short retry interval. |
trial_exhausted | 429 | Total pilot allowance exhausted. |
trial_expired | 403 | Pilot access for new jobs expired. |
Admission rejections create no job. The response header determines the actual retry interval; 429 includes both temporary admission limits and exhausted allowances.
Processing and service errors
| Code | Semantics |
|---|---|
no_fields | No usable fields; a reserved attempt remains billable. |
image_service_unavailable | Inspection unavailable; action retry_later. |
submission_unknown, service_unavailable | Unconfirmed submission or state; action check_status. |
upstream_busy | Result retrieval temporarily unavailable. |
upstream_unavailable, upstream_timeout, image_timeout | Processing stage did not complete. |
not_configured, result_unavailable, invalid_operation | Configuration or result retrieval failure requiring support. |
upstream_submission_failed, image_preparation_failed, invalid_ocr_response, extraction_failed, processing_expired | Processing failure or expired reservation. |
Initial processing failures can return 502, 503, or 504; image errors and unreadable output can return 422. GET or replay of a stored failed job returns terminal 422, regardless of the original status. For that terminal response, check_status actions become contact_support. GET never restarts a failed job.
Recorded technical failures credit the reserved unit; no_fields retains it. Attempt history and rolling-minute accounting remain. Historical failures retain their recorded usage.
Unconfirmed outcomes
A timeout, disconnect, or non-JSON response leaves reservation and completion unknown. The original key, bytes, mode, and profile retain the same idempotency scope; a new key represents a separate potential reservation.
A known request_id identifies the GET state resource. 404 can mean pre-reservation rejection, an unknown identifier, or another account's job; it does not prove that the original transaction can be replaced safely.
Idempotency rules
| Request | Behavior |
|---|---|
| Same account, key, bytes, mode, and profile | Same job with no additional unit, including across API versions. |
| Reserved key with changed bytes or options | 409 idempotency_conflict. |
| New key with identical photographs | Can reserve another job and consume another unit. |
| Failed or expired job replay | Stored failure or expiry; no replacement extraction. |
Keys match ^[A-Za-z0-9._:-]{8,128}$. The key is stable for the transaction, including recovery attempts. Byte identity includes image metadata and encoding, not only visible content.