Errors
The error envelope and every error code the API returns.
Every error is a JSON envelope: { "error": { "code", "message", "details"? } }. code is one of the values below and is stable; message is for humans and may change. details is present only when there is something structured to say, such as the fields that failed validation.
| Code | HTTP status | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing or malformed Authorization header, or an invalid, revoked or expired key. |
FORBIDDEN | 403 | The key is valid but its role does not permit this operation. |
NOT_FOUND | 404 | No such resource in the key’s organization. |
VALIDATION_ERROR | 400, 413, 415, 422 | The request was rejected. 400: the body or query failed validation; details names the fields. 413: the response would be too large to return at once, such as a data group holding more values than GET /extractions/{id}/dataset will serve. 415: the file type is not supported. 422: the request is well-formed but cannot be carried out in the current state, such as a project with no data groups, documents that failed preprocessing, or the webhook endpoint limit reached. |
PAYMENT_REQUIRED | 402 | The organization has no credits for this operation. |
CONFLICT | 409 | The resource is not in a state that allows this: an upload whose file name already exists in the project, a test event sent to a disabled webhook endpoint, or a redelivery of a delivery that already succeeded or whose source event is no longer available. |
RATE_LIMITED | 429 | Too many requests for this key; retry after the Retry-After header. Also sent by POST /documents when too many of the organization’s uploaded documents are still waiting to be processed - process them (POST /documents/process), then retry. |
INTERNAL_ERROR | 500 | Unexpected failure. Retry once, then contact support with the request id. |
SERVICE_UNAVAILABLE | 503 | Webhook delivery is unavailable because the delivery queue is not configured; the test event or redelivery was not enqueued. |
Every operation can also answer 401, 429 and 500; operations that require a role answer 403.