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
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | The type of action (e.g., "send_email") |
payload | object | Yes | The action payload to validate |
context | object | No | Additional context for validation |
agent_id | string | No | Identifier 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
| Code | Description |
|---|---|
400 | Bad Request — Invalid parameters |
401 | Unauthorized — Invalid API key |
403 | Forbidden — Insufficient permissions |
404 | Not Found — Resource doesn't exist |
429 | Rate Limited — Too many requests |
500 | Server Error — Something went wrong |