Appearance
Errors
A route that fails answers with an HTTP status and an error envelope:
json
{"error": {"code": "validation_failed", "message": "...", "fields": {"stage": "must be staging or live"}, "request_id": "..."}}| Field | What it is |
|---|---|
code | What went wrong, from the table below. Branch on it, not on message. |
message | An English sentence for a person. |
fields | With validation_failed, the problem with each field, by name (recipe.0, steps.2.params.to.1). |
request_id | The request's id. Quote it when you ask for help. |
Codes are stable: a code is never renamed or given another meaning, and its status does not change. New codes are added for new cases only.
Codes
| Code | Status | Meaning |
|---|---|---|
bad_request | 400 | the request could not be read: a bad path parameter or body |
unauthorized | 401 | no valid credentials; also the MCP doors' raw 401 body |
forbidden | 403 | the caller is known but may not do this |
not_found | 404 | the resource does not exist or the caller may not see it |
method_not_allowed | 405 | the route exists, the method does not |
conflict | 409 | the current state does not allow the operation |
gone | 410 | a code or link that expired |
edit_conflict | 409 | the record changed since the caller read it (optimistic lock) |
validation_failed | 422 | one or more fields failed validation; error.fields says which |
server_error | 500 | unexpected failure; details are only in the log |
bad_gateway | 502 | an upstream the request depends on answered badly |
too_many_requests | 429 | a rate limit refused the request; Retry-After says when to retry |
payload_too_large | 413 | an upload larger than the route accepts |
docs_storage_full | 413 | the project's documents storage limit is reached |
billing_suspended | 402 | the organization's billing account is suspended |
upstream_unavailable | 503 | an upstream or provider is temporarily unavailable |
call_denied | 403 | a tool call refused by write policy or a guardrail |
upstream_misconfigured | 409 | the stage's upstream setup cannot make the call (unpinned secret, missing injection) |
assistant_unavailable | 503 | the Frege assistant is not available |
assistant_not_connected | 409 | the Frege assistant is not connected for this user |
assistant_identity_mismatch | 409 | the assistant is connected as someone else |
connect_required | 403 | MCP door: the customer has not connected their upstream account yet |
invalid_client_metadata | 400 | MCP door registration (RFC 7591): the client's metadata is refused, e.g. a confidential client |
invalid_redirect_uri | 400 | MCP door registration (RFC 7591): a redirect URI is missing, not absolute, plain http off this machine, or a script |
slow_down | 429 | MCP door registration: too many registrations from one address (no longer limited: Claude registers from its own servers) (no longer answered) |
handoff_conflict | 409 | the handoff's conversation moved since the operator read it (state, holder, control version, messages); refresh the card and decide again |
handoff_idempotency_conflict | 409 | a handoff command's Idempotency-Key was already used with another body |
handoff_return_unavailable | 409 | the handoff has no agent to return the conversation to; resolve it instead |
handoff_files_unavailable | 409 | the deployment has no object store, so an operator's file cannot be uploaded or read |
delivery_not_replayable | 409 | a webhook delivery that failed verification kept no body, so it cannot be given to the hooks again (ADR-0043) |
domain_not_verified | 409 | PUT /projects/{id}/domain/white-label: the project's domain is not verified yet, so it may not hide Frege |
phone_number_taken | 409 | POST /projects/{id}/voice/numbers: another environment, or this one, already has the number (ADR-0048) |
authz_unavailable | 503 | the authorization store (OpenFGA) did not answer: the request is refused, retry it (ADR-0029) |
Two codes for 403
A 403 has two causes, and the code tells them apart:
forbidden: the caller's role, or key, may not do this.call_denied: the environment's own rules refused a tool call (its write policy or a guardrail). Nothing was sent to your API.
MCP servers
The MCP servers answer in their own way: JSON-RPC errors, tool results with isError, and a few HTTP answers before MCP starts. See MCP servers: errors and Events: errors.