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

# Retries and errors

> Retry commands safely and recover from API errors.

`Idempotency-Key` must be printable ASCII with no spaces and at most 128 characters. It is scoped to the wallet owner across that owner's API keys. Repeating the same method, path, and equivalent JSON body with the same key returns the original response if the retrying key still permits the task's venues. Reusing the key for a different request returns `409 idempotency_conflict`; retrying with a key that lacks the task's venue permissions returns `403 venue_forbidden`. Generate a new key for every new mutation.

Error responses use this shape:

```json theme={null}
{"error":"Only a pending task can be cancelled.","code":"task_not_pending"}
```

Common status codes:

| HTTP  | Meaning                                                                                                                                                                                  |
| ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400` | Invalid JSON, parameters, fields, list query, or idempotency key.                                                                                                                        |
| `401` | Missing, invalid, or revoked API key.                                                                                                                                                    |
| `403` | API key does not permit a required venue.                                                                                                                                                |
| `404` | Task is not accessible, or route does not exist.                                                                                                                                         |
| `409` | Task is in the wrong state, another owner operation is active, a venue has no approved binding (`venue_not_bound` with an `issues` array), or an idempotency key was reused differently. |
| `413` | JSON request body exceeds 16 KiB.                                                                                                                                                        |
| `415` | POST body is not sent as `application/json`.                                                                                                                                             |
| `429` | More than 120 requests in the current rolling one-minute window for this key. Respect `Retry-After` before retrying.                                                                     |
| `503` | Database request could not complete, required market data is unavailable, or resize is disabled.                                                                                         |

Include `X-Request-Id` when investigating a failed request. If the database is unavailable, the service cannot guarantee that a request log was written.
Authenticated responses include `X-RateLimit-Limit` and `X-RateLimit-Remaining`; a 429 also includes `Retry-After` in seconds. Rejected 429 requests do not extend the rate-limit window.
