Skip to main content

Error Handling

The Talonic API returns consistent JSON error responses with HTTP status codes, machine-readable error codes, and human-readable messages for every failure.

Error response format

Every error response includes three fields: status (HTTP code), code (machine-readable string), and message (human-readable explanation). Parse the code field for programmatic error handling.

# Example error response
{
  "status": 422,
  "code": "invalid_schema",
  "message": "Schema field 'amount' has unsupported type 'money'. Use 'number' instead."
}

HTTP status codes

StatusMeaningWhen it occurs
200OKRequest succeeded synchronously
202AcceptedAsync job created — poll via /v1/jobs/:id
400Bad RequestMalformed JSON, missing required field
401UnauthorizedMissing or invalid API key
403ForbiddenKey lacks permission for resource
404Not FoundResource does not exist
409ConflictResource already exists or version mismatch
422Unprocessable EntityValidation error (invalid schema, unsupported type)
429Too Many RequestsRate limit exceeded — see Retry-After header
500Internal Server ErrorUnexpected server failure
503Service UnavailableTemporary maintenance or overload

Error codes

These machine-readable codes appear in the code field. Use them to handle specific errors programmatically. See authentication for auth-specific errors, rate limits for throttling details, and extract for extraction-specific errors.

CodeStatusDescription
invalid_request400Malformed request body or missing required parameter
invalid_schema422Schema contains unsupported types or invalid structure
invalid_api_key401API key is missing, expired, or malformed
forbidden403API key lacks required permissions
not_found404Requested resource does not exist
conflict409Resource version conflict
rate_limited429Request rate exceeds plan limits
file_too_large422File exceeds plan size limit
unsupported_format422File format not supported for extraction
extraction_failed500Pipeline could not process the document
confidence_below_gate422Extraction confidence below the confidence gate threshold
server_error500Unexpected internal error

Retry strategy

For 429 and 503 errors, implement exponential backoff with jitter. The Retry-After header indicates the minimum wait time in seconds. For 500 errors, retry up to three times. Do not retry 400, 401, 403, or 422 errors — these require changes to your request. See the webhook retry policy for delivery-side retries.

Frequently asked questions