Errors
One error envelope, every code the agents API and the config read can answer with, and the refusals from your deployment these pages name.
Every refusal has the same three fields, on both surfaces:
{
"error": "This API key cannot manage agents: it lacks the manageAgents scope",
"code": "FORBIDDEN",
"timestamp": 1789569967913
}| Field | Type | Description |
|---|---|---|
error | string | A human-readable sentence. Do not match on it; it may be reworded |
code | string | The stable machine-readable code. Switch on this |
timestamp | integer | Milliseconds since the Unix epoch, at the moment of the failure |
Codes
| Status | code | Meaning |
|---|---|---|
| 401 | AUTHENTICATION_ERROR | No key, or an invalid, revoked or expired one |
| 400 | AUTHENTICATION_ERROR | The Authorization header is not Bearer followed by a key, such as Basic credentials or Bearer alone. Refused before the key is looked up |
| 403 | FORBIDDEN | On /agents, the key does not have the manage-agents permission, or, to start or stop an eval run, the run-evals permission. On the config read, the key's permissions.cores does not reach this agent |
| 429 | RATE_LIMITED | Over a rate budget on /agents: 120 requests a minute for one agent, or 600 for the key across all of them. scope in the body says which budget ran out, eval-run-start for the run start budget of 10 a minute. Wait Retry-After seconds |
| 413 | PAYLOAD_TOO_LARGE | The request body is over 400 KiB for an agent, about 1.5 MB for a file, 96 KiB for outcomes, 768 KiB for an eval case, or 4 KiB on the Twilio routes and to start an eval run. The body is cut off while it is read |
| 400 | INVALID_JSON, INVALID_BODY | The body is not JSON, or not an object. On an eval run start, INVALID_BODY is also a body without exactly one of suite and caseId |
| 400 | INVALID_CURSOR | On the eval lists, a cursor that was edited or belongs to another list |
| 400 | VALIDATION_ERROR | On the eval routes, a limit, status or archived out of range, or a single result read without caseId |
| 400 | UNKNOWN_FIELD | The body carries a field this route does not take: slug, routingKey, the read-only sessionIdleMinutes, or a misspelling. On PUT /agents/{slug}/outcomes, anything but fallback and rules |
| 400 | INVALID_SLUG | The slug is not lowercase letters, digits and hyphens (^[a-z0-9-]+$), or is over 100 characters |
| 400 | INVALID_DIRECTORY | The directory is not ^[a-z0-9][a-z0-9-]*$, or is over 64 characters. On the write and delete routes, an empty ?directory= lands here rather than defaulting to main. The list route never reads the parameter |
| 400 | INVALID_PATH | The path is neither entries.json nor lowercase [a-z0-9._/-] ending in .md, holds .., or is over 200 characters |
| 400 | INVALID_NAME | The name is not a string or null, or holds a NUL character or an unpaired surrogate |
| 400 | INVALID_INSTRUCTION_SOURCE | Not repo or database |
| 400 | INVALID_TIMEZONE | Not a zone the IANA database knows |
| 400 | INVALID_PHONE_NUMBER, INVALID_TRANSFER_NUMBER | Not E.164. On PUT /agents/{slug}/twilio/number, also a phoneNumber missing from the body |
| 400 | INVALID_VARIABLES | variables is not an object of name to string, a name is not ^[A-Za-z_][A-Za-z0-9_]*$ within 64 characters, or a value holds a NUL character or an unpaired surrogate |
| 413 | VARIABLES_TOO_LARGE | The whole variables map is over 64 KiB as the column stores it |
| 400 | INVALID_MODEL | model is not an id of 1 to 128 letters, digits and . _ : / - starting with a letter or digit, or null |
| 400 | INVALID_CHANNEL_OVERRIDES | channelOverrides is not a map of channels to { "model", "disabledTools", "enabledTools" }, with an optional voice on the voice entry: a channel outside lowercase letters, digits, _ and - or over 32 characters, an entry with another field, a voice on any other channel, even null, a model that is not an id or null, a voice that is not 1 to 128 printable ASCII characters with no space or null, or more than 64 tools in one list |
| 413 | CHANNEL_OVERRIDES_TOO_LARGE | The whole channelOverrides map is over 16 KiB as the column stores it |
| 400 | INVALID_TOOLS_OPT_IN | toolsOptIn is not true or false |
| 400 | INVALID_RECORD_CALLS | recordCalls is not true or false |
| 400 | MODEL_NOT_OFFERED | PUT /agents/{slug} changes a model, the agent's own or a channel's, to one its deployment does not offer there. Also the answer when the deployment offers nothing, or the agent names none, and the first value the request changes is a model. error names the field, its value and the deployment. Nothing is written |
| 400 | VOICE_NOT_OFFERED | PUT /agents/{slug} changes the voice entry's voice, or the model beside it, and the voice is not one the engine that model runs on offers: a realtime model's voices, relayVoices beside a relay text model, and beside null or a model the deployment no longer offers, the default engine's, from kit 0.43.0 only. An engine that offers no voices refuses every one. Also the answer when the deployment offers nothing, or the agent names none, and the first value the request changes is a voice. Nothing is written |
| 400 | INVALID_OUTCOMES | PUT /agents/{slug}/outcomes: a list the console could not store. error names the first problem: a fallback or a name that is not 1 to 40 characters once trimmed or holds a NUL character or an unpaired surrogate, more than 30 rules, a rule that is not { "name", "when" }, two names the same ignoring case, or a when that is neither one { "tool": "<tool id>" } or { "event": "transferred" | "voicemail" | "hung_up" | "agent_ended" } nor an { "anyOf": [ … ] } of 1 to 20 of them. Nothing is written |
| 400 | INVALID_EVAL_CASE | An eval case a rule refuses. field names the field, such as goal or tools.lookup_customer. Nothing is written |
| 400 | CASE_ID_MISMATCH | A PUT whose body slug renames a case that does not exist |
| 400 | INVALID_IDEMPOTENCY_KEY | An Idempotency-Key on an eval run start that is not 1 to 255 characters |
| 400 | INVALID_CONTENT | The content is not a string, or holds a NUL character or an unpaired surrogate |
| 413 | CONTENT_TOO_LARGE | The file is over 256 KiB of UTF-8 |
| 400 | INVALID_ENTRIES | entries.json is not an object whose values are prompt paths: lowercase [a-z0-9._/-] ending in .md, with no .. segment |
| 400 | INVALID_ACCOUNT_SID, INVALID_API_KEY_SID | Not AC or SK followed by 32 hex characters. The hex may be in either case and is stored lowercase. The prefix must be uppercase, and nothing is trimmed |
| 400 | INVALID_API_KEY_SECRET | Not the 32 letters and digits Twilio shows when it creates an API key |
| 400 | INVALID_AUTH_TOKEN | Not 32 lowercase hex characters, and not null |
| 400 | INVALID_DEPLOYMENT | A deployment on PUT /agents/{slug} that is not a name of 1 to 255 characters or null, a webhooks body's deployment that is not a non-empty string, or ?deployment= with nothing after it |
| 400 | TWILIO_REJECTED | Twilio refused the API key, the auth token or the request. Twilio's own error code is in error |
| 404 | NOT_FOUND | No agent with this slug, or none on this routing key, in the organization. An agent in another organization gets the same answer, and so does a deployment's retired former agent on every route but PUT /agents/{slug} |
| 404 | FILE_NOT_FOUND | No file at this path |
| 404 | CASE_NOT_FOUND | No eval case with this id on this agent, or no result for it in the run |
| 404 | RUN_NOT_FOUND | No eval run with this id on this agent |
| 409 | NO_INSTRUCTIONS | Switching an agent to database, or creating one on it, while it has no file stored. The config read answers the same for a database agent with nothing stored |
| 409 | LAST_INSTRUCTION_FILE | Deleting the only file of an agent on database. Switch it to repo first |
| 409 | IS_DEPLOYMENT | Deprecated, and no longer answered. It refused DELETE /agents/{slug} on one of your running deployments. A deployment is no longer an agent, so no slug is one. Listed for one more release |
| 409 | NOT_CONNECTED | Listing numbers, choosing or clearing one, or pointing webhooks, for an agent with no Twilio account connected |
| 409 | NUMBER_NOT_IN_ACCOUNT | The number is not in the agent's connected Twilio account |
| 409 | NUMBER_FROM_TWILIO | PUT /agents/{slug} tried to change or clear the phoneNumber of an agent with a Twilio account connected. Its number is chosen with PUT /agents/{slug}/twilio/number |
| 409 | NO_PHONE_NUMBER | Pointing webhooks for an agent with no phoneNumber |
| 409 | NUMBER_ROUTED_ELSEWHERE | A TwiML App or an Elastic SIP Trunk routes the number, so Twilio would ignore the webhook URLs |
| 409 | NO_DEPLOYMENT | The deployment a request names (a deployment field, or ?deployment=) is not one of your organization's. Or the agent names none and no deployment serves your agents by routing key. Or, when pointing a number, the chosen deployment serves no agents by routing key. Or, on GET /agents/{slug}/deployment/models, the agent names none and the request names none either. Or, to start an eval run, the agent names none |
| 409 | AMBIGUOUS_DEPLOYMENT | The agent names no deployment, several serve your agents, and the request names none. Name one, or link the agent with PUT /agents/{slug} |
| 409 | TWILIO_HOST_UNKNOWN | The deployment has not announced the host Twilio should call, or announced one Twilio cannot reach |
| 409 | DEPLOYMENT_URL_UNKNOWN | Reading the agent's deployment: no address is approved for it, or it is not a public https address. Nothing was sent. An operator approves it on the deployment's page in the console |
| 409 | VARIABLES_NOT_PUBLISHED | GET /agents/{slug}/deployment/variables: the deployment publishes no list of variables, from a kit before 0.21.3 or with no description at all. kitVersion in the body is its kit, or null |
| 409 | PROMPTS_NOT_PUBLISHED | GET /agents/{slug}/deployment/prompts: the deployment publishes no prompt files with a storagePath, from a kit before 0.23.0 or with no description at all. kitVersion in the body is its kit, or null |
| 409 | CASE_ID_TAKEN | Renaming an eval case onto an id the agent already has |
| 409 | CASE_ID_LOCKED | Renaming an eval case that has results, or that a running run holds. reason is has_results or in_running_run |
| 409 | SUITE_FULL | The case's suite already holds 50 cases, archived ones included |
| 409 | CASE_ARCHIVED, NO_CASES, TOO_MANY_CASES | An eval run of an archived case, of a suite with no live case, or of one with more than 50 (count) |
| 409 | EVAL_LIVE_NOT_ALLOWED | An eval run whose cases answer a tool live that the deployment does not let run live on that case's channel, or on a channel the agent does not run. cases lists them. Nothing started |
| 409 | EVALS_UNAVAILABLE | An eval run on an agent whose deployment does not advertise the eval door (kit 0.44.0), or has no approved address |
| 409 | RUN_IN_PROGRESS | Another eval run of this agent is going. runId names it, or is null when it ended in between |
| 409 | RUN_FINISHED, RUN_NOT_STOPPABLE | Stopping a run that completed without a stop, or one a local bun run evals reported |
| 409 | IDEMPOTENCY_KEY_REUSED | The Idempotency-Key already started a different run: another agent, another body, or another API key |
| 409 | CHANGED_DURING_CHECK | The agent's number or Twilio account changed while the request was checking or writing the other. Retry |
| 500 | DATABASE_ERROR | A query failed inside Subcore. Retry; if it persists, report it |
| 503 | CONSOLE_UNAVAILABLE | An eval case write or an eval run start or stop could not be completed by the Subcore console, which holds their rules. With retryable: true the console's answer could not be read, so the write may have happened: read it back before retrying. With false nothing was written, and retrying changes nothing until Subcore is fixed, such as a console not serving the route yet |
| 503 | RUN_NOT_STARTED | An eval run was written and then could not start. It is kept as a failed run, runId names it, and its Idempotency-Key is released, so a retry starts a new run |
| 503 | TWILIO_UNAVAILABLE | Twilio did not answer in time, answered with a 5xx or a 429, or took over 25 seconds to list the account. Retry. The same code answers an account too large to list, with over 20,000 numbers or Messaging Services, which a retry does not fix; error says which |
| 503 | DEPLOYMENT_UNAVAILABLE | Reading the agent's deployment failed. retryable in the body is true when the failure can pass: the deployment timed out, could not be reached, or answered with a 5xx or a 429. Retry after at least 10 seconds. It is false when asking again gets the same answer until the deployment or Subcore changes, Subcore being unable to sign the request included; report it |
Handling them
Always retry 429, 500 and 409 CHANGED_DURING_CHECK. Retry
503 DEPLOYMENT_UNAVAILABLE and 503 CONSOLE_UNAVAILABLE only when their
retryable is true, and retry 503 RUN_NOT_STARTED. Retry an eval run start
with the same Idempotency-Key,
so a start that did happen is returned rather than repeated. Retry
503 TWILIO_UNAVAILABLE unless its error says the account is too large to
list. Retry 409 RUN_IN_PROGRESS once the agent's run has ended: poll the run
its runId names, or, when runId is null, simply try again. Do not retry the other
4xx codes: a 400, 401, 403, 404 or any other 409 means the request
itself, or something it depends on such as your client's Twilio setup, has to
change first, and sending it again unchanged will fail the same way. On a 429,
wait the number of seconds in Retry-After.
The Twilio codes are set out where they arise, with what to do about each, on Twilio accounts.
Two of the instruction 409s are about order. NO_INSTRUCTIONS means write a
file first, then switch. LAST_INSTRUCTION_FILE means switch the agent to
repo first, then delete. See
the two guards.
MODEL_NOT_OFFERED and VOICE_NOT_OFFERED are checked against the copy of
the deployment's description the console keeps. If a deploy has just added the
model or voice you asked for, or moved the deployment to kit 0.43.0, have the
console read the deployment again, by opening it under Deployments, then send
the PUT again. See
checked against the deployment's offer.
AMBIGUOUS_DEPLOYMENT goes away for good once the agent names its deployment:
send { "deployment": "<name>" } on
PUT /agents/{slug}, and every
later request for that agent dials it without being told.
Switch on code, not on error. The sentences are written for a person reading
a log and are not part of the contract.
A 404 NOT_FOUND never confirms an agent across organizations. A slug or
routing key that exists in another organization gets the same answer as one
that exists nowhere, so a 404 on an agent you expected to find usually means
the key and the agent belong to different organizations.
Refusals from your deployment
Every code above comes from api.subcore.ai. Your deployment's own routes
answer with codes the kit documents. These follow from what these pages cover:
| Status | code | Meaning |
|---|---|---|
| 404 | routing_key_required | A text door or the Playground was asked on its bare path, without {tenantPath}, from kit 0.31.0, and the eval door from kit 0.44.0. error names the path to use |
| 404 | conversations_withheld | One of the console's conversation routes, to read a conversation or take one over, on a deployment whose TELEMETRY_PROFILE is anything but full or unset, from kit 0.34.0. It is checked after the console's credential and before any lookup, so it says nothing about whether the conversation exists |
| 400 | eval_live_not_allowed | An eval turn asked to run a tool for real that may only be mocked on that deployment, from kit 0.44.0. tools in the body lists them. The turn did not run |
| 429 | eval_busy | The instance already runs as many eval turns as it allows, 2, from kit 0.44.0. Wait Retry-After seconds |
| 200 | eval_tools_unguarded | Not a refusal before the stream: the last line of an eval turn, an error line with this code, from kit 0.44.0. An agent the project's createSessionCore0 built for that turn can reach a tool the kit did not hand it as config.tools (a tool wrapped again with a new execute, say, or the loadSkill tool core0 adds for skills), or has mcpServers. From kit 0.47.0, a project's turn runner ends the turn this way too, before its turn runs, when an Effect tool of its session's flows or a tool in its tools did not come from session.wrapTool, when one carries a voice lifecycle tool's id but wraps a tool of your own, or when the session returns neither list (step 2 says what the kit cannot see). message names the tools, any agent with MCP servers, and the turn runner's cause. No tool ran |
Each body has error and code but no timestamp. conversations_withheld
adds detail, and eval_live_not_allowed adds tools. The
eval_tools_unguarded line carries message and code instead. Retry only
eval_busy, after Retry-After. The others give the same answer until the
request or the deployment changes: send the routing-key path, run full, list
the tool in the project's evals.liveToolIds, or build every agent from
config.tools, with no tool given a new execute and no skills or
mcpServers. A turn runner's fix is to wrap every tool its session declares,
leave each lifecycle id to the tool channelTools wires for it, and return
flows or tools.