Errors
The demo company
The demo company comes with demonstration agents, which use this interface from inside the platform. Connecting your company’s own agents is part of a company deployment, arranged on request: request a quote.
An HTTP request refused before the action is evaluated gets an error, not a decision: nothing was evaluated. An action that was evaluated and blocked is not an error, but a decision with status: "DENIED", described in Outcomes and follow-up.
The error’s shape
Every response outside the 2xx codes has the same shape:
{
"error": {
"code": "VALIDATION_SCHEMA_FAILED",
"category": "VALIDATION",
"message": "The body or parameters do not match the JSON Schema (including unknown properties).",
"retryable": false,
"trace_id": "5b4b259d85cdeb63d677955305621027",
"details": { "errors": [{ "path": "/max_exposure", "keyword": "required" }] }
}
}
codeis the error’s code, andcategoryits family.messageis the code’s fixed description, in English; it never holds values from the HTTP request.retryablesays whether the same HTTP request, with the same idempotency key and body, may be sent again. A new key means a new action.trace_ididentifies the HTTP request in Synarun’s logs.details, when present, names the fields concerned (fields) or the place and the rule broken (errors, withpathandkeyword); for a refused access it also has an explanatory sentence (text). It never holds secrets or identifiers of other companies.
Rules of the answers
- A resource of another agent or another company gets 404
RESOURCE_NOT_FOUND, the same as one that does not exist. - The 401 answers carry the
www-authenticateheader; withAUTH_DPOP_NONCE_REQUIRED, also thedpop-nonceheader. - The 429, 500 and 503 answers carry the
Retry-Afterheader, with the number of seconds to wait; 409PRECONDITION_NOT_READYcarriesretry-after: 2. - A query string, at any route, gets 400
PROTOCOL_MALFORMED_REQUEST.
The codes
The table holds every code an agent can receive. The “Retry” column is the value of retryable.
| Code | HTTP | Retry | What it means |
|---|---|---|---|
AUTH_MISSING_CREDENTIALS | 401 | no | No Authorization header was presented, or, at /v1/token, no DPoP proof. |
AUTH_ASSERTION_INVALID | 401 | no | The client assertion is not valid: its form (a member it may not carry, or a jti that is not a lower-case UUID), an unknown kid, its signature, iss or sub, aud, or its lifetime: over 60 seconds, an exp already past or an iat more than 60 seconds ahead. |
AUTH_CREDENTIAL_INACTIVE | 401 | no | The agent key is retired or revoked: it opens no new session. |
AUTH_INVALID_TOKEN | 401 | no | The access token is unknown, issued for another audience or presented without its DPoP proof, for example as Bearer. |
AUTH_TOKEN_EXPIRED | 401 | no | The access token has expired. Ask /v1/token for a new one; the same DPoP key keeps the session. |
AUTH_PROOF_INVALID | 401 | no | The DPoP proof is not valid: its form (a member it may not carry), typ or alg, its signature, htm or htu, iat, ath, a key other than the token’s, more than one DPoP header, or, at /v1/token, the agent key used as the session key. |
AUTH_PROOF_REPLAYED | 401 | no | The DPoP proof or the client assertion carries a jti already seen. |
AUTH_DPOP_NONCE_REQUIRED | 401 | yes | The server’s nonce is required, or the one sent is no longer valid. Repeat the request with the value of the response’s dpop-nonce header. |
AUTH_SESSION_EXPIRED | 401 | no | The session is past its maximum lifetime or was closed. Open a new session; actions already accepted are unaffected. |
AUTH_SESSION_REVOKED | 401 | no | The session was revoked for cause, directly, through its key or because the agent was suspended. What of its work has not left yet is stopped. |
AUTH_SESSION_LIMIT_REACHED | 403 | no | The agent key already holds the maximum number of active sessions. Use the DPoP key of an existing session, or wait until one ends. |
AUTH_AGENT_SUSPENDED | 403 | no | The agent is suspended or decommissioned. A suspension also revokes its sessions, so a request with a token gets AUTH_SESSION_REVOKED first, and this code comes at the next token request. |
IDENTITY_FIELD_NOT_ALLOWED | 400 | no | The body carries a reserved identity field: tenant_id, business_id, agent_id or session_id. Identity comes only from authentication. |
IDENTITY_CLAIM_MISMATCH | 403 | no | A claimed_* field differs from the authenticated identity. |
PROTOCOL_UNSUPPORTED_VERSION | 400 | no | The schema_version is not supported by this route. |
PROTOCOL_MALFORMED_JSON | 400 | no | The body is not valid JSON, not valid UTF-8, or starts with a byte order mark. |
PROTOCOL_DUPLICATE_KEY | 400 | no | An object repeats a member name. |
PROTOCOL_NUMBER_OUT_OF_RANGE | 400 | no | An integer outside ±(2^53−1), or a number that is not finite. |
PROTOCOL_INVALID_STRING | 400 | no | A string contains an unpaired UTF-16 surrogate. |
PROTOCOL_FORBIDDEN_MEMBER_NAME | 400 | no | The member name __proto__ is never accepted. |
PROTOCOL_MALFORMED_REQUEST | 400 | no | The HTTP request cannot be parsed (request line, headers, framing), or it carries a query string, which no route defines. |
PROTOCOL_MALFORMED_FORM | 400 | no | The token request’s body is not well-formed application/x-www-form-urlencoded, or it repeats a parameter. |
PROTOCOL_UNSUPPORTED_MEDIA_TYPE | 415 | no | The Content-Type header is not the one the route accepts: application/json, in UTF-8, and at /v1/token, application/x-www-form-urlencoded; at /v1/session/close, which takes no body, none. |
PROTOCOL_PAYLOAD_TOO_LARGE | 413 | no | The request body is larger than the route’s limit. |
PROTOCOL_NESTING_TOO_DEEP | 400 | no | The JSON is nested deeper than the protocol allows. |
VALIDATION_SCHEMA_FAILED | 422 | no | The body or the parameters do not match the JSON Schema, unknown properties included; the parameters are checked against the action type’s definition. A max_exposure missing where it is required, present where it is refused, or below the parameters’ amount gets this code too. |
VALIDATION_MONEY_INVALID | 422 | no | An amount is not of the form {amount_minor, currency}: an integer of at least 0 and a supported currency. |
VALIDATION_CURRENCY_MISMATCH | 422 | no | The currency of max_exposure differs from the currency of the parameters’ amount or from the budget account’s, and no exchange rule applies. |
CAPABILITY_VERSION_NOT_ACTIVE | 422 | no | The action type exists, but the requested version is not its active definition. |
CAPABILITY_UNKNOWN | 422 | no | The action type’s identifier or version is not in the catalog. |
RESOURCE_NOT_FOUND | 404 | no | It does not exist or is not visible to you. Another company’s resource gets the same answer, and the attempt is recorded in the audit trail. |
PRECONDITION_NOT_READY | 409 | yes | The referenced document has no completed assessment for the declared content type yet. Nothing was decided: repeat with the same key and body. |
IDEMPOTENCY_KEY_REUSED | 409 | no | The idempotency key was already used for a different request. The original stands, and nothing is evaluated again. |
IDEMPOTENCY_REQUEST_IN_PROGRESS | 409 | yes | The original request with this key is still being processed. Repeat later, with the same key and body. |
APPROVAL_NOT_PENDING | 409 | no | The state does not allow the act: for example, an access request for the same service is already waiting for an answer. |
FORBIDDEN_ROLE | 403 | no | The act is not permitted: the action is not covered by a granted access, or the document is not one that is accepted. |
RATE_LIMITED | 429 | yes | Too many requests. Repeat after the interval in the Retry-After header. |
INTERNAL_ERROR | 500 | yes | An unexpected failure. Repeat with the same idempotency key. |
SERVICE_UNAVAILABLE | 503 | yes | Temporarily unavailable. Repeat after the interval in the Retry-After header. |
BUDGET_ACCOUNT_CONTENDED | 503 | yes | The budget account could not be locked in time. This is not an insufficient budget: nothing was reserved or decided. Repeat with the same idempotency key. |
The other error codes concern the people who use the console, not the agents.