DocumentationErrors and idempotency

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"
  }
}
PropertyTypeContract
request_idStringCorrelation identifier; does not guarantee job reservation.
error.codeStringMachine-readable error identifier.
error.messageStringHuman-readable English message; not a stable parsing interface.
error.actionString enumRecovery 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.actionSemantics
fix_requestInput or route correction required; expired results remain unavailable.
check_api_keyAuthentication failure.
replace_imagesInput image replacement required; an existing reserved key cannot accept different bytes.
retry_laterRetryable condition with the same key, bytes, mode, and profile; delay in Retry-After when present.
check_quotaAccount allowance exhausted.
check_statusOriginal outcome requires resolution through the known job identifier.
contact_supportNo automatic recovery defined.

Actions are independent of quota accounting. A credit does not imply a retry.

Request and access errors

CodeHTTPCause
invalid_api_key401Missing, malformed, invalid, or revoked key.
invalid_idempotency_key400Missing key or invalid characters/length.
invalid_content_type415Body is not multipart.
invalid_form400Unparseable multipart or an unknown field.
invalid_options400Unsupported, duplicated, or route-incompatible mode/profile.
missing_images400Image-field cardinality does not match mode.
invalid_image400 or 422Invalid image bytes, type, container, or animation.
file_too_large413Image or multipart body exceeds its limit.
image_dimensions422Decoded dimensions or pixel area exceed the limits.
identical_sides422Identical front/back bytes.
image_too_complex422Generated detail images exceed the preparation size limit.
idempotency_conflict409Reserved key with different bytes, mode, or profile.
method_not_allowed405Unsupported method; accepted method in Allow.
not_found404Unknown route or job outside the authenticated account.
result_expired410Result-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

CodeHTTPDelay or limit
rate_limited429Retry-After: 1–60, according to the rolling window.
concurrency_limited429Normally Retry-After: 2.
admission_changed429Reservation availability changed; normally Retry-After: 1.
quota_exceeded429Monthly quota exhausted; no short retry interval.
trial_exhausted429Total pilot allowance exhausted.
trial_expired403Pilot 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

CodeSemantics
no_fieldsNo usable fields; a reserved attempt remains billable.
image_service_unavailableInspection unavailable; action retry_later.
submission_unknown, service_unavailableUnconfirmed submission or state; action check_status.
upstream_busyResult retrieval temporarily unavailable.
upstream_unavailable, upstream_timeout, image_timeoutProcessing stage did not complete.
not_configured, result_unavailable, invalid_operationConfiguration or result retrieval failure requiring support.
upstream_submission_failed, image_preparation_failed, invalid_ocr_response, extraction_failed, processing_expiredProcessing 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

RequestBehavior
Same account, key, bytes, mode, and profileSame job with no additional unit, including across API versions.
Reserved key with changed bytes or options409 idempotency_conflict.
New key with identical photographsCan reserve another job and consume another unit.
Failed or expired job replayStored 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.