Contents

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" }] }
  }
}
  • code is the error’s code, and category its family.
  • message is the code’s fixed description, in English; it never holds values from the HTTP request.
  • retryable says whether the same HTTP request, with the same idempotency key and body, may be sent again. A new key means a new action.
  • trace_id identifies the HTTP request in Synarun’s logs.
  • details, when present, names the fields concerned (fields) or the place and the rule broken (errors, with path and keyword); 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-authenticate header; with AUTH_DPOP_NONCE_REQUIRED, also the dpop-nonce header.
  • The 429, 500 and 503 answers carry the Retry-After header, with the number of seconds to wait; 409 PRECONDITION_NOT_READY carries retry-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.

CodeHTTPRetryWhat it means
AUTH_MISSING_CREDENTIALS401noNo Authorization header was presented, or, at /v1/token, no DPoP proof.
AUTH_ASSERTION_INVALID401noThe 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_INACTIVE401noThe agent key is retired or revoked: it opens no new session.
AUTH_INVALID_TOKEN401noThe access token is unknown, issued for another audience or presented without its DPoP proof, for example as Bearer.
AUTH_TOKEN_EXPIRED401noThe access token has expired. Ask /v1/token for a new one; the same DPoP key keeps the session.
AUTH_PROOF_INVALID401noThe 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_REPLAYED401noThe DPoP proof or the client assertion carries a jti already seen.
AUTH_DPOP_NONCE_REQUIRED401yesThe 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_EXPIRED401noThe session is past its maximum lifetime or was closed. Open a new session; actions already accepted are unaffected.
AUTH_SESSION_REVOKED401noThe 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_REACHED403noThe 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_SUSPENDED403noThe 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_ALLOWED400noThe body carries a reserved identity field: tenant_id, business_id, agent_id or session_id. Identity comes only from authentication.
IDENTITY_CLAIM_MISMATCH403noA claimed_* field differs from the authenticated identity.
PROTOCOL_UNSUPPORTED_VERSION400noThe schema_version is not supported by this route.
PROTOCOL_MALFORMED_JSON400noThe body is not valid JSON, not valid UTF-8, or starts with a byte order mark.
PROTOCOL_DUPLICATE_KEY400noAn object repeats a member name.
PROTOCOL_NUMBER_OUT_OF_RANGE400noAn integer outside ±(2^53−1), or a number that is not finite.
PROTOCOL_INVALID_STRING400noA string contains an unpaired UTF-16 surrogate.
PROTOCOL_FORBIDDEN_MEMBER_NAME400noThe member name __proto__ is never accepted.
PROTOCOL_MALFORMED_REQUEST400noThe HTTP request cannot be parsed (request line, headers, framing), or it carries a query string, which no route defines.
PROTOCOL_MALFORMED_FORM400noThe token request’s body is not well-formed application/x-www-form-urlencoded, or it repeats a parameter.
PROTOCOL_UNSUPPORTED_MEDIA_TYPE415noThe 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_LARGE413noThe request body is larger than the route’s limit.
PROTOCOL_NESTING_TOO_DEEP400noThe JSON is nested deeper than the protocol allows.
VALIDATION_SCHEMA_FAILED422noThe 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_INVALID422noAn amount is not of the form {amount_minor, currency}: an integer of at least 0 and a supported currency.
VALIDATION_CURRENCY_MISMATCH422noThe 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_ACTIVE422noThe action type exists, but the requested version is not its active definition.
CAPABILITY_UNKNOWN422noThe action type’s identifier or version is not in the catalog.
RESOURCE_NOT_FOUND404noIt 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_READY409yesThe referenced document has no completed assessment for the declared content type yet. Nothing was decided: repeat with the same key and body.
IDEMPOTENCY_KEY_REUSED409noThe idempotency key was already used for a different request. The original stands, and nothing is evaluated again.
IDEMPOTENCY_REQUEST_IN_PROGRESS409yesThe original request with this key is still being processed. Repeat later, with the same key and body.
APPROVAL_NOT_PENDING409noThe state does not allow the act: for example, an access request for the same service is already waiting for an answer.
FORBIDDEN_ROLE403noThe act is not permitted: the action is not covered by a granted access, or the document is not one that is accepted.
RATE_LIMITED429yesToo many requests. Repeat after the interval in the Retry-After header.
INTERNAL_ERROR500yesAn unexpected failure. Repeat with the same idempotency key.
SERVICE_UNAVAILABLE503yesTemporarily unavailable. Repeat after the interval in the Retry-After header.
BUDGET_ACCOUNT_CONTENDED503yesThe 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.