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

# Errors

> What a failed request looks like, and what to do about it.

A failed request returns a non-2xx status and a short explanation.

```json theme={null}
{ "detail": "Assistant not found" }
```

## Status codes

| | What it means | What to do |
| - | - | - |
| `400` | Something in the request was rejected. | Read `detail`. Setting up a phone connection also names the offending `field`. |
| `401` | Missing or invalid API key. | Check the `Authorization` header and that the key is still enabled. |
| `403` | Your role isn't allowed to do this. | Needs a higher [role](/organisation). |
| `404` | Doesn't exist, or isn't in your organisation. | Check the id. The two cases look the same on purpose. |
| `409` | Something with that name already exists. | Use the existing one, or pick another name. |
| `422` | A field failed validation. | `detail` is a list naming each bad field. |
| `500` | Something went wrong on our side. | Retry. If it persists, get in touch. |

## Reading the message

Most errors put the explanation in `detail`. A few endpoints use `error` instead,
so handle both:

```python theme={null}
import os, requests

response = requests.get(
    "https://qall.io/api/assistants/999",
    headers={"Authorization": f"Bearer {os.environ['QALL_API_KEY']}"},
    timeout=30,
)

if not response.ok:
    body = response.json()
    message = body.get("detail") or body.get("error") or response.text
    raise SystemExit(f"{response.status_code}: {message}")
```

## Validation errors

A `422` tells you which field and why:

```json theme={null}
{
  "detail": [
    {
      "loc": ["body", "name"],
      "msg": "Field required",
      "type": "missing"
    }
  ]
}
```

## Rate limits

There are no published rate limits on authenticated requests. Be reasonable, and
prefer [webhooks](/api-reference/webhooks) over polling.

Anonymous calls from an embedded widget are limited, since they start a real
billed call. See [Embed the widget](/api-reference/embed-the-widget).


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