# test_limit_exceeded: HTTP 403
URL: https://emailforagents.ai/docs/errors/test_limit_exceeded
Summary: The action is valid but it would push a test-mode allowance past its cap, so it was refused before anything was written. What triggers it in the implementation, and how to resolve it.

## test_limit_exceeded

HTTP 403 Don’t retry REST and MCP

The action is valid but it would push a test-mode allowance past its cap, so it was refused before anything was written.

### How to fix it

1. Shrink the message. The byte check sums text, HTML and attachments, so trimming a large HTML body is usually the quickest fix.
2. Declare an upload’s real size. The declared size counts against the byte cap from the moment it is reserved, and only the unused part comes back when the upload completes.
3. Contact support if you are at the inbox or message cap. Nothing frees either one today: test inboxes can’t be deleted, and sent test messages stay counted.
4. A second workspace starts with its own test caps, but one person can own at most five workspaces.

### Which rule fired

Test mode is free and therefore bounded, and the bounds are checked against a locked usage row rather than a cached count. Three separate caps produce this code: 3 test inboxes per workspace, 100 sent test messages, and 10 MiB of test content. Nothing frees the inbox and message caps today: they count for the life of the workspace. The byte cap only hands back the unused part of an upload’s declared size, when the upload completes. The message and byte checks run together on a send from a test inbox, and the byte total includes the text, the HTML and every attachment, so a single large message can trip the cap on its own.

| In error.message | Means |
| --- | --- |
| `This workspace already has the maximum number of test inboxes.` | The workspace has already created 3 test inboxes. The count only goes up. |
| `Test-mode storage or message cap would be exceeded.` | A send from a test inbox, when the workspace has already sent 100 test messages, or when the message's text, HTML and attachment bytes would take its test content past 10 MiB. |
| `Test-mode storage cap would be exceeded.` | A declared upload size would take the workspace's test content past 10 MiB. Checked at reservation, before any bytes are accepted. |

**Why it works this way:** The storage check runs at upload reservation rather than at upload completion. Checking after the bytes arrive would mean accepting content the workspace has no room for and then deleting it, and two parallel uploads could each pass an unreserved check and together exceed the cap.

### Example

POST /v1/projects/{project_id}/inboxes → 403

```
{
  "error": {
    "code": "test_limit_exceeded",
    "message": "This workspace already has the maximum number of test inboxes.",
    "request_id": "req_8Kd2x91",
    "retryable": false,
    "details": {}
  }
}
```

Over MCP, `send_message` returns it as text in a result marked `isError: true`, not as this body.

#### Where it appears

- `POST /projects/{project_id}/inboxes`
- `POST /projects/{project_id}/inboxes/{inbox_id}/messages`
- `POST /projects/{project_id}/uploads`

Paths are relative to `https://api.emailforagents.ai/v1`.

### Often confused with

[quota_exceeded](https://emailforagents.ai/docs/errors/quota_exceeded) [test_mode_unsupported](https://emailforagents.ai/docs/errors/test_mode_unsupported)
