Reference

Errors

The error envelope and every code.

Every failed request answers with the same envelope and an HTTP status that follows from its code.

A denied intent is not an error. POST /v1/intents answers 200 with a record whose decision is deny.

The envelope

503
{
  "error": {
    "code": "SIGNER_UNAVAILABLE",
    "message": "The signer is unavailable. The record stands; nothing was signed.",
    "retryable": true,
    "stage": "co_sign"
  }
}
error.codestring

The code to branch on. The full list is below.

error.messagestring

One sentence that can be shown to a person.

error.retryableboolean

Whether sending the same request again can succeed.

error.stagestring

The stage that failed: validation, auth, read, upload, build, wallet, co_sign, simulation, send or confirmation.

error.fieldErrorsobject: field to array of strings

With VALIDATION_ERROR, the problems of each field.

error.programErrorobject

When a program refused the transaction: programId, name and, if the program gave one, number.

error.retryAfterSecondsinteger

With RATE_LIMITED, how long to wait.

error.requestIdstring

The id of the request, also sent in the X-Request-Id response header.

Only code, message, retryable and stage are always present.

Codes

CodeStatusRaised when
VALIDATION_ERROR400The request body or query does not match the endpoint's schema. fieldErrors names each field.
TOKEN_REVOKED401The agent token was revoked.
UNAUTHORIZED401No token, an expired session, or a token of the wrong kind for the endpoint.
ORIGIN_NOT_ALLOWED403A browser request from an origin the API does not list.
NOT_FOUND404No such route, record or agent token.
CONFIGURATION_REQUIRED409The API is missing a setting the request needs.
IDEMPOTENCY_CONFLICT409The same request is already in progress.
PROGRAM_UNAVAILABLE409The API is not ready to build transactions yet. Retryable.
TRANSACTION_EXPIRED409The blockhash expired before the transaction landed.
WALLET_EXISTS409POST /v1/wallet for an owner who already has an agent wallet.
WALLET_REQUIRED409The owner has no agent wallet yet. Create one with POST /v1/wallet.
PAYLOAD_TOO_LARGE413The request body is larger than the API accepts.
UNSUPPORTED_MEDIA_TYPE415A body that is not application/json.
CHAIN_REFUSED422The cluster refused the transaction. programError names the program and its error.
INSUFFICIENT_FUNDS422A withdrawal names more than the agent wallet holds.
SIMULATION_FAILED422The transaction failed in simulation. programError names the program and its error.
RATE_LIMITED429Too many requests. retryAfterSeconds says how long to wait.
INTERNAL_ERROR500The API failed. requestId identifies the request.
UPSTREAM_UNAVAILABLE502A service the API calls did not answer.
AGENT_UNAVAILABLE503The chat agent could not answer. Nothing was signed.
SIGNER_UNAVAILABLE503The signer did not answer while creating the agent wallet or a withdrawal. Nothing was signed.

A validation error

Saving a policy with one field, and that field malformed:

400
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Check the highlighted fields.",
    "retryable": false,
    "stage": "validation",
    "fieldErrors": {
      "paused": [
        "Invalid input: expected boolean, received undefined"
      ],
      "dailySolLamports": [
        "Must be base units as an integer string."
      ],
      "tokenLimits": [
        "Invalid input: expected record, received undefined"
      ],
      "programAllowlist": [
        "Invalid input: expected array, received undefined"
      ],
      "blockUnlimitedApprovals": [
        "Invalid input: expected boolean, received undefined"
      ]
    }
  }
}

A rate limit

429
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Too many requests. Wait a moment.",
    "retryable": true,
    "stage": "read",
    "retryAfterSeconds": 30
  }
}