Webhooks and recovery
Webhooks are the expected path for receiving verification completion and the rare later status change. A webhook integration does not need to poll GET /v1/events during normal operation.
Configure destinations
Configure both destinations with PUT /v1/webhook-endpoints, which replaces the complete pair. Set either value to null to disable that stream. The configuration is shared across your verifications. Use GET /v1/webhook-endpoints when you want to read the current configuration; it is not a required setup step.
When you configure a destination, ZeroAge sends a challenge to that endpoint. Your endpoint uses your webhook verification secret to produce the challenge response. A correct response confirms that you control the endpoint. Keep the secret on your backend.
| Destination | Event |
|---|---|
verification_completed_url |
verification.completed: one logical event for each terminal request, including cancelled and expired requests whose result is unsure |
verification_status_changed_url |
verification.status_changed: a later material change to the current assessment |
Delivery can repeat an event or deliver events out of order. A later material change has a new revision; unchanged reassessment does not produce an event.
Receive events
The data field is a full base Verification snapshot at that revision. It excludes the sensitive handoff URL, app capabilities, signatures, proofs, and evidence. See the Quickstart and API reference for complete JSON examples.
- Validate the event schema and require
verification_id == data.idandrevision == data.revisionbefore starting business processing. - Deduplicate durably by event
id. Acknowledge an identical duplicate. If the same ID has conflicting content, stop processing and reconcile; never overwrite the saved event. - Save the event durably before returning HTTP 200, 204, or another 2xx response, then process it asynchronously. Apply the Results and revisions revision rules; reconcile conflicting original decisions without overwriting
original. Commit the state update and job enqueue atomically. Make business effects idempotent. - Resume queued work after a worker restart.
A 2xx response marks the event as received. It does not mean that downstream business processing has completed.
Ownership challenge
ZeroAge sends an HTTPS POST with this JSON shape:
{"challenge":"RANDOM_CHALLENGE","type":"webhook.endpoint_verification"}
Return a 2xx JSON response with exactly one field, response. Its value is the lowercase hexadecimal HMAC-SHA256 of zeroage-webhook-ownership-v1, one LF byte, and the UTF-8 challenge. Use the raw UTF-8 bytes of your webhook verification secret as the HMAC key. Never return or send the secret itself. A failed challenge leaves the complete previous configuration unchanged.
Authenticate delivery
The webhook verification secret is used only for ownership. Obtain the service’s Ed25519 public delivery key, its key ID and your expected customer audience through authenticated onboarding. Require exactly one of each delivery header: ZeroAge-Timestamp, ZeroAge-Customer, ZeroAge-Key-Id, and ZeroAge-Signature.
Match the customer audience and key ID to your provisioned values. Require a decimal Unix timestamp within five minutes of your current UTC time. Decode the signature’s v1= suffix as standard Base64 and verify Ed25519 against the exact bytes below before parsing JSON:
zeroage-webhook-event-v1\n<timestamp>\n<customer>\n<raw JSON body>
Each \n represents one LF byte. Use the exact timestamp and customer header bytes, and the unmodified HTTP body. Reject unknown keys, another customer’s audience, stale timestamps and invalid signatures. Then apply the durable duplicate/revision rules above. Each retry has a fresh timestamp and signature but retains the same event ID and body. A valid signature does not remove the need to deduplicate.
Keep the public delivery key and audience stable in your receiver until an authenticated operator rotation supplies replacements. Public keys are not secrets. The API key and ownership secret stay on your backend.
ZeroAge retries automatically after a timeout or non-2xx response, with increasing delays. Every attempt for one logical event uses the same event ID and payload, so keep the duplicate and ordering safeguards above.
Optional event feed
GET /v1/events is an optional recovery and troubleshooting tool, and an alternative for customers that choose polling instead of webhooks. Webhook users do not need to poll it routinely.
- Call
GET /v1/events; omitafteron the first request. Treat every returned cursor as opaque and keep each customer’s credentials, events, and cursor separate. - If you use the feed, save all events durably before advancing to
next_cursor. Ifhas_moreis true, request the next page immediately. Otherwise retain that cursor for the next poll, including when the page is empty. - Reconcile uncertain state with
GET /v1/verifications/{id}. If local delivery may be stale, read the current Verification before a consequential action. - Apply the same revision and original-decision rules used for webhook delivery.