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

# Errors and limits

> The error shapes Aiveth's APIs return, the request ID on every answer, and the rate limits.

Aiveth's APIs use standard HTTP status codes. The body shape depends on the kind of API: the OAuth and OpenID Connect endpoints follow their specifications, and the server APIs use a `detail` field.

## Request ID

Every answer has an `X-Request-ID` header. Aiveth writes the same ID on its own logs and on the activity log entries the request made. Quote it when you contact [support](https://docs.aiveth.com/account/support.md).

You may send your own `X-Request-ID`. Aiveth keeps it beside its own ID, so you can find your request either way, but the header in the answer is always Aiveth's.

## OAuth and OpenID Connect errors

The token, device authorization, revocation and introspection endpoints answer errors as JSON (RFC 6749 §5.2):

```json theme={null}
{
  "error": "invalid_grant",
  "error_description": "code is unknown, used or expired"
}
```

These answers carry `Cache-Control: no-store`. An `invalid_client` answer is `401` and carries `WWW-Authenticate: Basic realm="aiveth"`.

| `error` | Status | Typical cause |
| - | - | - |
| `invalid_request` | 400 | A required parameter is missing or malformed. |
| `invalid_client` | 401 | Unknown app, wrong secret, or a secret sent by a public app. |
| `invalid_grant` | 400 | The code or refresh token is unknown, used, expired or for another app; the `code_verifier` doesn't match; or the person signed out or can no longer sign in. |
| `unauthorized_client` | 400 | The app may not use this grant, or your plan doesn't include the feature. The description says which plan has it. |
| `unsupported_grant_type` | 400 | The `grant_type` isn't one Aiveth supports. |
| `invalid_scope` | 400 | The scope asks for something the app may not have. |
| `invalid_dpop_proof` | 400 | The DPoP proof is missing (when required), malformed, reused or for another key. See [DPoP](https://docs.aiveth.com/apps/dpop.md). |
| `authorization_pending`, `slow_down`, `access_denied`, `expired_token` | 400 | Device login polling. See [Device login](https://docs.aiveth.com/apps/device-login.md). |
| `slow_down` | 429 | Too many requests from this app or address. |

Errors at `/oauth/authorize` go back to the app's registered return address as `error` and `error_description` query parameters. If the app or return address isn't registered, Aiveth shows an error page and never redirects. See [Login with Aiveth](https://docs.aiveth.com/apps/login-with-aiveth.md).

`/oauth/userinfo` answers a token it won't accept with `401`, `{"error": "invalid_token"}`, and a `WWW-Authenticate` header.

## Server API errors

The admin API, consent API, events API and Shared Signals streams answer errors with a `detail` field in plain English:

```json theme={null}
{ "detail": "This API key doesn't have the power people:roles." }
```

| Status | Meaning |
| - | - |
| `400` | The request can't be done as asked. |
| `401` | No valid API key. See [Authentication](https://docs.aiveth.com/api-reference/authentication.md). |
| `403` | The key lacks the power, or the rules don't allow this change. |
| `404` | No such resource in your organization. Aiveth never reveals another organization's data. |
| `409` | The change conflicts with the current state, for example a limit is reached. |
| `410` | The thing has ended, for example an expired API key you tried to renew. |
| `422` | The body or a parameter is not valid. |
| `429` | Too many requests. |

### Validation errors

When a request body or parameter has the wrong shape, the answer is `422` with a list:

```json theme={null}
{
  "detail": [
    { "loc": ["body", "email"], "msg": "value is not a valid email address: ...", "type": "value_error" }
  ]
}
```

Each item has only `loc` (where), `msg` (the rule) and `type`. Aiveth never echoes the value you sent, so a password or token in a bad request never comes back in the answer.

Some `422` answers have a plain-text `detail` instead, for a rule that isn't about shape, such as `"limit is 1 to 100."`.

The SDKs raise these as `AivethError`, with Aiveth's words and the `status`.

## Rate limits

Aiveth counts requests in one-minute windows. Past a limit, the answer is `429`.

| API | Limit |
| - | - |
| Admin API and consent API | 600 requests a minute per API key |
| AI agent action reports (`/v1/admin/agent-actions`) | 600 a minute per organization |
| Events API | 600 requests a minute per organization |
| Shared Signals streams (`/ssf/...`) | 120 requests a minute per organization |
| Machine app tokens (`client_credentials`) | 60 tokens a minute per app |
| Device login start (`/oauth/device_authorization`) | 30 a minute per network address, and 300 a minute per app |
| Agent token introspection (`/oauth/introspect`) | 600 a minute per network address |

Sign-in pages, codes and passwords have their own limits to stop guessing. See [Attack protection](https://docs.aiveth.com/sign-in/attack-protection.md).

Some `429` answers include a `Retry-After` header with the seconds to wait. When there is none, wait until the next minute. Reuse tokens until they end instead of asking for new ones on every call.

## Size limits

| What | Limit |
| - | - |
| People import (`/v1/admin/people/import`) | 500 people per request |
| Consent import (`/v1/admin/consents/import`) | 500 people per request |
| Events API page | 1 to 100 events (`limit`) |
| Events kept for reading back | 30 days |
| API keys | 25 live keys per organization |
| API key address list | 20 addresses or ranges |
| Token template | 3 KB, 3 levels deep |

## Related

* [Authentication](https://docs.aiveth.com/api-reference/authentication.md)
* [OpenID Connect endpoints](https://docs.aiveth.com/api-reference/oidc-endpoints.md)


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