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
}
FieldTypeMeaning
clientstringClient slug. Omit when the token is already scoped to one client.
agent_idstringStable identity of the acting agent. Required.
action.toolstringThe operation being requested. Required.
action.amount_usdnumberMonetary amount, used by spend rules.
action.data_classesstring[]Data classes touched, used by data rules.
risk_scorenumber 0-1Optional score from your own model, used by risk rules.
idempotency_keystringReplays return the original decision and record.
dry_runbooleanEvaluate and return the decision without writing a record. Nothing is sequenced, anchored or billed.

Response

FieldTypeMeaning
decisionallow | denyThe outcome. Anything else is a failure and must be treated as deny.
decision_sourcepolicy | human | timeout_defaultWho or what actually decided.
matched_rule_idstring | nullThe rule that fired. Null when no rule matched.
policy_versionintegerThe exact version evaluated. Recorded on the record.
explanationstringPlain language reason, safe to show an operator or a client.
record.seq / record.hashinteger / stringPosition in the client's sequence, and the hash to verify.
latency_msintegerServer-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.

A decision you can verify right now
permanent demo decisionALLOW
action
refund.create · $180
rule
Refunds up to 250 USD
record
seq 1
sha-256
078506dc86…8a5948
statement
anchored
receipt
moment-j5xx23u1
dec_demo_permanent

Cite: Aprve decision dec_demo_permanent, seq 1, sha-256 078506dc868d5413af74db8267801c4bf602dea47d0446ef97ca517d5e8a5948