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

# Errors and rate limits

> Error bodies, status codes, trace ids and how to retry.

## Error bodies

Errors are JSON with a `_tag` naming the error and a `message` written to be read by a person or a model. Some carry more fields, such as the missing `scope`.

```json theme={null}
{
  "_tag": "ScopeRequired",
  "scope": "messages:send",
  "message": "This key is missing the messages:send scope. Create a key with it in Settings → API keys."
}
```

Each operation's possible errors are listed with their schemas in the [API reference](https://docs.avazal.com/api-reference/overview.md).

## Status codes

| Status | `_tag` | Means |
| - | - | - |
| `400` | `HttpApiDecodeError` | The body doesn't match the operation's schema. `issues` says which field |
| `400` | `InvalidCursor` | The cursor is malformed or was made with other filters |
| `401` | `KeyRequired` | No key, or the key is revoked, expired or its member left |
| `403` | `ScopeRequired` | The key lacks the operation's scope |
| `403` | `ToolNotGranted` | The operation needs approval or isn't available in this run |
| `403` | `OutsideRun` | The call is outside the conversation or thread the run was handed |
| `403` | `AccessPending` | The organization doesn't have access yet |
| `404` | varies | The object doesn't exist or you can't see it |
| `409` | `AskFirst` | Inside a run, an outward call needs approval through `runs.ask` first |
| `429` | `RateLimited` | Too many requests. Wait for `Retry-After` |
| `500` | `ServerError` | Something failed on our side. The body has a `traceId` |
| `503` | | Avazal is busy. Wait for `Retry-After` |

## Rate limits and retries

When you send too much at once, or Avazal or an upstream service such as Slack is busy, you get `429` or `503` with a `Retry-After` header in seconds. Wait that long, then retry the same request. Some `429` bodies also carry `retryAfterSeconds` with the same value.

Retrying is always safe for `read` operations. A `429` means the call was turned away, so it is safe to retry any operation after one. After a `500`, a `503` or a timeout on an `inApp` or `outward` operation, read the object first to check whether the call went through before trying again, so you don't post or send twice.

## Trace ids

Every response has a `x-trace-id` header, and `500` bodies repeat it as `traceId`. Include it when you report a problem.


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