API Reference

Complete reference for the Attest REST API.

Base URL

https://api.attest.ai/v1

Authentication

Authenticate using Bearer tokens in the Authorization header:

Authorization: Bearer <your-api-key>

POST /validate

Submit an agent action for validation.

Request Body

ParameterTypeRequiredDescription
actionstringYesThe type of action (e.g., "send_email")
payloadobjectYesThe action payload to validate
contextobjectNoAdditional context for validation
agent_idstringNoIdentifier for the agent

Example Request

curl
curl -X POST https://api.attest.ai/v1/validate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "action": "send_email",
    "payload": {
      "to": "customer@example.com",
      "subject": "Contract Update",
      "body": "..."
    }
  }'

Response

response.json
{
  "id": "val_abc123",
  "status": "approved",
  "approved": true,
  "escalated": false,
  "payload": { ... },
  "confidence": 0.95,
  "policies_evaluated": ["content_safety", "pii_detection"],
  "created_at": "2025-01-15T10:30:00Z"
}

Error Codes

CodeDescription
400Bad Request — Invalid parameters
401Unauthorized — Invalid API key
403Forbidden — Insufficient permissions
404Not Found — Resource doesn't exist
429Rate Limited — Too many requests
500Server Error — Something went wrong