Webhooks
Receive signed notifications when verification and assurance events occur.
Register an endpoint
POST /v1/webhook-endpoints
Requires the verify:read and rubric:write scopes.
Send exactly one JSON object with exactly one field, url, whose value is a string: { "url": "https://hooks.example.com/acretix" }. A request body over 1048576 bytes is refused with 413; any other body shape is refused with 400.
The URL must use https, be at most 2048 characters, have no user name or password, and must not be a literal private, loopback, or link-local address. Each of these is refused with 400.
On success, this returns 201 with the endpoint and its signing secret. The secret is returned only in the registration response, so store it now: it is not shown again. The secret starts with whsec_.
{
"id": "endpoint_id",
"url": "https://hooks.example.com/acretix",
"created_at": "2026-01-01T00:00:00.000Z",
"secret": "whsec_..."
}An account can have at most 10 active endpoints. When it has reached that limit, registration is refused with 409 until an endpoint is deactivated.
GET /v1/webhook-endpoints
Requires the verify:read scope. On success, this returns 200 with active endpoints for the account.
{
"data": [
{
"id": "endpoint_id",
"url": "https://hooks.example.com/acretix",
"created_at": "2026-01-01T00:00:00.000Z"
}
]
}DELETE /v1/webhook-endpoints/{id}
Requires the verify:read and rubric:write scopes. On success, this deactivates the endpoint and returns 204 with no body. It returns 404 when the ID is not an active endpoint of this account.
Events already queued for the endpoint may still be delivered.
Events and envelope
Acretix sends these event types:
verification.completedverification.flaggedverification.failedassurance.threshold_breachescalation.openedescalation.decidedescalation.undecided
Escalation events contain an escalation object with its ID, project ID, stage, destination, open criteria, timestamps, limit, and status; they go to every registered endpoint.
Webhook payload version: 1. Every envelope contains these keys: version, id, type, api_version, created, data.
Verify the signature
The X-Acretix-Signature header has the form t=<unix>,v1=<hex>. Its v1 value is an HMAC-SHA256 over t, a dot, and the raw body (t.raw body). Pass the raw body exactly as received: do not parse, reserialize, or otherwise transform it before verification.
The default timestamp tolerance is 300 seconds.
Verification can reject a webhook for one of these reasons:
| Code | What it means | What to do |
|---|---|---|
missing_header | The X-Acretix-Signature header is not on the request. | Check that your framework or proxy passes the X-Acretix-Signature header through to your handler. |
malformed_header | The X-Acretix-Signature header is not of the form t=<unix>,v1=<hex>. | Pass the X-Acretix-Signature header value exactly as received. |
timestamp_outside_tolerance | The signed timestamp is more than 300 seconds from your server's time. | Check the receiving server's clock. |
signature_mismatch | The v1 signature does not match the body and your secret. | Pass the raw request body exactly as received, not a parsed and re-serialised body, and check the webhook secret. |
TypeScript
import { AcretixWebhookError, verifyWebhook } from '@acretix-verify/sdk';
export async function handleWebhook(rawBody: string, signatureHeader: string | null, secret: string, now?: number) {
try {
// verifyWebhook(rawBody, signatureHeader, secret, options?)
const event = await verifyWebhook(rawBody, signatureHeader, secret, now === undefined ? undefined : { now });
// Process event only after recording event.id for de-duplication.
return event;
} catch (error) {
if (error instanceof AcretixWebhookError) {
// Reject an invalid webhook.
}
throw error;
}
}Python
from acretix_verify import AcretixWebhookError, verify_webhook
def handle_webhook(raw_body, signature_header, secret, now=None):
try:
event = verify_webhook(raw_body, signature_header, secret, now=now)
# Process event only after recording event.id for de-duplication.
return event
except AcretixWebhookError:
# Reject an invalid webhook.
raiseRetries and duplicate deliveries
Respond with a 2xx status quickly. Each delivery attempt waits at most 5 seconds for your reply.
A delivery is retried after a 5xx reply, a network failure, no reply within 5 seconds, or any other reply that is neither 2xx nor 4xx. A 4xx reply, or an address Acretix refuses to send to, ends the delivery at once and is not retried.
There are at most 5 attempts in all. The waits before each retry are 1 minute, 5 minutes, 30 minutes, 2 hours. Each attempt, the first included, is made at the first delivery run after its wait; delivery runs every 5 minutes.
Delivery is at least once and unordered. A delivery run sends at most 25 deliveries. No endpoint is switched off when delivery failures occur.
To rotate a secret, register a new endpoint, switch your receiver to its secret, then remove the old endpoint.
De-duplicate on the envelope id. It is the same for every delivery of one event about one verification, including retries.
Per-request callback
A callback_url supplied on a verification request replaces the registered endpoints for that verification. When the account has no active endpoint, the request is refused at submission with400 callback_url_needs_webhook_endpoint. The callback_url must use HTTPS, be at most 2,048 characters, and not be a private address. It is signed with the oldest active endpoint's secret.