Error Codes
Use this page to understand the stable machine-readable error codes you should branch on in clients and automations.
Who This Is For
- SDK maintainers
- developers implementing retries and user messaging
- AI agents making structured decisions from error responses
When To Use This
Read this page whenever you need to switch on backend failures programmatically.
How It Works
Error responses use:
json
{
"error": {
"code": "TOKEN_SCOPE_DENIED",
"message": "scope denied",
"detail": "requires report:export"
},
"meta": {
"request_id": "req_123"
}
}Common stable codes by category:
Query and validation
INVALID_QUERYVALIDATION_ERRORBAD_REQUEST
Auth and authorization
TOKEN_SCOPE_DENIED- runtime auth denials and license-status failures such as
LICENSE_INACTIVEandLICENSE_EXPIRED
Existence and conflicts
NOT_FOUNDIDEMPOTENCY_CONFLICT- feature or activation conflicts such as
FEATURE_QUOTA_EXCEEDEDandACTIVATION_LIMIT_EXCEEDED
Runtime device or policy enforcement
DEVICE_BLACKLISTEDOFFLINE_NOT_ALLOWED
Treat error.code as the stable branch key. Treat message and detail as explanatory text.
Example
ts
if (error.code === "TOKEN_SCOPE_DENIED") {
// create or load a token with the route's x-required-scopes
}Common Mistakes
- branching on
messageinstead ofcode - treating all 4xx errors as retryable
- losing
request_idwhen logging or escalating failures