# Errors and limits

This page lists how Pombus reports an error, the codes you will meet most often, and the limits that apply to requests, reads and sends.

## The error body

Every error from a `/v0` route has the same JSON shape.

```json
{
  "name": "Too Many Requests",
  "code": "quota_exceeded",
  "message": "quota exceeded",
  "scope": "inbox",
  "limit": 200,
  "window_seconds": 86400
}
```

| Field | Meaning |
| --- | --- |
| `name` | The HTTP status in words. |
| `code` | A stable code in `snake_case`. When the error has no specific code, this is the generic code of the status: `bad_request`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `payload_too_large`, `unprocessable_entity`, `too_many_requests`, `internal_error`, `bad_gateway`, `service_unavailable`. |
| `message` | A sentence for a person. Write your program against `code` and the HTTP status. |
| `errors` | Present on 400 and 422. For a 422 raised by request validation, the list of fields that failed. Otherwise `null`. |
| other fields | Some errors add detail, such as `addresses`, `scope`, `limit` or `page_count`. |

Routes that wait before a retry send a `Retry-After` header, in seconds.

## Errors through MCP

A tool that fails returns a short text instead of JSON.

| Text | Meaning |
| --- | --- |
| `error: not_found` | The HTTP answer was 401, 403 or 404. The three are reported as one. See below. |
| `error: <code>` | Any other HTTP error, with the `code` of the table below. |
| `error: invalid_argument:<field>` | An argument is missing or has the wrong type. |
| `error: inbox_required` | The key reaches several inboxes and the call had no `inbox_id`. |
| `error: pod_required` | The key reaches several spaces and the call had no `pod_id`. |
| `error: network` | Pombus could not be reached. |
| `error: bad_response` | The answer was not what the tool expected. |
| `error: internal` | An unexpected failure in the MCP server. |
| `unknown tool: <name>` | The tool does not exist, or the key does not allow it. |
| `POMBUS_API_KEY is not set. ...` | The local server runs without a key. |

### What `error: not_found` can mean

The MCP server turns every 401, 403 and 404 into the same text, `error: not_found`. The agent cannot tell these cases apart:

| HTTP | Cases |
| --- | --- |
| 401 | The key is wrong, revoked or expired. |
| 403 | The key lacks the permission; a recipient is suppressed (`suppressed`), on the send block list (`recipient_blocked`) or not on the allow list of an allow-list-only key (`not_in_allowlist`); the plan has no inbox or domain left (`inbox_limit`, `domain_limit`). |
| 404 | The item does not exist, or it is outside the key's scope; the message to reply to is not visible (`reply_target_not_found`); a page past the end of a PDF. |

When a send fails with `error: not_found`, the agent should tell you instead of retrying. The same call on the HTTP API returns the status and the `code`. `npx pombus doctor` tells you whether the key itself still works.

## Codes

### Authentication and permission

| Status | `code` | Cause | What to do |
| --- | --- | --- | --- |
| 401 | `unauthorized` | No key, a wrong key, a revoked key or an expired key. | Check the `Authorization: Bearer` header. Create a new key if needed. |
| 403 | `missing_permission` | The key does not have the permission of the route. | Use a key with that permission. See [API keys and permissions](keys.md). |
| 403 | `forbidden` (message: `scoped key: not permitted on this route`) | A key with scope `inbox` or `domain` called a route that does not name an inbox. | Use the route under `/v0/inboxes/{inbox_id}/...`, or connect through **Connect an agent** (scope `pod`). |
| 403 | `platform_inbox_not_allowed` | An API key tried to create an inbox at `@pombus.com`. | Create the inbox on a verified domain of your own. |
| 403 | `inbox_limit`, `domain_limit` | The plan has no inbox or domain left. | Delete one, or change plan. |
| 404 | `not_found` | The item does not exist, or it belongs to another account or scope. Both give the same answer. | Check the id. |

### Requests

| Status | `code` | Cause | What to do |
| --- | --- | --- | --- |
| 400 | `bad_request` | The request is malformed. `message` says what is wrong, for example `q must be at least 2 characters` or `invalid page_token`. | Fix the request. |
| 400 | `bad_field` | A field has the wrong form. | Fix the field. |
| 409 | `conflict` (message: `message must be in trash before permanent delete`) | `DELETE /v0/messages/{message_id}` on a message that is not in the trash. | Move it to the trash first. |
| 409 | `no_verified_domain` | A key was requested for a domain that is not verified. | Verify the domain first. |
| 409 | `pod_not_empty`, `pod_has_domains` | The space still has inboxes or domains. | Remove them first. |
| 409 | `domain_has_inboxes` | The domain still has inboxes. | Remove them first. |
| 410 | `blob_missing`, `blob_unreadable` | The message exists, but its stored bytes cannot be served. | Retrying does not help. Report it to Pombus. |
| 413 | `too_large` | The body or the file is over a limit. | Send less. |
| 422 | `unprocessable_entity` | A parameter has the wrong type or value. `errors` lists the fields. Also: `thread has 100 or more messages` on a label update of a large thread, and `cannot add or remove system labels`. | Fix the parameters. |

### Sending

[Send and reply](send.md) has the full table. The codes are `no_recipient`, `too_many_recipients`, `bad_field`, `recipient_refused`, `pod_paused`, `domain_send_paused` (400), `suppressed`, `recipient_blocked`, `not_in_allowlist` (403), `reply_target_not_found` (404), `domain_not_ready` (409), `too_large` (413), `unsupported_type` (415), `quota_exceeded`, `reputation_throttled` (429).

### Attachments

| Status | `code` | Cause | What to do |
| --- | --- | --- | --- |
| 403 | `forbidden` (message: `invalid or expired signature`) | A download link older than 5 minutes, or changed. | Ask for a new link with `get_attachment`. |
| 404 | `page_out_of_range` | The page is past the end of the PDF. The answer has `page_count`. | Ask for an existing page. |
| 404 | `no_page_map` | The attachment has no page text: it is not a PDF that was read page by page. | Use the attachment's `md`, or fetch the file. |
| 413 | `too_large` | The PDF is over 25 MB and cannot be rendered. | Fetch the file. |
| 429 | `render_busy` | Another render is running. `Retry-After: 1`. | Retry after a second. |
| 429 | `rate_limited` | More than 30 page images in a minute in this space. `Retry-After: 60`. | Wait a minute. |
| 429 | `render_budget_exhausted` | The daily render budget of the space is spent. `Retry-After` is the time to the next UTC midnight. | Fetch the file instead. |
| 503 | `render_unavailable` | Page rendering is off on the server. | Fetch the file instead. |

### Rate limits

| Status | `code` | Cause | What to do |
| --- | --- | --- | --- |
| 429 | `too_many_requests`, with `"reason": "busy"` | Search is busy. `Retry-After: 1`. | Retry after a second. Run one search at a time per key. |
| 429 | `quota_exceeded` | A sending limit of the 24-hour window is reached. | Wait for the window. |
| 429 | `reputation_throttled` | Too many bounces or spam reports. | Fix the recipient list. |

## Rate limits

| What | Limit | When exceeded |
| --- | --- | --- |
| Search | One search at a time per key. Two at a time on the whole service. | 429, `reason: busy`, `Retry-After: 1` |
| Search time | 500 ms per search. | The answer has `truncated: true` and `searched_through`. This is not an error: the search covered part of the mail. |
| Search query | At least 2 characters. | 400 |
| Page images | 30 per minute per space, one at a time, plus a daily budget. | 429 |
| Keys created in the webmail | 10 per hour per user. | 429 |
| OAuth endpoints of `mcp.pombus.com` | 30 requests per minute per IP address and endpoint. | 429 `rate_limited`, `Retry-After: 60` |
| WebSocket connections | 20 per space, 40 for all your spaces together. | The connection is closed with code 1013. Try again later. |

## Limits by plan

| Limit | Free | Builder | Pro | Scale |
| --- | --- | --- | --- | --- |
| External recipients per 24 hours, all your spaces together | 100 | 500 | 1,000 | 2,000 |
| Inboxes | 3 | 10 | 50 | 250 |
| Domains | 1 | 5 | 25 | 100 |

## Limits that are the same on every plan

### Sending

| Limit | Value |
| --- | --- |
| Message size, with attachments | 25 MB |
| Recipients per message with an API key | 10 |
| Recipients per message from the webmail | 50 |
| Attachments per message | 100 |
| Inline images per message | 8, of 256 KB each |
| External recipients per 24 hours, one inbox | 200 |
| External recipients per 24 hours, one space | 1,000 |
| External recipients per 24 hours, a space less than 24 hours old | 25 |

### Reading

| Limit | Value |
| --- | --- |
| Messages in one thread read | 100. `cur` is the cursor for older ones. |
| Body text in one thread read | About 4 MB. Over it, a message comes with `body_omitted: true`. |
| Attachment text per attachment in a read | 20,000 characters |
| Attachment text per message in a read | 100,000 characters |
| Download link | 5 minutes |

[Attachments](attachments.md) lists the limits of text extraction.

### Organizing

| Limit | Value |
| --- | --- |
| Labels per space | 200 |
| Label name | 64 characters |
| List entries per space | 10,000 |
| Trash | Messages are deleted permanently after 30 days in the trash. |

### API keys and connections

| Limit | Value |
| --- | --- |
| Authorization through `mcp.pombus.com` | 1 hour |
| Time to finish the consent screen | 10 minutes |
| WebSocket key check | Every 30 seconds. A revoked or expired key closes the connection with code 4401. |
