> ## 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.

# Consignado error list

> Lerian Consignado returns structured error responses. Look up each CLT error code, what it means, and which reason codes come straight from Dataprev.

**Error format**

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

<CodeGroup>
  ```json JSON theme={null}
  {
    "code": "CLT-0006",
    "detail": "The worker's authorization is outside its validity window, so their payroll data can no longer be read under it. Obtain a fresh worker authorization and send its evidence; repeating this request cannot succeed.",
    "status": 422,
    "title": "Unprocessable Entity",
    "type": "https://errors.lerian.studio/v1/CLT-0006"
  }
  ```
</CodeGroup>

**Field definitions**

* **`type`** – A URI that identifies the error in the Lerian error catalog. Built as `https://errors.lerian.studio/v1/<code>`.
* **`title`** – The HTTP status text (for example, `Unprocessable Entity`).
* **`status`** – The HTTP status code.
* **`detail`** – A human-readable explanation of this occurrence. On a `5xx` response Consignado sanitizes the detail to `internal error`, so an internal cause stays out of the body. Branch on `code` and on the status instead.
* **`code`** – A stable identifier for the error. The tables below list the `CLT-NNNN` codes. Some operations answer a named code of their own, such as `CURSOR_EXPIRED` on the registration inventory sweep.
* **`errors`** – Optional list of individual error details, each with a `location`, a `message`, and a `value`.
* **`upstream`** – Dataprev's own error, when the gateway relays one. It holds Dataprev's `code` and `message`, and it survives the `5xx` sanitization that clears `detail`. See [Dataprev reason codes](#dataprev-reason-codes).

## 400: Bad request

***

| `code`   | Description                                                                                            | `detail`                                           |
| -------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
| CLT-0001 | Invalid request. The gateway could not read the request syntax, or a supplied field failed validation. | Names the field or the syntax the gateway refused. |
| CLT-0011 | Request failed. The fallback code for a client-side refusal with no entry of its own.                  | Names the refusal.                                 |

## 401: Unauthorized

***

| `code`   | Description                                                                                                 | `detail`       |
| -------- | ----------------------------------------------------------------------------------------------------------- | -------------- |
| CLT-0003 | Unauthorized. The request carried no valid bearer token, or the gateway could not resolve a tenant from it. | `Unauthorized` |

## 403: Forbidden

***

| `code`   | Description                                                                      | `detail`    |
| -------- | -------------------------------------------------------------------------------- | ----------- |
| CLT-0004 | Forbidden. The authenticated caller does not hold permission for this operation. | `Forbidden` |

## 404: Not found

***

| `code`   | Description                                                                                                                               | `detail`    |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| CLT-0005 | Not found. The record the request named does not exist for this tenant. A retained artifact owned by another tenant answers the same way. | `Not Found` |

## 409: Conflict

***

| `code`   | Description                                                           | `detail`                                                                                           |
| -------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| CLT-0007 | Conflict. The request conflicts with the current state of the record. | `Conflict`, or the sentence for the conflict, such as `an identical request is already in flight`. |

`CLT-0007` with the detail `an identical request is already in flight` marks a request the gateway has not finished. Retry that request under the same idempotency key.

Command conflicts answer a named code in place of `CLT-0007`, so a client can tell them apart. Read `code` and `detail` together before you retry. These code spellings are part of the wire contract and do not change.

| `code`                               | Description                                                                                             | `detail`                                                                                                                                                                                   |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| FGTS\_EXECUTION\_PAYLOAD\_MISMATCH   | This idempotency key already holds a different FGTS guarantee execution.                                | This idempotency key already holds a different FGTS guarantee execution. Resend the original request under this key to replay it, or use a new key for a different execution.              |
| FGTS\_EXECUTION\_OUTCOME\_UNRESOLVED | The execution held under this idempotency key has no known outcome yet, so it cannot be replayed.       | The FGTS guarantee execution held under this idempotency key has no known outcome yet, so it cannot be replayed. Executing the same contract under a new key risks moving the money twice. |
| FGTS\_EXECUTION\_ALREADY\_REFUSED    | The execution held under this idempotency key was refused, so a corrected request needs a new key.      | The FGTS guarantee execution held under this idempotency key was refused. This key can only ever return that refusal, so a corrected request needs a new key.                              |
| FGTS\_EXECUTION\_CONTRACT\_TAKEN     | This contract's FGTS guarantee already ran under another idempotency key. This request did not execute. | This contract's FGTS guarantee was already executed under another idempotency key, and a guarantee is executed once. This request was not executed.                                        |
| BID\_SOLICITACAO\_TAKEN              | The solicitação already carries a bid from this institution.                                            | This solicitação already carries a bid from this institution, and a solicitação takes one. Read the bid book for the outcome of the bid that holds it.                                     |
| BID\_PROPOSAL\_SLOT\_TAKEN           | An earlier submission holds the proposal position, so this bid was not recorded.                        | A proposal position in this bid is already held by an earlier submission, so this bid was not recorded. Read the bid book for the outcome of the submission that holds it.                 |
| AVERBACAO\_CLAIM\_CONFLICT           | This contract's averbação is already claimed under another idempotency key.                             | This contract's averbação is already claimed under another idempotency key. Follow the claim that exists instead of opening a second one.                                                  |
| AVERBACAO\_ARTIFACT\_CONFLICT        | A different document is already retained for this contract's averbação. This request did not apply.     | A different document is already retained for this contract's averbação, and a retained document is never replaced. This request was not applied.                                           |
| EXCLUSION\_AUTHORITY\_QUARANTINED    | This contract holds an exclusion record the gateway cannot report, so it does not answer absence.       | This contract holds an exclusion record the gateway cannot report. It is deliberately not answered as absent, because the contract may well be excluded.                                   |
| EXCLUSION\_AUTHORITY\_CONFLICT       | This contract's exclusion is already recorded under another authority. This request did not apply.      | This contract's exclusion is already recorded under another authority, and an exclusion has no undo. This request was not applied.                                                         |
| RAIL\_COMMAND\_CLAIM\_CONFLICT       | This command is already claimed for this contract under another idempotency key.                        | This command is already claimed for this contract under another idempotency key. Follow the claim that exists instead of opening a second one.                                             |
| RAIL\_COMMAND\_ANSWER\_NOT\_RETAINED | This command already committed for this contract, and its original answer was not kept.                 | This command already committed for this contract, but its original answer was not kept, so there is nothing to replay. Read the contract's current state rather than sending it again.     |
| REVERSAO\_WINDOW\_EXPIRED            | The window for reversing this refinancing has closed, so no correction reopens it.                      | The window for reversing this refinancing has closed, so the reversal can no longer be requested. No correction to this request can reopen it.                                             |

## 410: Gone

***

The paginated registration inventory sweep issues a cursor with a limited retry window.

| `code`          | Description                                                                                                         | `detail`                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| CURSOR\_EXPIRED | Gone. The cursor's retry window has passed, so the sweep it belonged to cannot continue. Start a new sweep instead. | The cursor retry window has expired. |

## 413: Request entity too large

***

| `code`   | Description                                                                        | `detail`                   |
| -------- | ---------------------------------------------------------------------------------- | -------------------------- |
| CLT-0010 | Request entity too large. The request payload is larger than the endpoint accepts. | `Request Entity Too Large` |

## 422: Unprocessable entity

***

| `code`   | Description                                                                                                                                                         | `detail`                                                              |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| CLT-0006 | Unprocessable entity. The gateway read the request and refuses it in its current form. A deterministic Dataprev rejection answers here too, and carries `upstream`. | The reason to act on, such as obtaining a fresh worker authorization. |

## 500: Internal server error

***

| `code`   | Description                                                      | `detail`         |
| -------- | ---------------------------------------------------------------- | ---------------- |
| CLT-0002 | Internal server error. An unexpected failure inside the gateway. | `internal error` |

## 501: Not implemented

***

A `501` answers an operation your deployment has not enabled. The routes stay mounted, so the answer arrives per request rather than as a missing path. Contract artifact downloads, contract corrections, disbursement confirmation, cessão registration, and bid submission answer `501` until your deployment enables them.

The `detail` reads `internal error`, because Consignado sanitizes the detail on a `5xx` response. Branch on the status.

## 503: Service unavailable

***

| `code`   | Description                                                                                                                                             | `detail`         |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| CLT-0008 | Service unavailable. A dependency the request needs is unavailable, or Dataprev answered with a retry-later fault. Send the same request again shortly. | `internal error` |

When Dataprev produced the fault, the response also carries `upstream` with Dataprev's own code and message.

## Dataprev reason codes

***

Consignado relays Dataprev's reason codes rather than mapping them onto codes of its own. That keeps a refusal readable against what Dataprev actually said. Read each reason code against Dataprev's specification, not against this page. Dataprev can publish a code this page does not list, and the gateway still delivers it to you.

They reach you in two places.

**On a refusal.** The `upstream` member carries Dataprev's own `code` and `message`, both verbatim. The gateway bounds each field on the wire, so the member holds a code and a sentence rather than a response body. A `422` carries it for a deterministic rejection, and a `503` carries it for a retry-later fault.

**On contract and margin responses.** Several response fields pair a Dataprev reason code with Dataprev's own label for it. A margin read publishes `blockType` and `ineligibilityReason`, which spell the pair `code` and `description`. A contract read publishes `motivo_exclusao`, `origem_averbacao`, `origem_exclusao`, `portabilidade_situacao`, and `situacao_bloqueio_garantia`, which spell it `codigo` and `descricao`. Each field holds a numeric code and the text Dataprev returned beside it.

Treat the set as open. Map the reason codes your integration acts on, and pass the rest through with their labels, so a code you have not mapped yet stays readable to an operator.
