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/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..."
}
}// 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.
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..." }
}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.
