> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testworld.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> One envelope for every error of the control API.

```json theme={null}
{"error": {"type": "invalid_request", "message": "unknown field: foo"}}
```

`type` is stable and meant for code. `message` is for people and can change.

| Status | Type | When |
| - | - | - |
| 400 | `invalid_request` | The body is not valid JSON, has an unknown field or a value out of range, a check is invalid, or `task` is an unknown `task_` id. |
| 401 | `unauthorized` | No key, or a wrong one. |
| 404 | `not_found` | No such environment, run or route. |
| 409 | `run_ended` | The run has ended: a second finish, `/tools`, or a tool call. |
| 409 | `idempotency_conflict` | The same `idempotency_key` with a different body. |
| 429 | `rate_limited` | Too many failed authentications for one key. The answer has `retry-after` in seconds. |

The tools answer in the shape of the API they copy. Slack answers `{"ok": false, "error": "..."}`, for example `invalid_auth` for a wrong run token. Gmail and Calendar answer Google's `{"error": {"code", "message", "status"}}`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.