---
title: "Errors"
description: "API error codes, run failure codes and tool errors."
---

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

# Errors

cloudraker.run reports errors in four places. An API call answers an HTTP error. A run that fails sends `run.failed`. A tool that fails returns a tool error to the agent, and the run continues. A conversation sends an `error` item for an item it cannot take.

## API errors

Every endpoint uses the same error body:

```json
{
  "error": {
    "code": "run_busy",
    "message": "A turn is already running.",
    "run_id": "run_01K7Q3V9X2M4N6P8R0S2T4V6W8"
  }
}
```

`code` is stable. Write your logic against `code`, not against `message`. `run_id` is present when the error concerns one run. `details` is present on some codes, for example `input_schema`.

### Requests and auth

| Status | Code                     | When                                                                        |
| ------ | ------------------------ | --------------------------------------------------------------------------- |
| 400    | `invalid_body`           | The JSON or a field shape is not valid.                                     |
| 401    | `unauthorized`           | The token is missing or not valid.                                          |
| 403    | `forbidden`              | The token does not have the scope or the agent.                             |
| 403    | `file_forbidden`         | A `file_id` in `files` is out of reach of your token.                       |
| 403    | `access_denied`          | A `protection: access` agent needs a Cloudflare Access sign-in.             |
| 403    | `run_access_required`    | Your organization is on the waitlist. It cannot run agents yet.             |
| 413    | `payload_too_large`      | `input` or `files` is over the limit.                                       |
| 422    | `input_schema`           | `input` does not match `input_schema`. `details` has the schema errors.     |
| 422    | `secret_not_overridable` | `secrets` names a secret without `overridable: true`.                       |
| 422    | `secret_unknown`         | `secrets` names a secret that the agent does not declare.                   |
| 422    | `model_override_denied`  | `model` is sent, but the agent sets `allow_override: false` or is `public`. |
| 422    | `idempotency_mismatch`   | The same `Idempotency-Key` comes with a different body.                     |
| 422    | `question_mismatch`      | `answer.question_id` does not match the open `question` event.              |

### Agents and runs

| Status | Code                 | When                                                                                                                                         |
| ------ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| 404    | `agent_not_found`    | No agent at this path. Also for an agent of another org.                                                                                     |
| 404    | `run_not_found`      | No run with this id, or the run stub is gone (90 days after the purge). Also for a run of another org.                                       |
| 404    | `preview_not_found`  | No preview deployment with this name.                                                                                                        |
| 409    | `run_not_turn_based` | `POST /_run/{id}` on a `zeroshot` run.                                                                                                       |
| 409    | `run_busy`           | A turn is in progress.                                                                                                                       |
| 409    | `run_terminal`       | `POST` or `DELETE` on a run that has ended.                                                                                                  |
| 410    | `run_expired`        | `POST /_run/{id}` after `idle_ttl`.                                                                                                          |
| 410    | `run_purged`         | A content read (events, stream replay, messages, trace, files) after retention deleted the content. `GET /_run/{id}` still answers the stub. |
| 503    | `agent_undeployed`   | The default branch has no valid deployment of this agent.                                                                                    |
| 503    | `agent_removed`      | The newest deployment removed this agent. Waiting runs still finish.                                                                         |

The API answers 404, never 403, for a resource of another org.

### Limits and billing

| Status | Code                      | When                                                                                                 |
| ------ | ------------------------- | ---------------------------------------------------------------------------------------------------- |
| 402    | `credits_exhausted`       | Your credits are empty, or the run is over the daily run cap of a free plan.                         |
| 402    | `insufficient_ai_credits` | The AI wallet is empty. Only a run on CloudRaker inference gets this error.                          |
| 402    | `payment_method_required` | An **Add funds** purchase needs a payment method on file.                                            |
| 429    | `rate_limited`            | Too many requests for this token, or too many turns on this run. Wait for the `Retry-After` seconds. |
| 429    | `concurrency_limited`     | Too many concurrent runs. `Retry-After` is in seconds.                                               |
| 503    | `billing_unavailable`     | The billing service did not answer, or a purchase did not go through. Try again.                     |

A 402 refusal creates no run and no turn. Read [Limits and pricing](https://docs.cloudraker.com/run/guides/limits-and-pricing#admission-and-settlement).

### Console and repos

| Status | Code                      | When                                                                                      |
| ------ | ------------------------- | ----------------------------------------------------------------------------------------- |
| 400    | `invalid_body`            | A save, a publication or a restore fails lint. `details` has the lint errors.             |
| 404    | `not_found`               | The project, the source version or the reviewed base version does not exist.              |
| 404    | `record_not_found`        | The record, schema or webhook delivery does not exist.                                    |
| 409    | `repo_exists`             | A repo with this name exists.                                                             |
| 409    | `base_path_taken`         | Another repo of the org uses this base path.                                              |
| 409    | `schema_exists`           | A data schema with this name exists in the org, or is a draft.                            |
| 409    | `stale`                   | The draft or the published version changed since you loaded or reviewed it. Reload first. |
| 409    | `conflict`                | Another draft uses the same preview address. Choose a different draft name.               |
| 413    | `invalid_body`            | A draft save request is over 10 MB.                                                       |
| 501    | `not_implemented`         | The route is not available yet.                                                           |
| 502    | `publication_unknown`     | The draft merged, but the deploy did not confirm. Check the live version before a retry.  |
| 503    | `publication_unavailable` | Publication is busy. Try again shortly.                                                   |

A `stale` save does not apply your unsaved changes. When a merge succeeds and the deploy fails, the body also has `publication` with the merge `sha` and a `retry_path` for the redeploy.

### Front doors and conversations

| Status | Code                     | When                                                                                                                                                                                                                                                                                     |
| ------ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `invalid_request`        | A `lang` that is not in the door `languages`, a bad `variables` value, or a door gate that is not accepted. Also a socket request with no WebSocket upgrade, or with a subprotocol other than `run.cv.v1` only (for example `run.cv.v1, cvs_...`). The request spends its socket ticket. |
| 400    | `invalid_item`           | An answer that is not one of the choices, or a variable value out of its type or range.                                                                                                                                                                                                  |
| 400    | `unsupported_item`       | An `audio` item, or a file on a door that refuses files.                                                                                                                                                                                                                                 |
| 401    | `session_invalid`        | The `cvs_` session token is missing, bad, expired, or past 24 hours, or its embed key is revoked. For a socket: the ticket is missing, unknown, spent, expired, or of another conversation. Get a new ticket with `POST /_cv/{cv}/ticket`.                                               |
| 403    | `origin_forbidden`       | The `Origin` of the page is not in `channels.web.origins`, or is not the start origin.                                                                                                                                                                                                   |
| 403    | `turnstile_failed`       | The Turnstile check failed.                                                                                                                                                                                                                                                              |
| 404    | `door_not_found`         | No live door with this id, or the door does not have this channel. Also for a binding to a missing door.                                                                                                                                                                                 |
| 404    | `embed_key_invalid`      | The embed key does not exist or is revoked.                                                                                                                                                                                                                                              |
| 404    | `conversation_not_found` | No conversation with this id. Also for a conversation of another org.                                                                                                                                                                                                                    |
| 409    | `conversation_ended`     | The conversation has ended.                                                                                                                                                                                                                                                              |
| 409    | `turn_in_flight`         | A message while an agent of the conversation works.                                                                                                                                                                                                                                      |
| 409    | `binding_taken`          | The key is bound to another door. Unbind it first.                                                                                                                                                                                                                                       |
| 422    | `approval_unavailable`   | A tool call needs an approval, but no person can approve on this channel.                                                                                                                                                                                                                |
| 429    | `at_capacity`            | A limit of the door is reached. The body has the door `message`.                                                                                                                                                                                                                         |
| 429    | `too_many_streams`       | The conversation has 10 open sockets and streams.                                                                                                                                                                                                                                        |
| 429    | `rate_limited`           | Too many starts, items, socket tickets or session renewals from this IP address, or too many messages from this person.                                                                                                                                                                  |
| 503    | `door_unavailable`       | The kill switch of the door is on. The body has the door `message`.                                                                                                                                                                                                                      |
| 503    | `turnstile_unavailable`  | The check service is not available. Try again later.                                                                                                                                                                                                                                     |

A conversation also sends `error` items with protocol codes, for example `turn_in_flight` or `too_large`. Read [Conversations](https://docs.cloudraker.com/run/guides/conversations#error-codes).

### Run access and invite codes

An organization without access to CloudRaker Run is on the waitlist. It can do the onboarding, create projects, import templates, push and deploy. Every run, turn, test run, preview run and trigger answers 403 `run_access_required`. Enter an invite code to get access: `POST /_console/access/redeem` with `{ "code": "RUN-XXXX-XXXX" }`. `GET /_console/access` answers `{ "state": "granted" }` or `{ "state": "waitlisted" }`.

| Status | Code                  | When                                                                           |
| ------ | --------------------- | ------------------------------------------------------------------------------ |
| 403    | `run_access_required` | Your organization is on the waitlist. Enter an invite code first.              |
| 409    | `code_used_up`        | The invite code has no uses left.                                              |
| 410    | `code_expired`        | The invite code has expired.                                                   |
| 422    | `invalid_code`        | The invite code does not exist, was revoked or has a bad format.               |
| 429    | `rate_limited`        | More than 5 code attempts in one minute for your organization. Wait and retry. |
| 502    | `access_grant_failed` | Access could not be granted. The code is not used. Try again later.            |

### Phone

| Status | Code                 | When                                                                     |
| ------ | -------------------- | ------------------------------------------------------------------------ |
| 402    | `credits_exhausted`  | The org has no credits for the monthly number charge. No number is kept. |
| 404    | `number_not_found`   | No phone number with this id in your org.                                |
| 404    | `call_not_found`     | No call with this id, or the call has no recording.                      |
| 409    | `number_unavailable` | The number you selected is no longer available. Search again.            |
| 503    | `phone_unavailable`  | Phone is not available in this environment.                              |

Read [Phone](https://docs.cloudraker.com/run/guides/phone).

## Run failure codes

A failed run sends `run.failed` with `{ code, message, usage }`. `GET /_run/{id}` shows the same `error`. A failed run is billed for the minutes it used.

| Code                    | Cause                                                                                                                          |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `model_error`           | The model provider returned an error.                                                                                          |
| `timeout`               | The turn ran longer than `timeout`.                                                                                            |
| `step_limit`            | The run used more than `limits.max_steps` model steps.                                                                         |
| `secret_missing`        | The agent needs a secret that is not in the vault.                                                                             |
| `egress_denied`         | The agent called a host that `network` does not allow.                                                                         |
| `connector_unavailable` | A connector of `connectors:` does not exist, is not granted or needs a login.                                                  |
| `code_error`            | A code call failed and the run could not continue.                                                                             |
| `output_schema`         | The `done` result does not match `output_schema`.                                                                              |
| `concurrency_limited`   | The run waited in `queued` for more than 10 minutes.                                                                           |
| `machine_held`          | A machine agent stopped with a hold. The Inbox item has the reason. Read [Machine agents](https://docs.cloudraker.com/run/guides/machine-agents).             |
| `machine_error`         | The engine of a machine agent stopped with an error, or the Machine service was not available.                                 |
| `machine_tools_changed` | A pinned MCP tool of a machine agent changed since the deploy. Copy the new contract into `machine.tools.json` and push again. |

The message never contains a stack trace or a secret value. An admission refusal (`credits_exhausted`, `insufficient_ai_credits`) is an API error, not a `run.failed` code. A scheduled start that admission refuses is skipped.

## Tool errors

A tool error goes back to the model as the tool result. The run does not fail. The agent can try another way, or report the problem in its answer.

| Code               | Tool                 | Cause                                                                                                                                                                    |
| ------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `file_forbidden`   | `file.*`             | The run has no grant on this file id. The error does not say if the file exists.                                                                                         |
| `file_too_large`   | `file.*`             | The file is over 25 MB, or the input of a convert tool is over 25 MB in total.                                                                                           |
| `raw_read_refused` | `file.read`          | Raw reads are off. Use `file.parse`, or set `files.read_raw: true`.                                                                                                      |
| `paperwork_failed` | Paperwork tools      | The Paperwork API returned an error. The message has the detail. A `file.fill`, `file.classify` or `file.split` that does not finish in 5 minutes is stopped: try again. |
| `record_not_found` | `data.*`             | The schema or the record does not exist.                                                                                                                                 |
| `schema_exists`    | `data.define_schema` | A schema with this name exists in the org, or is a draft.                                                                                                                |

### Paperwork tool errors

These codes come from the Paperwork tools. Read [Files](https://docs.cloudraker.com/run/guides/files#paperwork-tools).

| Code                    | Tool                                                               | Cause                                                                                                                                                                                                                                            |
| ----------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `paperwork_unavailable` | Paperwork tools                                                    | The Paperwork backend is not reachable from this environment. For the sign tools, also when the org id lookup failed: try again later.                                                                                                           |
| `paperwork_needs_input` | Paperwork tools                                                    | A Paperwork step waits for a person. The tool cannot continue it.                                                                                                                                                                                |
| `paperwork_busy`        | `file.convert_pdf`, `file.merge`, `file.render_page`               | The document tools are busy. The error has `retry_after_s`.                                                                                                                                                                                      |
| `rate_limited`          | `file.form_fields`, convert tools                                  | The org is at its limit of parallel document jobs. Try again later.                                                                                                                                                                              |
| `invalid_body`          | `file.fill`, `file.redline`                                        | The input is not complete, for example `values` and `source_file_ids` together.                                                                                                                                                                  |
| `invalid_request`       | `file.convert_pdf`, `file.merge`                                   | The file is already a PDF, or a merge mixes PDFs and audio.                                                                                                                                                                                      |
| `unsupported_file_type` | `file.form_fields`, `file.fill`, redline tools, `file.render_page` | The file type is wrong for the tool. A form must be a PDF, a redline file must be a `.docx`.                                                                                                                                                     |
| `not_a_pdf`             | `file.split`, `file.sign_send`, `file.redact`                      | The tool takes a PDF only (`file.redact` also takes audio and video). Call `file.convert_pdf` first.                                                                                                                                             |
| `no_form_fields`        | `file.form_fields`                                                 | The PDF has no form fields.                                                                                                                                                                                                                      |
| `file_not_ready`        | `file.form_fields`                                                 | The file is still uploading. Try again.                                                                                                                                                                                                          |
| `unknown_fields`        | `file.fill`                                                        | `values` names a field that the form does not have. Call `file.form_fields`.                                                                                                                                                                     |
| `classes_required`      | `file.classify`                                                    | Send at least 2 classes.                                                                                                                                                                                                                         |
| `too_many_classes`      | `file.classify`                                                    | Send at most 50 classes.                                                                                                                                                                                                                         |
| `duplicate_class_id`    | `file.classify`                                                    | Two classes have the same `id`.                                                                                                                                                                                                                  |
| `config_too_large`      | `file.classify`                                                    | The classes and the instructions are over 16 KB.                                                                                                                                                                                                 |
| `invalid_segments`      | `file.split`                                                       | The page ranges do not ascend, overlap, or are more than 100.                                                                                                                                                                                    |
| `page_out_of_range`     | `file.render_page`                                                 | The page is not in the PDF. The message gives the page count.                                                                                                                                                                                    |
| `conversion_failed`     | convert tools                                                      | The file could not be converted, merged or rendered.                                                                                                                                                                                             |
| `redline_failed`        | `file.redline`                                                     | An operation failed and no file was written. Read `failed_index`, `operation` and `detail.code`.                                                                                                                                                 |
| `sign_quota`            | `file.sign_send`                                                   | The plan limit of open envelopes, or the daily send limit, refused the send.                                                                                                                                                                     |
| `sign_pending`          | `file.sign_send`                                                   | The send did not finish in the call (5 minutes, a failed status read or a stopped turn). The envelope can still go out. Do not send again. Call `file.sign_status` with `envelope_id`. An approved send with this code is not a failed approval. |
| `envelope_not_found`    | `file.sign_status`, `file.sign_void`                               | This agent has no envelope with that id, or the envelope purged.                                                                                                                                                                                 |
| `envelope_not_voidable` | `file.sign_void`                                                   | The envelope is not open: it is signed, sealing or ended.                                                                                                                                                                                        |
| `envelope_not_ready`    | `file.sign_void`                                                   | The envelope is still in preparation, and the cancel of its pipeline did not complete. Try again in a minute.                                                                                                                                    |

### Outbound requests

These errors apply to a fetch, an `_apis` operation and a `_code` request. For an MCP server or a connector, the engine cannot list the tools without a token. The tools of that server are not available in the turn, and no tool call returns this error.

| Code                   | Cause                                                                                                                                                                                                                                            |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `identity_unavailable` | The host or the connector has an `oidc` rule, and no token is available. The rule asks for `identity: user` and the turn has no person, or the Run issuer did not answer. The request does not leave. It never falls back to the agent identity. |

Read [OIDC identity](https://docs.cloudraker.com/run/guides/oidc-identity#when-the-token-is-not-available).

### Knowledge tools

| Code                    | Tool                                 | Cause                                                                                 |
| ----------------------- | ------------------------------------ | ------------------------------------------------------------------------------------- |
| `knowledge_forbidden`   | `knowledge_search`                   | `folder` is outside the `knowledge` grants of the agent.                              |
| `knowledge_not_indexed` | `knowledge_search`                   | The repo knowledge has no index yet. Try again after the next deploy.                 |
| `knowledge_unavailable` | `knowledge_search`, `knowledge_read` | The knowledge index or the file is not available now. The agent continues without it. |
| `not_found`             | `knowledge_read`                     | The file does not exist, or it is outside the grants.                                 |

Read [Knowledge](https://docs.cloudraker.com/run/guides/knowledge).

### Phone tools

| Code                  | Tool            | Cause                                                                      |
| --------------------- | --------------- | -------------------------------------------------------------------------- |
| `unknown_target`      | `transfer_call` | `target` is not a key of `channels.phone.transfers`.                       |
| `invalid_number`      | `call_phone`    | `to` is not a valid E.164 number.                                          |
| `country_not_allowed` | `call_phone`    | `to` is not a US or CA number.                                             |
| `premium_number`      | `call_phone`    | `to` is a premium number (900, 976 area or 976 exchange).                  |
| `call_in_progress`    | `call_phone`    | The run already has a live outbound call.                                  |
| `daily_cap`           | `call_phone`    | The org placed 20 outbound calls this UTC day.                             |
| `concurrency`         | `call_phone`    | The org has 5 live calls.                                                  |
| `outbound_off`        | `call_phone`    | `channels.phone.outbound` is not `true`, or the agent is not in that door. |
| `no_number`           | `call_phone`    | The door has no active number.                                             |
| `unavailable`         | `call_phone`    | The agent or the call service is not available, or the call failed.        |

## Push lint for OIDC

The push lint checks every `oidc` block. These codes are not API errors. An error rejects the push with `ng <ref> <reason>`. A warning does not block it. Read [Push lint](https://docs.cloudraker.com/run/guides/repo-layout#push-lint).

| Code                      | Level   | Cause                                                                                                             |
| ------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| `oidc_wildcard`           | error   | `oidc` on a `*.` host.                                                                                            |
| `oidc_user_audience`      | error   | `identity: user` with an audience other than `https://{host}`.                                                    |
| `oidc_header_conflict`    | error   | `oidc` and `headers` set the same header on one host.                                                             |
| `oidc_scopes_audience`    | error   | `scopes` on an `oidc` rule whose host or audience is not the org host.                                            |
| `user_identity_source`    | error   | `identity: user` on a host or a connector of a `protection: public` agent.                                        |
| `user_identity_no_person` | warning | Every trigger of the agent has no person (schedule, inbound, phone, email), and a connector has `identity: user`. |
| `api_security_header`     | warning | An `_apis` file needs a header that `network:` does not supply. An `oidc` header counts as supplied.              |

> **Note**
>
> Draft. The tool error lists show the outbound request, file, data, knowledge and phone tools only.

Source: https://docs.cloudraker.com/run/guides/errors/index.mdx
