Status codes

Every REST status and the error bodies you will see most often.

StatusMeaning
200The call succeeded.
201A schema was created.
400A failed parse returns status "error", message, credits_used, and credits_remaining. That includes an export other than xlsx or csv, and a filename that is not a string, both caught before credits are spent. Schema routes (/api/v1/schemas) and whoami return status "error" and message naming the field or rule that failed, with no credit fields because they never spend credits. Their success bodies start with status "ok".
401The bearer token is missing, unknown, revoked, or expired. The response body is empty, and the call is omitted from Activity.
402The workspace does not have enough credits for this document. The body includes credits_required, credits_used, credits_remaining, and upgrade. A 402 does not spend. Allotments per plan are on the pricing page.
403Parsing is paused for this workspace.
404That schema was not found.
405The HTTP method does not match the route. The response body is empty.
409The schema name already exists, or the workspace is at its schema limit.
429This workspace already parsed in the last second. Limit is 1 parse per second per workspace. The body includes retry_after. REST also sends Retry-After. A 429 does not spend credits.
502The model could not extract the document. The body has status "error", message, credits_used 0 (the charge is refunded), and credits_remaining. With strict true, a chunk that could not be read also returns 502 with failed_page_ranges, the pages that failed.
503Storage or the job queue behind the parser could not be reached. The body has status "error", message, failure_code SERVICE_UNAVAILABLE, credits_used 0 (nothing is charged), and credits_remaining. REST also sends Retry-After. Retry the same request after that many seconds; a job id you sent in X-Job-Id can be reused.
504The parse took longer than 100 seconds (10 minutes with Prefer: respond-async) and was stopped. Same body as 502: the charge is refunded. Try again, or send fewer pages.

Error bodies

400 response.json
{
  "status": "error",
  "message": "Unknown schema: invoice",
  "credits_used": 0,
  "credits_remaining": 59
}