# Errors

Errors are JSON of the form `{ "error": "Human-readable message" }` with an HTTP status. MCP tools return the same message as text starting with `Error:`. Some errors also carry a stable machine-readable `code` next to the message, for example `{ "error": "You are not a member of this team", "code": "team_access" }`. Rate-limit errors (`429`) add `retry_after` seconds and a `Retry-After` header. Internal failures never include internal details.

| Status | Meaning | Typical cause |
| --- | --- | --- |
| `400` | Bad request | A parameter is missing or invalid: an invalid address, an unknown folder, scope or event, a non-https webhook URL, or no recipients. |
| `401` | Unauthorized | Missing or invalid API key or session. Send Authorization: Bearer <key>. |
| `402` | Plan limit | Inbox, recipient-per-message or custom domain limit reached for the account's plan, or a feature (custom domains) that needs Pro. |
| `403` | Forbidden | Several causes, told apart by the message: the API key lacks the required scope ("This API key lacks the mail:send scope"), the key is restricted to some inboxes ("Inbox-restricted API keys can't ..."), the endpoint needs a signed-in session, your team role is too low ("This needs the admin role in the team"), the account is suspended, or sending is paused for the account or domain. A team you don't belong to returns code team_access. |
| `404` | Not found | The inbox, message, thread, label, webhook, team or other resource doesn't exist, isn't yours, or (for inbox-restricted keys) is outside the key's inboxes. Teams you aren't in look nonexistent. Originals of mail from before they were kept also return 404. |
| `408` | Timeout | GET /inboxes/:inbox/wait found no matching message in time. Retry. (The MCP tool returns null instead.) |
| `409` | Conflict | The address or domain is taken, was used before, or is still in use; a team's last owner can't leave; the team still has an active subscription; or you already have a subscription. |
| `410` | Gone | The inbox expired (its ttl_minutes passed), or a team invitation expired. |
| `413` | Too large | Attachments exceed 20 MB. |
| `422` | Not sent | A recipient is on your suppression list after a bounce or complaint. |
| `429` | Rate limit | A burst limit or the daily send limit was exceeded. See Rate limits below. |
| `500` | Server error | Something went wrong on our side. Details are logged; retry later. |
| `502` | Bad gateway | A team invitation email couldn't be sent. Try again later. |

## Guides

- [Email for AI agents](https://mailforbots.com/email-for-ai-agents)
- [A hosted MCP email server](https://mailforbots.com/mcp-email-server)
- [How to let an AI agent sign up for a website and read the verification email](https://mailforbots.com/blog/let-ai-agent-sign-up-for-websites)
