Skip to content

Errors ​

Every failure, from a missing field to a server fault, answers with the same body, sent as application/problem+json.

The error body ​

NameTypeDefaultDescription
typestringNoneThe error code, for example VALIDATION_ERROR or INVOICE_NOT_FOUND. Codes are stable: the admin panel and the client portal branch on them, and an existing code is never renamed. Branch on this field, not on detail.
titlestringNoneA short title, for example Not Found. For most errors it is English whatever the language of the request.
statusnumberNoneThe HTTP status of the response, repeated.
detailstringNoneA sentence that says what went wrong, in the language of the X-Language header. See Languages.
errorsobject or nullNoneNull, except on a validation error: then it maps each field name, in camelCase, to the sentences that say what is wrong with it.

A validation error. The request was refused before anything ran; errors says which fields.

json
{
  "type": "VALIDATION_ERROR",
  "title": "Validation failed",
  "status": 400,
  "detail": "One or more validation errors occurred.",
  "errors": {
    "email": ["An email address is required."],
    "password": ["A password is required."]
  }
}

A refusal by a business rule. The request was well formed, but the answer is no. The code names the reason.

json
{
  "type": "INVOICE_NOT_FOUND",
  "title": "Not Found",
  "status": 404,
  "detail": "No such invoice.",
  "errors": null
}

Error codes ​

503 and Retry-After ​

Every 503 Service Unavailable carries a Retry-After header with the number of seconds to wait before you try again. The default is 30 seconds. A 429 carries it too, see Rate limits.

Respect Retry-After. Trying again at once, against a 503 or a 429, only adds load to a service that has asked you to wait.
Was this page helpful?

Released under the AGPL-3.0 License.