Reference
Decision API
One synchronous endpoint returns allow or deny, names the rule that decided it, and writes the record before it answers.
Request
POST /api/v1/authorize
{
"client": "northwind", // client slug; optional when the key is client-scoped
"project": "support-ops", // optional
"agent_id": "triage-bot-04", // stable identity of the acting agent
"agent_name": "Support triage",
"action": {
"tool": "refund.create", // the operation the agent wants to perform
"amount_usd": 480, // optional, used by spend rules
"data_classes": ["payment"], // optional, used by data rules
"target": "order/8841" // optional, free-form
},
"context": { "ticket": "T-8841" }, // optional, stored on the record
"risk_score": 0.12, // optional, supplied by your own scorer
"idempotency_key": "T-8841-refund" // optional, replays return the same decision
}| Field | Type | Meaning |
|---|---|---|
| client | string | Client slug. Omit when the token is already scoped to one client. |
| agent_id | string | Stable identity of the acting agent. Required. |
| action.tool | string | The operation being requested. Required. |
| action.amount_usd | number | Monetary amount, used by spend rules. |
| action.data_classes | string[] | Data classes touched, used by data rules. |
| risk_score | number 0-1 | Optional score from your own model, used by risk rules. |
| idempotency_key | string | Replays return the original decision and record. |
| dry_run | boolean | Evaluate and return the decision without writing a record. Nothing is sequenced, anchored or billed. |
Response
| Field | Type | Meaning |
|---|---|---|
| decision | allow | deny | The outcome. Anything else is a failure and must be treated as deny. |
| decision_source | policy | human | timeout_default | Who or what actually decided. |
| matched_rule_id | string | null | The rule that fired. Null when no rule matched. |
| policy_version | integer | The exact version evaluated. Recorded on the record. |
| explanation | string | Plain language reason, safe to show an operator or a client. |
| record.seq / record.hash | integer / string | Position in the client's sequence, and the hash to verify. |
| latency_ms | integer | Server-side evaluation time. |
Denials and polling
A denial is final inside Aprve. No person reviews it and nothing reverses it automatically. If your own system should weigh in, configure the client's exception endpoint and it is asked before the denial is returned.
GET /api/v1/decisions/{decision_id}
GET /api/v1/decisions/dec_7f3a91c4b2
Authorization: Bearer $APRVE_KEY
{
"decision_id": "dec_7f3a91c4b2",
"status": "resolved",
"decision": "deny",
"statement_status": "in_calendar",
"statement_id": "moment-j5xx23u1",
"resolved": { "decision": "deny", "decided_at": "2026-11-23T10:59:12Z" }
}A timeout is recorded as timeout_default, never as a human decision. The distinction matters when someone asks who approved it.
Errors
error responses
401 { "error": "invalid_token" } key unknown, revoked, or expired
403 { "error": "scope_denied" } key cannot act for this client
409 { "error": "idempotency_conflict" } same key, different payload
422 { "error": "invalid_request", "detail": { "action": "required" } }
429 { "error": "rate_limited", "retry_after": 1 }Rate limits apply per token. Write paths are authenticated; the verification endpoint is the only public surface.
