Developers
Handle errors
Read the API's error format, types, and codes.
Every error response has the same shape:
{
"error": {
"type": "invalid_request",
"code": "invalid_parameters",
"message": "The request has invalid parameters.",
"request_id": "6f4642aa-2dee-41e8-a753-0ed5bb9f4b38",
"details": [
{
"code": "invalid_format",
"path": ["user_id"],
"message": "Invalid UUID"
}
]
}
}type: The broad category, which follows the status code. Branch on this.code: The specific reason. New codes can appear, so handle unknown codes by theirtype.message: A sentence for people. Don’t parse it.request_id: Quote this when you contact support. Thex-request-idresponse header carries the same value.details: Forinvalid_parameters, one entry per invalid parameter, with itspath. Forineligible_users, one{ user_id }per person refused. Otherwisenull.
Error types
| Status | Type | Meaning |
|---|---|---|
400, 405, 422 | invalid_request | The request is malformed or a parameter is invalid |
401 | authentication | The key is missing, invalid, revoked, or expired |
403 | permission | The key lacks a scope, is paused, or the plan excludes the API |
404 | not_found | The endpoint or record doesn’t exist |
409, 412 | conflict | The request conflicts with the record’s current state |
429 | rate_limited | Too many requests |
500 | internal | Something went wrong on our side |
Common codes
| Code | Status | Meaning |
|---|---|---|
invalid_parameters | 400 | A query or path parameter is invalid; see details |
bad_request | 400 | The request can’t be served, such as a cursor this API didn’t issue |
unknown_endpoint | 404 | No endpoint has this path |
method_not_allowed | 405 | The path exists, but not for this method; see the Allow header |
not_found | 404 | No record with this id exists in your organisation |
missing_scope | 403 | The key lacks the endpoint’s scope |
idempotency_key_required | 400 | A POST request has no Idempotency-Key header |
idempotency_key_reused | 422 | The Idempotency-Key was used for a different request |
idempotency_key_in_flight | 409 | A request with this Idempotency-Key hasn’t finished |
assignment_owned_by_learning_path | 409 | Unassign the learning path instead of its step |
ineligible_users | 422 | Some people can’t be assigned or added, so nothing changed; details lists them |
seats_unavailable | 422 | The organisation lacks the seats for the invites or reactivation |
invalid_group | 422 | An invite names a group that isn’t in your organisation |
owner_protected | 422 | Owners can’t be suspended or demoted, and nobody becomes an Owner through the API |
transfer_required | 422 | The member owns materials; send transfer_materials_to |
cannot_suspend_self | 422 | A key can’t suspend the person it acts as |
rate_limited | 429 | See Stay within rate limits |
internal_error | 500 | Retry with backoff, and quote the request_id if it persists |
Authenticate and choose scopes lists the key codes.
A record in another organisation returns 404, the same as one that doesn’t exist.