# Rate limits

Limiters protect each token, each tenant and each help-desk connection. A tripped limiter answers `429` with `Retry-After`.

## When you hit a limit

*429 Too Many Requests*

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 12
Content-Type: application/problem+json

{ "status": 429, "code": "rate_limit.exceeded", "limiter": "api-token", "title": "Too many requests.", "instance": "urn:kanso:request:…" }
```

Wait for the number of seconds in `Retry-After`, then retry. For a creating call, retry with the same [Idempotency-Key](https://docs.youniton.com/api/idempotency.md). `limiter` tells you which limit you hit.

## The limiters of the public API

| Limiter | Counts per | Value |
|---|---|---|
| `api-token` | personal token | 120 calls per minute |
| `tenant-api` | tenant — every token and service token of the tenant together | the plan's `apiRequestsPerMinute`. Proposed: Starter 300, Team 1,200, Enterprise 6,000 per minute |
| `help-desk-connection` | help-desk connection — every call | the connection's own limit or the tenant setting `helpdesk.api.requestsPerMinute` |
| `help-desk-create` | help-desk connection — new requests | `helpdesk.api.createsPerHour` |
| `help-desk-upload` | help-desk connection — upload intents | `helpdesk.api.uploadsPerHour` |
| `search` | account | `GET /search` |
| `not-found` | caller | counts `404` answers only, against enumeration |

For a help-desk connection, the lower of the connection's own limit and the tenant's setting applies. The values of the plans are plan data and can change.

> **Agent limiters**
>
> The agent API and the MCP server have their own limiters per agent identity: `agent-identity` counts every call (`memory.api.requestsPerMinute`, or the override of the identity) and `agent-write` counts the writes per hour (`memory.api.writesPerHour`).

## Request size limits

| What | Limit |
|---|---|
| a JSON body | 1 MiB; 2 MiB with a rich-text document (a ticket description, a doc page) |
| a query string | 8 KiB |
| a list in a body | bulk at most 100 targets; filter lists at most 100 values |
| a memory entry | the tenant setting `memory.entries.maxBytes` (default 1 MiB) |
| files | never through the API body — use an upload intent and a presigned `PUT` |

Above a limit the answer is `413 request.too_large`.

## Good habits

- Use [webhooks](https://docs.youniton.com/api/webhooks.md) instead of frequent polling when you can.
- Ask for bigger pages (`page[size]=100`) instead of many small ones.
- Back off when you get a `429`, and never retry faster than `Retry-After`.
