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
{
"error": {
"code": "SIGNER_UNAVAILABLE",
"message": "The signer is unavailable. The record stands; nothing was signed.",
"retryable": true,
"stage": "co_sign"
}
}error.codestringThe code to branch on. The full list is below.
error.messagestringOne sentence that can be shown to a person.
error.retryablebooleanWhether sending the same request again can succeed.
error.stagestringThe stage that failed:
validation,auth,read,upload,build,wallet,co_sign,simulation,sendorconfirmation.error.fieldErrorsobject: field to array of stringsWith
VALIDATION_ERROR, the problems of each field.error.programErrorobjectWhen a program refused the transaction:
programId,nameand, if the program gave one,number.error.retryAfterSecondsintegerWith
RATE_LIMITED, how long to wait.error.requestIdstringThe id of the request, also sent in the
X-Request-Idresponse header.
Only code, message, retryable and stage are always present.
Codes
| Code | Status | Raised when |
|---|---|---|
VALIDATION_ERROR | 400 | The request body or query does not match the endpoint's schema. fieldErrors names each field. |
TOKEN_REVOKED | 401 | The agent token was revoked. |
UNAUTHORIZED | 401 | No token, an expired session, or a token of the wrong kind for the endpoint. |
ORIGIN_NOT_ALLOWED | 403 | A browser request from an origin the API does not list. |
NOT_FOUND | 404 | No such route, record or agent token. |
CONFIGURATION_REQUIRED | 409 | The API is missing a setting the request needs. |
IDEMPOTENCY_CONFLICT | 409 | The same request is already in progress. |
PROGRAM_UNAVAILABLE | 409 | The API is not ready to build transactions yet. Retryable. |
TRANSACTION_EXPIRED | 409 | The blockhash expired before the transaction landed. |
WALLET_EXISTS | 409 | POST /v1/wallet for an owner who already has an agent wallet. |
WALLET_REQUIRED | 409 | The owner has no agent wallet yet. Create one with POST /v1/wallet. |
PAYLOAD_TOO_LARGE | 413 | The request body is larger than the API accepts. |
UNSUPPORTED_MEDIA_TYPE | 415 | A body that is not application/json. |
CHAIN_REFUSED | 422 | The cluster refused the transaction. programError names the program and its error. |
INSUFFICIENT_FUNDS | 422 | A withdrawal names more than the agent wallet holds. |
SIMULATION_FAILED | 422 | The transaction failed in simulation. programError names the program and its error. |
RATE_LIMITED | 429 | Too many requests. retryAfterSeconds says how long to wait. |
INTERNAL_ERROR | 500 | The API failed. requestId identifies the request. |
UPSTREAM_UNAVAILABLE | 502 | A service the API calls did not answer. |
AGENT_UNAVAILABLE | 503 | The chat agent could not answer. Nothing was signed. |
SIGNER_UNAVAILABLE | 503 | The 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:
{
"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
{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Wait a moment.",
"retryable": true,
"stage": "read",
"retryAfterSeconds": 30
}
}