Guides
Errors
The API answers with an ordinary HTTP status. An error also has a body with a fixed code your system can act on and a message for a person.
Statuses
Errors are returned as JSON with code and message. At 422 the answer also has errors with one field per error.
| Status | What it means |
|---|---|
400 | Invalid request. |
401 | The key is missing, deleted or expired. |
403 | The key does not have the scope, the organisation has no access to the unit, or the subscription is not active. |
404 | Not found. |
409 | The request cannot be carried out as things stand, for example because the component is already replaced. |
422 | Validation failed. The answer has errors with one field per error. |
429 | The request limit is reached. Wait the number of seconds given in Retry-After. |
The error model
-
codestring requiredA fixed code, such as
unauthenticated,missing_scope,forbidden,subscription_inactive,blocked,not_found,conflict,validation_failedorrate_limited. -
messagestring requiredAn explanation for a person.
-
errorsobjectOnly at 422. One field per error, each with a list of messages.
Response
403
{
"code": "missing_scope",
"message": "The key does not have the scope units:write."
}
Response
422
{
"code": "validation_failed",
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}
Handling errors
- Act on
code, which does not change.messageis for a person and may be reworded. - At 429, wait the seconds in
Retry-Afterand try again. - At 5xx or a network error, try again with a growing pause. Send
Idempotency-Keywith a POST, so a retry never makes two records. - At 401, the key is missing, deleted or expired: make a new one in the app.