Every error response from the API uses the appropriate HTTP status and returns a consistent JSON body. Regardless of the error type, the body always contains two fields: error and code.
"error" : "Invalid or missing API token" ,
Field Type Description errorstring Human-readable message describing the error (always in English). codestring Stable, machine-readable code. Use this field in your error-handling logic.
codeTypical HTTP status When it happens invalid_request400 Malformed body, missing or invalid fields, or an ID that is not a valid UUID. unauthorized401 Missing, invalid, or revoked token. See Authentication . forbidden403 The token does not have access to that resource. not_found404 Resource does not exist or belongs to another organization. conflict409 The operation conflicts with the current state — for example, editing a knowledge-base item with source='file', or an item that is currently being processed. rate_limited429 Request rate limit exceeded. internal_error500 Unexpected server-side error.
The API returns the following HTTP statuses:
Status Meaning 200 OKSuccessful request with a response body. 201 CreatedResource created successfully. 202 AcceptedRequest accepted and processing asynchronously. 204 No ContentSuccessful request with no response body (e.g. deletion). 400 Bad RequestInvalid or malformed request data. 401 UnauthorizedMissing or invalid token. 403 ForbiddenValid token, but no permission for that resource. 404 Not FoundResource not found. 408 Request TimeoutTimeout on synchronous chat — the agent did not respond in time. 409 ConflictCurrent resource state prevents the operation. 429 Too Many RequestsRate limit exceeded. 500 Internal Server ErrorUnexpected server-side error.