Reference

Your endpoint, never a person.

A denial is final inside Aprve. If your own system should weigh in, it does so through your exception endpoint, which you configure and can remove at any time. The calling system either polls the decision or receives a webhook, and both carry the same record hash.

Polling

The read endpoint is public and needs no credential, which means the process that resolves the gate does not have to be the process that asked. Poll on an interval shorter than the gate timeout.

GET /api/v1/records/{decision_id}
GET /api/v1/records/dec_7f3a91c4b2
# public, no auth. Returns the record plus chain and anchor status.

{
  "verified": true,
  "record": {
    "decision_id": "dec_7f3a91c4b2",
    "decision": "allow",
    "decision_source": "policy",
    "policy_version": 7,
    "explanation": "Refund is under the automated ceiling and touches no restricted data class.",
    "hash": "9f2c4d1e..."
  }
}
javascript
// Poll with a deadline. The gate has its own timeout; do not exceed it.
async function awaitDecision(decisionId, { deadlineMs = 900_000, everyMs = 5_000 } = {}) {
  const started = Date.now();
  while (Date.now() - started < deadlineMs) {
    const res = await fetch(`https://aprve-trust.base44.app/api/v1/records/${decisionId}`);
    if (res.ok) {
      const { record } = await res.json();
      if (record.decision_source !== "policy") return record; // exception endpoint or timeout
    }
    await new Promise((r) => setTimeout(r, everyMs));
  }
  return { decision: "deny", reason: "client_deadline_exceeded" };
}

Webhook

Set a webhook URL per client in the console. When a human resolves a gate, Aprve POSTs once with a five second timeout. The payload is deliberately small: the resolution and the record hash.

delivery
POST https://your-app.example/hooks/aprve
content-type: application/json
x-aprve-event: decision.resolved

{
  "event": "decision.resolved",
  "decision_id": "dec_7f3a91c4b2",
  "decision": "allow",
  "decision_source": "human",
  "matched_rule_id": "spend-under-500",
  "record": { "seq": 1843, "hash": "a71b0c9e4f..." }
}
Verify before acting. A webhook can be forged by anyone who learns your endpoint. Resolve the decision id against the public read endpoint and compare the hash before you act on it.

Which one should you use

Poll if your runtime already has a scheduler and you want no inbound surface. Use the webhook if you need the resolution to land in seconds and can verify it. Neither is on the decision path, so a webhook outage never delays an authorization.

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