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

# Errors and recovery

> Interpret HTTP failures and choose a safe integration response.

## Error body

The standard error response contains a human-readable `detail`:

```json theme={null}
{
  "detail": "Description of the error"
}
```

## HTTP codes

| Code          | Meaning                                                                     | Integrator action                                                                   |
| ------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `200` / `201` | Operation accepted or resource created                                      | Persist relevant identifiers and confirm asynchronous state when required.          |
| `400`         | Operational rule failed, such as balance, open positions, minimum, or state | Display or record `detail`; correct the state before trying again.                  |
| `401`         | Missing or invalid CRM API key                                              | Verify bearer formatting and the configured secret.                                 |
| `403`         | CRM key cannot access the route                                             | Confirm the customer's contracted endpoint set. Do not silently change credentials. |
| `404`         | Account, Master, Investor, or subscription not found                        | Verify the internal ID or MT5 login and synchronize records.                        |
| `409`         | Conflict or operation already in progress                                   | Read current state; do not duplicate the command.                                   |
| `422`         | Invalid field, type, or range                                               | Correct the payload or query parameters.                                            |
| `500` / `503` | Operational failure or dependency unavailable                               | Record the incident and reconcile before repeating a financial request.             |

## Recovery rules

* Do not automatically retry a deposit, withdrawal, or unassignment whose outcome is uncertain.
* On `409` during unassignment, query the subscription; it may already be `PAUSED`.
* On `500` or `503`, keep the CRM operation pending until balances and MT5 identifiers have been checked.
* Record the UTC timestamp, method, route, non-secret request reference, status code, and response `detail` for support.
* Never log bearer credentials or MT5 passwords while capturing diagnostics.

<CardGroup cols={2}>
  <Card title="Previous: Financial safety" icon="arrow-left" href="/reliability/financial-safety">
    Return to safe financial sequences.
  </Card>

  <Card title="Next: API conventions" icon="arrow-right" href="/reference/conventions">
    Review pagination, dates, money, and response compatibility.
  </Card>
</CardGroup>
