Error Response Format
Every error response includes a JSON body with the following structure:A machine-readable code identifying the type of error. Use this for programmatic error handling.
Legacy alias for
error_code. Both fields always contain the same value. New integrations should use error_code.A human-readable description of the error. Useful for debugging and logging. Not all errors include a message.
Error Codes Reference
Authentication & Authorization
Request Validation
File Upload
Questions & Sessions
Rate Limiting & Credits
Server Errors
Handling Errors
Recommended Approach
- Check the HTTP status code to determine the error category (4xx = client error, 5xx = server error).
- Switch on
error_codefor specific handling logic (e.g., retrying onrate_limit_exceeded, re-uploading oninvalid_upload_job). - Log the
messagefor debugging purposes.
Retry Strategy
- 429 (rate_limit_exceeded): Retry with exponential backoff.
- 500 (internal_error): Retry up to 3 times with backoff. If the error persists, contact support.
- 400/401/403/404: Do not retry — fix the request or credentials first.