When an error occurs, the Edit API returns a structured error with the following fields:
Where an error shows up depends on which endpoint you use.
/edit) waits for processing to finish, so every failure — both request validation and document processing — comes back as an HTTP error response with the fields above. The HTTP status codes below apply to this endpoint./edit_runs) returns 200 with an edit run as soon as the job is accepted. Request-level problems (invalid request, auth) still return an HTTP error at creation time, but document processing failures are not HTTP errors — the run instead reaches status: "FAILED" with a failureReason and failureMessage (one of the failure reasons below), which you read when you poll or receive the webhook.Production integrations should use the asynchronous /edit_runs endpoint and check status on the returned run. See Move to production with async processing.
These codes describe why an edit failed. On the sync endpoint they appear in the error body’s code field; on the async endpoint they appear as the run’s failureReason. Most are client errors related to the file or config and are not retryable. The structured error’s retryable flag is authoritative at runtime.
Additional failure reasons may be added in the future. Handle unknown values gracefully.
These HTTP status codes are returned by the synchronous /edit endpoint. On the asynchronous /edit_runs endpoint, only request-level errors are returned at creation time — processing failures surface on the run as status: "FAILED". We generally recommend relying on the failure reasons above for programmatic handling.
Returned when required fields are missing (e.g. file), the file locator is invalid, or the config contains invalid options.
Returned when the API token is missing or invalid.
Returned when the workspace has insufficient credits to process the file.
Returned when the authenticated workspace or token doesn’t have permission to use the edit functionality.
Returned when a referenced file or resource cannot be found.
Returned when the file cannot be processed — for example, it is corrupt, password protected, or could not be converted to PDF.
Returned when you exceed the rate limit. Retry with exponential backoff.
Returned when an unexpected error occurs during editing. Retry with exponential backoff.
Error handling differs between the two endpoints: with sync you catch a thrown HTTP error, while with async you also check the run’s terminal status. Pick the tab that matches how you call Edit.
Catch the HTTP error and inspect its status code and body.
For retryable errors (OCR_ERROR, INTERNAL_ERROR, or any 5xx), retry with exponential backoff. Always log the requestId when contacting support.