Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aegisintent.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Error Response Format

All Aegis errors follow a consistent JSON structure:
{
  "success": false,
  "error": "Human readable error message",
  "code": "MACHINE_READABLE_ERROR_CODE"
}

HTTP Status Codes

StatusMeaningWhen It Happens
400Bad RequestInvalid request body, missing required fields, malformed data
401UnauthorizedInvalid/expired token, missing auth headers, email mismatch
403ForbiddenPolicy violation: spending limit exceeded
404Not FoundEndpoint doesn’t exist
409ConflictWallet not provisioned, nonce mismatch
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server-side failure
502Bad GatewayCircle API or external service unreachable
503Service UnavailableEmail delivery not configured, dependency down

Common Error Codes

Authentication Errors

CodeDescription
UNAUTHORIZEDToken is invalid, expired, revoked, or missing. Also returned when X-Aegis-Email doesn’t match the token owner

Policy Errors

CodeDescription
POLICY_VIOLATIONAction exceeds per transaction, daily, weekly, or monthly limit

Wallet Errors

CodeDescription
WALLET_NOT_PROVISIONEDAgent exists but wallet has not been created yet

Connect Errors

CodeDescription
INVALID_CHALLENGEChallenge ID doesn’t match or doesn’t exist
CHALLENGE_USEDChallenge has already been consumed
CHALLENGE_EXPIREDChallenge has passed its 10 minute expiry window
INVALID_OTPThe OTP code is incorrect
TOO_MANY_ATTEMPTS5+ failed OTP attempts on this challenge
EMAIL_NOT_CONFIGUREDServer email delivery is not set up

Validation Errors

CodeDescription
INVALID_AMOUNTAmount is not a valid positive number
INVALID_ADDRESSEVM address is not valid (must be 0x + 40 hex chars)

Wealth Engine Errors

CodeDescription
INVALID_YIELD_WEIGHTSaegisWeight and synthraWeight do not add up to 100 or contain negative values
YIELD_RISK_CAP_EXCEEDEDsynthraWeight exceeds the maximum external protocol allocation of 80%

Handling Errors in Your Agent

When building an AI agent integration, handle errors gracefully:
const response = await fetch(
  "https://api.aegisintent.xyz/v1/actions/transfer",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${token}`,
      "X-Aegis-Email": email,
      "Content-Type": "application/json",
      "Idempotency-Key": crypto.randomUUID(),
      "X-Aegis-Nonce": String(currentNonce),
    },
    body: JSON.stringify({ destination, amount }),
  },
);

const data = await response.json();

if (!data.success) {
  switch (data.code) {
    case "POLICY_VIOLATION":
      // Reduce amount or wait for daily limit to reset
      break;
    case "WALLET_NOT_PROVISIONED":
      // Agent needs to complete onboarding first
      break;
    case "UNAUTHORIZED":
      // Token expired — re-authenticate via /connect/start
      break;
    default:
      // Log and retry with backoff
      break;
  }
}
For transient errors (429, 500, 502), implement exponential backoff with a maximum of 3 retries. For permanent errors (400, 401, 403), do not retry — fix the request.