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

# STA error list

> Lerian STA returns structured error responses. Look up each STA error code, what it means, and the HTTP status it carries.

**Error format**

Lerian STA returns errors as RFC 9457 problem details with the `application/problem+json` media type:

<CodeGroup>
  ```json JSON theme={null}
  {
    "code": "STA-0016",
    "detail": "The requested route does not exist on this service.",
    "status": 404,
    "title": "Not Found",
    "type": "https://errors.lerian.studio/v1/STA-0016"
  }
  ```
</CodeGroup>

**Field definitions**

* **`type`** – A URI that identifies the error in the Lerian error catalog, built as `https://errors.lerian.studio/v1/<code>`. A response with no `code` carries the RFC default `about:blank`.
* **`title`** – The HTTP status text (for example, `Not Found`).
* **`status`** – The HTTP status code.
* **`detail`** – A human-readable explanation of this occurrence. For `5xx` responses, STA replaces the detail with `internal error`. An internal cause stays out of the response body. Branch on `code` instead.
* **`code`** – A stable identifier for the error (`STA-NNNN`). Branch on this field. A request that fails request-schema validation carries no `code`, and `errors` names the fields at fault. Two errors can share a `title` and a status and still differ here. `STA-0005` and `STA-0016` both answer `404` with the title `Not Found`. The `code` tells you which one you got.
* **`errors`** – Optional list of individual error details, each with a `location`, a `message`, and a `value`.

## Request and routing errors

***

These errors apply to the request itself. They cover its syntax, its fields, its route, and the state of the service that received it.

| `code`   | Description                                                                                                                                                                                         | Status |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| STA-0001 | Bad Request. The service could not read the request syntax.                                                                                                                                         | 400    |
| STA-0002 | Internal Server Error. An unexpected failure. The `detail` reads `internal error`.                                                                                                                  | 500    |
| STA-0003 | Unauthorized. The resource requires authentication.                                                                                                                                                 | 401    |
| STA-0004 | Forbidden. The caller does not have permission for this resource.                                                                                                                                   | 403    |
| STA-0005 | Not Found. The route exists, and the requested resource does not.                                                                                                                                   | 404    |
| STA-0006 | Unprocessable Entity. The service read the request and cannot process it in its current form.                                                                                                       | 422    |
| STA-0007 | Conflict. The request conflicts with the current state of the resource.                                                                                                                             | 409    |
| STA-0008 | Service Unavailable. A dependency the request needs is unavailable. Try again later.                                                                                                                | 503    |
| STA-0009 | Too Many Requests. Too many requests arrived in a given period.                                                                                                                                     | 429    |
| STA-0010 | Request Entity Too Large. The request payload is larger than the endpoint accepts.                                                                                                                  | 413    |
| STA-0011 | Bad Request. The fallback code for a client-side refusal without a dedicated entry.                                                                                                                 | 400    |
| STA-0012 | Missing Fields in Request. The request omits one or more required fields.                                                                                                                           | 400    |
| STA-0013 | Unknown Fields in Request. The request body carries one or more fields the endpoint does not accept.                                                                                                | 400    |
| STA-0014 | Invalid Request Fields. One or more supplied fields fail validation.                                                                                                                                | 400    |
| STA-0015 | Unmarshalling Error. A field carries the wrong JSON type, so the body cannot be decoded. The message names the field, the expected type, and the received type.                                     | 400    |
| STA-0016 | Route Not Found. The request path does not match a mounted route. Correct the URL, because a retry gives the same result.                                                                           | 404    |
| STA-0017 | Method Not Allowed. The path matches a mounted route, and the method does not. When the router refused the method, the response carries an `Allow` header that lists the methods the route accepts. | 405    |

## Credential and transfer errors

***

These errors apply to BACEN credentials, to inbound source configuration, and to the credential a transfer sends under.

| `code`   | Description                                                                                                                                            | Status |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
| STA-0102 | Conflict. A rotation request targets a credential that is not active.                                                                                  | 409    |
| STA-0103 | Institution Code Conflict. A live credential already exists for the same institution code.                                                             | 409    |
| STA-0104 | Polling Budget Exceeded. The inbound source configuration would push the credential's inbound-discovery reserve past its queries-per-minute ceiling.   | 422    |
| STA-0105 | Default Credential Not Resolvable. The request omits `credentialId`, and the tenant does not hold an eligible credential to resolve to.                | 422    |
| STA-0106 | Default Credential Ambiguous. More than one eligible credential matches, so the service refuses instead of choosing one. Name the credential you want. | 422    |
| STA-0107 | Institution Credential Not Found. The supplied `institutionCode` does not match an eligible credential.                                                | 422    |
