Error envelope
api.attensira.com has no second shape and no plain-text response — a 404 for a URL that does not exist at all is still this envelope. One failure branch is enough for it.
Errors from the webapp host
A few routes are not onapi.attensira.com yet and are called on https://webapp.attensira.com instead (webhooks, and the routes the endpoint reference marks that way). That host answers with the same fields without the outer error object, and its type values are its own: invalid_request, authentication_error, permission_error, not_found, conflict, insufficient_credits, rate_limited, unavailable and internal_error.
webapp.attensira.com 403
code is the same on both hosts, so branch on code.
The fields
code and the fields after it are present when the backend sent them, and left out, never empty, when it did not. An error caught at the door of api.attensira.com (a malformed key, a bad parameter) carries only type, message and status. The extra fields are inside the same error object, so it is still one shape:
403 — a missing scope
Types
Codes
Everycode the backend can send, with its usual status and what to do. The MCP server reports the same code in its tool errors, as attensira: <message> (status <n>) [code] Fix: <fix> (<docs_url>), followed by Required scope:, Allowed values:, Current state version: and Next step: when they apply. Next step: is on refusals only a person can lift, and tells the assistant to hand the decision to them.
scope_denied
403. The credential does not hold the scope this call needs; required_scope names it. On an approval, details.reason is scope_ceiling and required_scope is the exact scope that would cover the item, such as approve:own_site:compensable. Ask the key’s owner for a key with that scope. See Scopes. An OAuth connection holds read, steer and approve:*:reversible, so a call that needs configure is refused this way.
raise_human_only
403. The call would let the agent do more on its own, which only a person can do, signed in to the app under Settings › Autonomy. No scope changes that: a key or a connection can lower these settings, never raise them. Nothing was changed and nothing was filed. The message starts “Not applied:” and names the page where a person makes the change. details.reason is autonomy_raise_in_app, details.outcome is refused, details.proposed lists each change that was asked for as {field, from, to}, details.field names the first, and details.confirm_url is the page. See Only a person can loosen these settings.
forbidden
403. Refused for a reason that is not about the credential’s scopes; the message says what it is. A different key will not help.
self_approval_rejected
403. This credential cannot approve this item: a run it started proposed it, or it cannot be undone, and no key or connection approves irreversible work. details.reason is self_approval, and details also names the item (item_ref), its lane and effect_class, and where to approve it in the app (app_path). A person approves it there, or, when a run this credential started proposed it, another key whose approve scopes cover it. The credential can still decline it. See Who can approve what.
role_viewer
403. A person whose role in the organization is viewer said yes to something. A viewer reads everything and approves nothing. details names the item (item_ref), its effect_class, the role and where to approve it in the app (app_path). Ask an approver or an admin to approve it, or ask an admin to change your role under Settings › Members. You can still decline it. See Members and roles.
reason_required
422. An action that needs a reason was sent without one. Set the reason to one of allowed_values. Sent today by a stop (POST /v1/actions with action: "stop") without payload.reason, and by cancelling a plan without reason.
veto_lost_race
409. The item changed state before your answer arrived. Get it again and decide on current_state_version. Sent today when a stop arrives after the change shipped or started shipping, or after it moved to a newer version than the one the stop named (If-Match). See Stopping a change in its 48 hours.
not_reversible
409. An undo (POST /v1/changes/{id}/actions with "action": "undo") that Attensira cannot carry out: the change is older than the 30 days a change can be undone in, or it is a kind of change we cannot undo ourselves. Nothing was changed. The message says why, and fix gives the step to undo it by hand when there is one. Ask for a new change that reverses it, or make the step yourself.
idempotency_conflict
409. Reserved: an idempotency key reused with different arguments. Reuse a key only with the same arguments, and send a new key for a new call. Nothing sends this code today; a 409 that names no code is state_conflict.
state_conflict
409. The item changed since you read it, or was already handled, for example a decision someone already answered. Get the item again before deciding.
insufficient_credits
402. There are not enough credits for this work, or this key has reached its monthly spend ceiling: details.reason is key_spend_cap, with cap and used in US dollars and period the UTC month. Add credits in the app, wait for next month, or use a key with a higher ceiling. Only a person raises a key’s ceiling, by minting a key with a higher one in the app. See Calls that cost credits.
invalid_argument
400 or 422. An argument is wrong; the message names it, and allowed_values lists the valid ones when there is a fixed set.
unauthenticated
401. The credential is missing or not valid. Send a valid API key (or, over MCP, an OAuth token).
not_found
404. Nothing was found for that id, URI or path. List the type to find valid ones. Another workspace’s item is also a 404.
rate_limited
429. Too many requests right now. Wait retry_after seconds (the same number is in the Retry-After header), then retry.
A limited response carries the bucket it drew from, refused or not:
The limits are buckets: each holds a burst and refills at a steady rate, and they are counted across all of our servers. If that shared count is briefly unavailable, each server counts on its own with the same limits, and the
RateLimit-* headers are left out until the shared count is back; a 429 still carries Retry-After and retry_after.
A valid key or connection is never counted by address, so one busy key never holds back another, even when both reach us from the same server. Besides its own bucket, it draws from the
start_workspace bucket of the person it belongs to when it calls start_workspace. Only a key or token that fails is counted by address. Opening a shared board link draws from both of its buckets.
Event streams are counted by how many are open, not by how often they are opened: an organisation may hold 100 open at once, across GET /v1/events and GET /v1/sessions/{id}/events together. The 101st is a 429 with Retry-After: 30 and retry_after: 30; a slot frees as soon as one of the open streams closes. Opening a stream also draws one call from the key’s or connection’s bucket, like any other call.
not_wired
501. This isn’t available yet on this workspace’s deployment. Over the REST API its type is not_implemented. Do not retry: it answers the same way until the capability is turned on.
unavailable
503, 502 or 504. A service this request depends on is unavailable right now. Retry in a minute.
When the agents’ work queue is full, a question is refused rather than queued behind it: POST /v1/ask, POST /v1/threads and POST /v1/threads/{id}/messages (the MCP ask tool) answer 503 with Retry-After: 30 and retry_after: 30. Nothing is created and no credits are spent; send the question again after the wait.
internal
500. The fault is ours and has been reported. Retry once. Over the REST API its type is server_error.
Validation errors name the valid values
An error from this API is written to be actionable, not merely correct. Where an enum is wrong, the message lists the accepted values; where a required field is missing, it says what a real value looks like.400 — bad trigger
400 in a terminal wants the same sentence.
What is safe to retry
429 and 5xx other than 501 are the retryable failures. Everything in the 4xx range below 429, and a 501, will fail identically until the request or the deployment changes.
On a 429, wait the retry_after seconds it names. For a 5xx, retry with exponential backoff and jitter. A tight retry loop against a 429 keeps the bucket empty.
A 5xx other than 501 never echoes an internal message. The body says temporary server error, retry, because an internal fault is not something the caller can act on, and the internals of a failure are not theirs to read. The X-Request-Id on the response is what identifies it — quote that in a support request.
Timeouts are not errors
POST /v1/ask and POST /v1/automations/{id}/runs start work that can outlive the request. They answer 200 with status: "running" and a session_id; that is the success case, not a failure.
Wait poll_after_ms, then poll GET /v1/sessions/{id} until status is complete or failed. Re-sending the original POST instead starts a second billed run.
Still stuck? Troubleshooting covers empty results, unexpected zeros and keys that stopped working.