API Reference
Error Responses
The shared error envelope, every error code, what causes it, and how a client should react.
Both APIs return errors in one envelope:
{
"error": {
"code": "validation_failed",
"message": "request validation failed",
"request_id": "1b6e2a90-3c4d-4e5f-8a7b-9c0d1e2f3a4b"
}
}| Field | Meaning |
|---|---|
code | Stable, machine-readable identifier. Branch on this |
message | Human-readable and safe to show. Never contains stack traces, SQL, or secret values. May change between versions |
request_id | UUID for correlating with logs |
details | Control plane only, on some validation errors: [{ "field", "issue" }] |
A deny is not an error
A deny from authorize is a recorded decision, returned with HTTP 403 and the decision body, not the error envelope. The SDKs raise Denied for it.
Codes
| Code | Typical status | Meaning | Client action |
|---|---|---|---|
unauthenticated | 401 | Missing or invalid signature or session, replayed nonce, wrong credential type for the service | Fix credentials; never retry the same nonce |
forbidden | 403 | Role not allowed (control plane), or decision is deny / agent inactive (execute) | Do not retry |
password_change_required | 403 | Session from a temporary password | Change the password first |
self_approval | 403 | Approver's user id equals the agent id | Another person must decide |
validation_failed | 400, 413 | Body, parameter, or adapter validation failed; body too large | Fix the request |
not_found | 404 | Resource does not exist in your organization, or the route is not registered | Do not retry |
conflict | 409 | Idempotency mismatch, arguments mismatch, approval mismatch or not pending, execution already failed or dispatched, name or key already exists | Re-authorize or change the request |
approval_required | 409 | Execute of a held decision without an approved approval | Wait for approval |
approval_expired | 409 | Approval passed its 15-minute expiry | Authorize again |
rate_limited | 429 | Request, tool-call, or token budget exceeded | Back off; the window is 60 s |
circuit_open | 503 | Tool circuit open after repeated adapter failures | Retry after 30 s |
not_implemented | 501 | No adapter for this tool or operation | Do not retry |
internal_error | 500 | Dependency or server failure, including adapter timeout | Authorize again later; never assume success |
Gateway messages
| Message | Code |
|---|---|
human sessions are not accepted by the gateway | unauthenticated |
agent signature headers are required | unauthenticated |
authentication failed | unauthenticated |
nonce already used | unauthenticated |
request body is required / request body is invalid | validation_failed |
arguments must be an object / arguments are invalid | validation_failed |
request rate limit exceeded / tool call limit exceeded / token budget exceeded | rate_limited |
idempotency key does not match this request | conflict (authorize) |
idempotency key does not match the decision | conflict (execute) |
arguments do not match the decision | conflict |
decision is deny | forbidden |
decision requires approval | approval_required |
approval does not apply to this decision / approval does not match this decision | conflict |
execution cannot be completed | conflict |
no adapter is registered for this tool | not_implemented |
tool circuit is open | circuit_open |
tool adapter timed out | internal_error |
Failing closed
No error means "allowed". When a client cannot tell whether a call ran, for example after a network failure during execute, it should not assume success or retry blindly. A repeat execute of the same decision either returns the stored result (it completed) or 409 (it failed or was interrupted), and never runs the adapter twice.
SDK mapping
| Response | Python | TypeScript |
|---|---|---|
Decision deny (from call_tool) | Denied | Denied |
Decision require_approval (from call_tool) | ApprovalRequired | ApprovalRequired |
| Error envelope | GatewayError(status, code, message) | GatewayError with status, code, message |
| Non-JSON or unexpected response | GatewayError(…, "invalid_response", …) | GatewayError(…, "invalid_response", …) |
Was this page helpful?