# Errors

Every error has the same shape: a stable `code` you can branch on, a `message` written for people, and the `request_id` of the call. The same id is in the `X-Request-ID` header of every response. Quote it when you contact support.

```json
{
  "error": {
    "code": "FORBIDDEN",
    "message": "This API key's scopes do not allow this action.",
    "request_id": "req_5d1e…"
  }
}
```

## Status codes

| Status | `error.code` | Meaning | What to do |
|---|---|---|---|
| `400` | `INVALID_REQUEST` | the request cannot be processed as sent | fix the request |
| `401` | `UNAUTHORIZED` | the key is missing, unknown, revoked or expired | check the `Authorization` header and the key |
| `402` | `QUOTA_EXCEEDED` | this month's transcription minutes are used up | wait for the new month, or ask your Audiobly account manager to raise the quota |
| `403` | `FORBIDDEN` | the key's scopes do not allow this call | use a key with the right scopes |
| `403` | `PLAN_REQUIRED` | your organisation is not on the Enterprise plan, which API and MCP access come with | move to Enterprise |
| `403` | `MODULE_DISABLED` | a signed-in user's organisation has not switched that module on; API keys include every module and never get it | sign in with an API key, or ask Audiobly to enable it |
| `403` | `NOT_ENTITLED` | live translation, Q&A or Polls is not switched on | ask Audiobly to enable it |
| `404` | `NOT_FOUND` | no such object in your organisation | check the id |
| `409` | `CONFLICT` | the object is not in a state that allows this | read it again, then retry |
| `422` | `VALIDATION_ERROR` | a value breaks a rule the call checks | read `message` and fix the value |
| `429` | `RATE_LIMITED` | over the request rate (Enterprise: 3,000 a minute, 60 a second) | wait `Retry-After` seconds, then retry |
| `503` | `OVERLOADED` | the server is at capacity | wait `Retry-After` seconds, then retry |
| `5xx` | | something else failed on our side | retry with backoff; quote `request_id` if it persists |

## Field validation

When a field has the wrong type or a required one is missing, the call is refused with `422` before it runs, and the body lists each problem under `detail` instead of `error`:

```json
{
  "detail": [
    { "loc": ["body", "title"], "msg": "Field required", "type": "missing" }
  ]
}
```

`loc` is the path to the field: `body`, `query`, `path` or `header`, then its name.

## Retrying safely

- Retry `429` and `5xx` with exponential backoff. On `429`, wait at least `Retry-After` seconds.
- Do not retry `4xx` errors other than `429` without changing the request.
- `POST /v1/events` accepts an `Idempotency-Key` header: a repeat with the same key returns the original event instead of creating a second one. Other create calls are not idempotent, so check before you retry them.

The plans and limits are on [Rate limits and plans](/developers/api/rate-limits.md).
