> ## Documentation Index
> Fetch the complete documentation index at: https://pamm-api.exuratech.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={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Description of the error"
}
```

Schema validation failures can instead return `detail` as an array. Each entry can include `loc` (for example `["body", "perf_fee", "rate"]`), `msg`, and `type`. Handle both forms and report the affected field; do not assume `detail` is always a string.

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

> [card] [Previous: Financial safety](https://pamm-api.exuratech.com/reliability/financial-safety.md)
>
> Return to safe financial sequences.

> [card] [Next: API conventions](https://pamm-api.exuratech.com/reference/conventions.md)
>
> Review pagination, dates, money, and response compatibility.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.