Error handling
GraphQL error format and error codes
Error handling
The API uses standard GraphQL error responses. Errors are returned in the errors array alongside any partial data.
Error response shape
{
"data": null,
"errors": [
{
"message": "authentication required for this mutation",
"path": ["createSecondaryMarketOrder"],
"extensions": {
"Code": "IAM_UNAUTHENTICATED",
"Expected": true
}
}
]
}| Field | Description |
|---|---|
message | Human-readable error description |
path | GraphQL field path where the error occurred |
extensions.Code | Machine-readable error code |
extensions.Expected | true if this is an anticipated business error (not a server bug) |
Common error codes
| Code | Meaning |
|---|---|
IAM_UNAUTHENTICATED | Missing or invalid authentication token |
IAM_INVALID_CREDENTIALS | API key not found, revoked, or secret mismatch |
IAM_FORBIDDEN | Authenticated but lacking required permissions |
EVENT_RATE_LIMIT_EXCEEDED | Mutation rate limit exceeded (see Rate limits) |
EVENT_DISABLED | The requested operation is temporarily disabled |
UNEXPECTED_ERROR | Internal server error |
Permission errors
When a permission check fails, the error extensions include additional context:
{
"message": "permission denied",
"extensions": {
"Code": "IAM_FORBIDDEN",
"Expected": true,
"PermissionName": "account.read",
"PermissionScope": "ACCOUNT"
}
}Handling errors in your integration
- Always check the
errorsarray, even when HTTP status is200. - Use
extensions.Codefor programmatic error handling — do not parsemessagestrings. - Retry only on transient errors (
UNEXPECTED_ERROR). Do not retry authentication or permission errors without fixing the underlying issue. - Use idempotency keys when retrying mutations to avoid duplicate side effects.
Partial errors
GraphQL can return partial data when some fields fail and others succeed. Check both data and errors in every response.
{
"data": {
"account": { "id": "account|abc", "status": "ACTIVE" },
"linkedUsers": null
},
"errors": [
{
"message": "permission denied",
"path": ["account", "linkedUsers"],
"extensions": { "Code": "IAM_FORBIDDEN", "Expected": true }
}
]
}HTTP status codes
| Status | Meaning |
|---|---|
200 | Request processed (check errors array for GraphQL-level errors) |
400 | Malformed request (invalid JSON, missing query) |
405 | Wrong HTTP method (only POST is supported) |
Updated about 2 months ago
Did this page help you?

