Documentation Index
Fetch the complete documentation index at: https://docs.layer3x.com/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
https://api.layer3x.com/v1
Authorize endpoint
| Header | Required | Description |
|---|
Content-Type | Yes | application/json |
X-Agent-API-Key | Yes | Your agent’s API key |
X-Layer3-Signature | No | HMAC-SHA256 signature (if enabled) |
Request body
{
"action_key": "payments.release",
"payload": {
"amount": 5000,
"currency": "USD",
"vendor": "Acme Corp",
"description": "Invoice #1042"
}
}
Response
{
"request_id": "uuid",
"decision": "ALLOW | DENY | ESCALATE | REAUTH_REQUIRED",
"reason": "Human-readable reason",
"matched_policy": "Policy name that matched",
"risk_score": 0,
"status": "auto_approved | pending | rejected",
"message": "Action message",
"expires_at": "ISO timestamp"
}
Decision values
| Decision | Signal | Meaning |
|---|
ALLOW | 🟢 GO | Execute — policy validated |
DENY | 🔴 NO-GO | Blocked — do not execute |
ESCALATE | ⚪ ESCALATED | Human approval required |
REAUTH_REQUIRED | 🟡 EXCEPTION | Step-up auth required |
Error codes
| Status | Meaning |
|---|
| 200 | Request processed |
| 400 | Invalid request format |
| 401 | Invalid or missing API key |
| 403 | Agent disabled or revoked |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Code examples
const response = await fetch('https://api.layer3x.com/v1/authorize', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Agent-API-Key': process.env.LAYER3X_API_KEY
},
body: JSON.stringify({
action_key: 'payments.release',
payload: {
amount: 5000,
vendor: 'Acme Corp',
currency: 'USD'
}
})
})
const { decision, reason, request_id } = await response.json()
if (decision === 'ALLOW') {
// proceed with payment execution
} else if (decision === 'ESCALATE') {
// notify human approver, pause execution
} else {
// blocked — log and stop
}