Skip to main content

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
Example:
Response (400):
Resolution: Fix request parameters according to the error message.

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
Example:
Response (200 - transaction created but failed policy):
Resolution: Adjust the request to comply with policies or update policy rules if appropriate.

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
Example:
Response (200):
Resolution:
  • 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
Example: Polling transaction status:
Response (200):
Resolution:
  • 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

Error Codes:
  • VALIDATION_ERROR
  • POLICY_VIOLATION
Reason: These errors indicate client-side issues that won’t be resolved by retrying.Action: Fix the request or policy configuration.

Validation Error Details

Common field validation errors:

UUID Format

Fix: Use valid UUID v4 format: 550e8400-e29b-41d4-a716-446655440000

Required Fields

Fix: Include all required fields in request body.

Range Validation

Fix: Ensure values are within allowed ranges.

Enum Values

Fix: Use exact enum values from documentation.

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

  1. Check the trace ID:
  2. Query audit events:
  3. Check service health:
  4. Review transaction replay: