# Rate Limits

There are two separate ceilings and they are easy to confuse. **Request rate
limits** cap how often you may call the API. **Send limits** cap how many emails
may leave. A `429` always names the one you hit, in `error.code`.

## Request rate limits

Counted per API key, or per IP on the endpoints you can reach without a key.

| Scope | Limit | Window |
|---|---|---|
| Any authenticated API key | 100 requests (operator configurable) | 1 minute |
| `POST /v1/accounts` | 5 requests per IP | 1 minute |
| `POST /v1/auth/signup` | 5 requests per IP | 1 minute |
| `POST /v1/auth/verify` | 10 requests per IP | 1 minute |
| `POST /v1/agent/provision` | 5 requests per account | 1 minute |
| `POST /v1/webhooks/:id/deliveries/:deliveryId/replay` | 10 requests per account | 1 minute |
| `POST /v1/webhooks/:id/replay-failed` | 1 request per account | 1 minute |
| Other unauthenticated writes under `/v1/` | 10 requests per IP | 1 minute |

Exceeding one returns `429` with `error.code` `RATE_LIMIT_EXCEEDED`.

Responses from routes covered by the limiter carry these headers when it is
available, successful requests included. A route no policy matches carries none.

```
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 98
X-RateLimit-Reset: 1710532800
```

`X-RateLimit-Reset` is a Unix timestamp in seconds for the start of the next
window.

### Rate limiting fails closed

Rate limit counters live in Redis. If Redis is unreachable, writes and
authenticated calls are refused with `503` and `error.code`
`RATE_LIMIT_UNAVAILABLE` rather than being let through uncounted. Read-only
unauthenticated requests continue. Retry after a short pause.

## Send limits

Three independent send ceilings apply to the same call. The strictest one wins,
so it is worth knowing all three.

### 1. New account ramp, first 7 days

Every account is held lower for its first 7 days, measured from when the account
was created. This applies on every plan, including paid ones.

| Sending from | Limit | Window | `error.code` |
|---|---|---|---|
| A sandbox inbox on the shared `mailbot.id` domain | 50 (default, operator configurable) | rolling 24 hours | `SHARED_DOMAIN_NEW_ACCOUNT_RATE_LIMIT` |
| An inbox on your own verified domain | 10 | rolling 24 hours | `NEW_ACCOUNT_RATE_LIMIT` |

The ramp lifts by itself once the account turns 7 days old. There is nothing to
click. If you need it lifted sooner, write to support from the account that
needs it.

### 2. Per inbox, per day

Each inbox carries its own daily counter.

| Inbox | Daily limit |
|---|---|
| Sandbox inbox on `mailbot.id` | 250 |
| Inbox on your own domain | 100 by default, set `daily_send_limit` between 1 and 10,000 when you create the inbox |

Exceeding it returns `429` with `error.code` `DAILY_SEND_LIMIT_EXCEEDED` and the
limit in the message.

### 3. Per account

| Plan | Per day | Per month |
|---|---|---|
| Sandbox | no separate account ceiling, the per-inbox limit governs | 1,000 |
| Builder | 1,000 | 10,000 |
| Growth | 5,000 | 100,000 |

The daily counter resets at midnight UTC and refusals come back as `429` with
`error.code` `DAILY_SEND_LIMIT_REACHED`, carrying `current_usage` and `limit`.
The monthly counter is the plan allowance on the
[pricing page](https://getmail.bot/pricing) and counts recorded outbound
messages only.

Accounts that are still untrusted also carry a rolling ceiling of 250 outbound
emails per 24 hours on the shared `mailbot.id` domain, refused as
`SHARED_DOMAIN_UNTRUSTED_RATE_LIMIT`.

## Sending can also be refused for reasons that are not limits

A `403` on a send is a policy decision, not a counter. Ownership verification,
recipient restrictions and outbound attachments all live there. See
[Send Authorization](/docs/concepts/send-authorization) for the whole chain and
[Errors](/docs/errors) for every code.
