Overview
The Agentic Wallet API uses a combination of HTTP status codes and structured error codes in the response envelope for comprehensive error handling.Error Response Structure
Error Codes
VALIDATION_ERROR
Description: Request validation failed due to invalid parameters, missing fields, or schema violations. HTTP Status Codes: 400, 401, 403, 422 Common Causes:- Invalid UUID format
- Missing required fields
- Out of range values
- Type mismatches
- Invalid API key
- Missing authentication headers
- Insufficient scopes
POLICY_VIOLATION
Description: The operation was denied by the policy engine. HTTP Status Codes: 403, 200 (for async transactions) Common Causes:- Spending limit exceeded
- Destination not in address allowlist
- Destination in address blocklist
- Protocol not in allowlist
- Token mint not allowed
- Program ID not permitted
- Rate limit exceeded
- Outside allowed time window
- Slippage exceeds maximum
- Risk threshold exceeded
PIPELINE_ERROR
Description: Internal processing error during transaction pipeline execution. HTTP Status Codes: 500, 200 (for async transactions) Common Causes:- RPC connection failure
- Transaction simulation failed
- Signing service unavailable
- Protocol adapter error
- Insufficient balance
- Invalid transaction construction
- Network timeout
- Service unavailable
- Check service health endpoints
- Verify wallet balance
- Retry the operation (may be transient)
- Check RPC endpoint status
- Review error details in response
CONFIRMATION_FAILED
Description: Transaction was submitted to the network but confirmation failed or timed out. HTTP Status Codes: 200 (transaction exists but failed) Common Causes:- Confirmation timeout
- Transaction dropped from mempool
- Insufficient SOL for fees
- On-chain program error
- Network congestion
- Blockhash expired
- Compute budget exceeded
- Use retry endpoint:
POST /api/v1/transactions/:txId/retry - Check Solana network status
- Verify transaction on-chain via signature
- Ensure wallet has sufficient SOL for fees
HTTP Status Codes
Retry Strategy
- Do Not Retry
- Safe to Retry
- Transaction Retry
Error Codes:
VALIDATION_ERRORPOLICY_VIOLATION
Validation Error Details
Common field validation errors:UUID Format
550e8400-e29b-41d4-a716-446655440000
Required Fields
Range Validation
Enum Values
Error Handling Best Practices
Log trace IDs for all errors to facilitate debugging
Parse error codes programmatically, not error messages
Implement exponential backoff for retryable errors
Monitor error rates by error code type
Handle async transaction failures by polling status
Example Error Handler
Debugging Failed Requests
-
Check the trace ID:
-
Query audit events:
-
Check service health:
-
Review transaction replay: