# test_mode_unsupported: HTTP 422
URL: https://emailforagents.ai/docs/errors/test_mode_unsupported
Summary: The request is valid for a live project but the capability it uses has no meaning in test mode, so it is refused rather than approximated. What triggers it in the implementation, and how to resolve it.

## test_mode_unsupported

HTTP 422 Don’t retry REST API

The request is valid for a live project but the capability it uses has no meaning in test mode, so it is refused rather than approximated.

### How to fix it

1. Drop local_part and domain_id from the test inbox request and use the generated address. It is returned on the created inbox.
2. Create a separate live project for domain work. A project's environment is fixed at creation and there is no conversion.
3. Expect the address to end in .mail.invalid. That suffix is reserved precisely so nothing can route to it, which is what makes a test inbox safe.
4. For an end-to-end test of a real address, use a live inbox on agents.emailforagents.ai rather than trying to make test mode route.

### Which rule fired

A test inbox is not a live inbox with sending switched off. It has a non-routable address on .mail.invalid and a simulated transport, and it cannot reach an internet recipient at all. Custom addressing follows from that: a test inbox's address is generated, so supplying a local_part or a domain_id is rejected rather than ignored. Domain attachment and domain verification are refused on test projects for the same reason. There is no DNS to verify and nothing the verified domain could route to.

| In error.message | Means |
| --- | --- |
| `Test inboxes use generated non-routable addresses.` | Creating a test inbox while supplying local_part or domain_id. Test addresses are generated and non-routable. |
| `Test mode cannot attach domains. Test addresses remain on .mail.invalid.` | Attaching a domain to a project whose environment is not live. |
| `Test mode does not attach domains.` | Verifying a domain on a project whose environment is not live. |

**Why it works this way:** Refusing rather than ignoring the custom address fields is the choice here. Accepting local_part and quietly generating something else would leave you holding an address you believe is yours, in an environment where the address is not reachable anyway, and the mistake would only show up when the same code ran against a live project.

### Example

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

```
{
  "error": {
    "code": "test_mode_unsupported",
    "message": "Test inboxes use generated non-routable addresses.",
    "request_id": "req_8Kd2x91",
    "retryable": false,
    "details": {}
  }
}
```

#### Where it appears

- `POST /projects/{project_id}/inboxes`
- `POST /projects/{project_id}/domains`
- `POST /projects/{project_id}/domains/{domain_id}/verify`

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

### Often confused with

[test_mode_required](https://emailforagents.ai/docs/errors/test_mode_required) [environment_immutable](https://emailforagents.ai/docs/errors/environment_immutable)
