Docs
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 their type.
  • message: A sentence for people. Don’t parse it.
  • request_id: Quote this when you contact support. The x-request-id response header carries the same value.
  • details: For invalid_parameters, one entry per invalid parameter, with its path. For ineligible_users, one { user_id } per person refused. Otherwise null.

Error types

StatusTypeMeaning
400, 405, 422invalid_requestThe request is malformed or a parameter is invalid
401authenticationThe key is missing, invalid, revoked, or expired
403permissionThe key lacks a scope, is paused, or the plan excludes the API
404not_foundThe endpoint or record doesn’t exist
409, 412conflictThe request conflicts with the record’s current state
429rate_limitedToo many requests
500internalSomething went wrong on our side

Common codes

CodeStatusMeaning
invalid_parameters400A query or path parameter is invalid; see details
bad_request400The request can’t be served, such as a cursor this API didn’t issue
unknown_endpoint404No endpoint has this path
method_not_allowed405The path exists, but not for this method; see the Allow header
not_found404No record with this id exists in your organisation
missing_scope403The key lacks the endpoint’s scope
idempotency_key_required400A POST request has no Idempotency-Key header
idempotency_key_reused422The Idempotency-Key was used for a different request
idempotency_key_in_flight409A request with this Idempotency-Key hasn’t finished
assignment_owned_by_learning_path409Unassign the learning path instead of its step
ineligible_users422Some people can’t be assigned or added, so nothing changed; details lists them
seats_unavailable422The organisation lacks the seats for the invites or reactivation
invalid_group422An invite names a group that isn’t in your organisation
owner_protected422Owners can’t be suspended or demoted, and nobody becomes an Owner through the API
transfer_required422The member owns materials; send transfer_materials_to
cannot_suspend_self422A key can’t suspend the person it acts as
rate_limited429See Stay within rate limits
internal_error500Retry 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.

On this page