Skip to navigation

Errors

One envelope, registered codes, and a retry class on every error.

Summary

Every error of the API has one envelope with a registered code and a retry class. This page gives the envelope, how to act on the retry class, conflict reasons, and the codes that refuse a workspace or a call start. It does not list every code; see Error codes.

Facts

Every error has the same body:

{
"error": {
"code": "invalid_request",
"message": "The request is invalid.",
"details": {"field": "name"},
"request_id": "req_01j00000000000000000000000",
"retry": "no"
}
}
FieldMeaning
codeA stable code from the platform’s error registry. Each code has exactly one HTTP status.
messageA safe description for people. It can change: never branch on it.
detailsSafe, code-specific fields. For each code, only the fields listed in Error codes appear.
request_idThe same value as the X-Request-Id response header. Quote it to support.
retryno, yes or retry_after. See below.

Only code and message are required by the schema. Rasen sends details, request_id and retry on every error, but parse an error that lacks them rather than failing on it.

details never contains a request fingerprint, a hash of a request, secret material or another workspace’s data. Messages never carry a provider’s payload or a secret you submitted.

Rules

  • MUST branch on error.code, and on error.details.reason for conflict. MUST NOT branch on message.
  • MUST follow retry. MUST NOT resend a retry: "no" request unchanged.
  • MUST retry with the same Idempotency-Key. MUST NOT retry with a new key.
  • MUST keep an unknown code, reason or retry value, and treat it as unknown, never as success.

Refusals at the edge

Refusals made before an operation runs use the same envelope, with request_id and retry: a missing or unknown key (401), an unavailable key check (503), a NUL character in a JSON string (400 invalid_request) and a body over 1 MiB (413 payload_too_large). Their details are only field, spelled with dots for nesting and list positions (a.0.b), or bytes and limit_bytes.

A request that no operation serves is refused the same way, with retry: "no":

AnswerWhenDetails
404 not_foundA path under dedicated-host /v1 that no operation or documentation page servesnone
405 method_not_allowedA declared path with a method it does not takeallowed (the methods it takes), also sent as the Allow header

A request with no key still gets the public 401 first. An unexpected fault outside an operation also answers in the public envelope.

method_not_allowed is edge-only: it is a registered code, but no operation declares a 405, so it is not in the contract’s error catalog or on Error codes. Treat it as a bug in the request’s method or path, not as something to retry.

How to handle an error

  1. Branch on error.code. For conflict, branch on error.details.reason too.
  2. Follow retry:
retryWhat to do
noFix the request, or read the current state first. Do not resend it unchanged.
yesResend the same request with the same Idempotency-Key.
retry_afterWait the Retry-After seconds, then resend the same request with the same Idempotency-Key.

retry is an open vocabulary: preserve a value you do not know, and never read it as success.

For an operation that takes an Idempotency-Key, retrying internal_error, provider_unavailable, unavailable, at_capacity or call_orchestrator_unavailable with the same key is safe: if the first attempt took effect, the server replays its stored outcome; if it had no effect, the retry performs the operation once. Never retry with a new key.

Conflicts

409 answers are not retryable, with one exception: idempotency_in_progress carries Retry-After, after which you resend the identical request with the same key. For every other 409, read the current state, fix the request and send a new request.

409 conflict names its cause in details.reason. Reasons are an open list; each operation documents the ones it can return in the API reference (x-conflict-reasons):

details.reasonReturned by
stale_revisionPhone-number assignments, Knowledge source reingest
live_version_changedpublishAgent, rollbackAgent
live_version_mismatchcreateCall or createAgentSession with expected_version_id
outbound_number_ambiguouscreateCall without from_number_id when the agent has several outbound numbers
name_takenCreating or replacing tools, MCP servers, Knowledge sources and secrets
resource_key_immutablereplaceMcpServer with a different resource_key
connected_elsewheresetPhoneNumberInboundAgent when another workspace answers the number
active_callRemoving an agent from a number while a call on that number and agent runs
inbound_agent_required, account_changed, credentials_changedprovisionPhoneNumber
source_not_eligible, sources_not_ready, not_reingestableKnowledge library, snapshot and source operations

Workspace and call-start refusals

These codes refuse a request for the state of the workspace or the organization, not for the request itself. A refused call start started and dialled nothing.

CodeCauseFix
workspace_archived (403)The workspace is archived. A key can neither read nor write.Ask the organization owner to restore the workspace. Do not retry.
workspace_view_only (403)The workspace is view-only. A key can read and cannot write.Read only. Do not retry the write.
organization_paused (403)Calls from this organization are stopped by a staff pause. Returned by createCall and createAgentSession.Do not retry. The organization owner contacts team@rasen.ai.
workspace_concurrency_unallotted (403)No concurrency is allotted to this workspace, so a call cannot start.An organization Owner or Admin sets the workspace’s share in organization settings. Do not retry.
workspace_concurrency_full (429)The workspace’s share of concurrent calls, or its organization’s total, is full. details has active, limit and reason.Wait the Retry-After seconds, then send the same request with the same Idempotency-Key.
admission_busy (503)Admission was busy for the organization and could not decide the call in time. Returned by createCall and createAgentSession; details.waited_ms is the wait.Wait at least the Retry-After seconds, then send the identical request with the same Idempotency-Key.

Common codes

StatusCodeTypical cause
400invalid_requestA malformed field (details.field), an unknown field, or an invalid or expired cursor.
401unauthenticatedA missing, invalid, expired or revoked key.
403forbiddenThe key lacks a capability; details.required_capabilities lists every missing one.
404not_foundThe resource does not exist or is not visible to this workspace; the two look the same.
409draft_conflictA stale ETag on an agent, draft, variable, tool, MCP server or publication.
409idempotency_key_reusedThe key was already used for a different request.
428revision_requiredAn edit without If-Match.
429rate_limitedThe rate limit was reached; wait Retry-After.

The complete list of the codes this API returns, with their status, retry class and details, is on Error codes.