> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thingidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error handling

> The envelope a failure comes back in.

## The envelope

Most failures use a single envelope. `path` names the offending field when the error is about input
and is `null` otherwise.

```json theme={null}
{
  "errors": [
    {
      "code": "Forbidden",
      "path": null,
      "message": "Forbidden"
    }
  ]
}
```

Which status code goes with which situation is listed under
[status codes](/api-reference/introduction#status-codes).

## Endpoints that answer differently

Two endpoints do not use the envelope, and each documents its own failures:

* [`POST /oauth/token`](/api-reference/endpoints/get-an-access-token) follows RFC 6749 and answers
  with a flat `error` field.
* [`POST /codes`](/api-reference/endpoints/generate-codes) reports a rejected item inside the `200 OK`
  body rather than failing the request.
