Tutorial: Handling Webhook Events
Tutorial: Handling Webhook Events
Tutorial: Handling Webhook Events
This tutorial covers the webhook events you’ll use in a real integration, what each payload looks like, and how to handle them. By the end, you’ll have a clear map of which events to subscribe to and how to react to each one.
This tutorial assumes you already have a working webhook endpoint that verifies signatures. If not, start with the Receiving Webhooks & Validating Signatures tutorial first.
Most integrations need just three to five events. Here’s what to subscribe to based on your use case:
Every webhook payload follows the same top-level structure:
event — the event type stringidempotency_key — unique delivery ID for deduplication (same key on retries)Session events track the verification lifecycle from creation to final decision. These are the events most integrations are built around.
Fired when a verification session passes — either automatically by the workflow engine or manually by a reviewer.
Always present:
Included on most paths (treat as optional):
The result object, when present, includes:
face_match_passed — whether the selfie matched the document photoage_check_passed — whether the age verification passedextracted_data — PII extracted from the document (present on sandbox and
manual review paths; may be absent on the live engine path)Not all approval paths include identity_id or result. Auto-retry
completions and case API approvals send a minimal payload with only the
guaranteed fields. Always use defensive access (e.g., .get() in Python,
optional chaining in JavaScript) for these fields. If you always need extracted
data, fall back to the
Get Session API.
Typical handler:
Fired when a verification session is rejected — either automatically or by a reviewer.
Always present:
Included on some paths (treat as optional):
Typical handler:
Fired when the workflow engine flags a session for manual review instead of making an automatic decision.
Typical handler:
Fired when a new verification session is created via the API.
Useful for tracking session creation rates and linking sessions to users in your system before verification completes.
Fired when the applicant opens the capture URL and begins the verification flow.
Useful for measuring conversion from session creation to capture start.
Fired when a session’s capture token expires before the applicant completes the flow.
Typical handler:
Fired when a session is auto-rejected because the captured images were too low quality to process.
Fired when session PII and documents are permanently deleted (GDPR erasure or manual redaction).
Fired when session data is automatically purged by your organization’s retention policy.
Check events are fired by standalone screening checks (AML, PEP, sanctions, email risk, phone risk). These are separate from session-based verification.
Fired when a screening check finishes processing, regardless of whether it found matches.
Always present:
Included on most paths (treat as optional):
For PEP checks with hits, additional fields are included:
Fired alongside check.completed when a check finds one or more matches.
Subscribe to this event if you only care about hits and want to skip clears.
Typical handler:
Fired when continuous monitoring discovers new matches on a previously screened individual. This is critical for ongoing AML compliance.
Typical handler:
Fired when a monitoring rescreen completes with no new matches.
Usually no action needed, but useful for audit logs and compliance reporting.
Identity events fire when verified identity records are created or updated.
Fired when a new identity record is created for the first time (typically after a session is approved).
Fired when an existing identity record is updated with data from a subsequent verification session.
The first session for an individual fires identity.created. Any subsequent
sessions that match the same individual fire identity.updated.
Case events track the manual review lifecycle.
All case events share the same payload structure:
When a case is approved or rejected, Verifa also fires the corresponding
session.approved or session.declined event. You don’t need to subscribe to
both unless you want case-specific metadata like case_id.
Document events track standalone document processing (outside of session-based verification).
Fired when a document is compared against another document or an identity record.
Here’s a full example that handles the most common events for a KYC onboarding integration:
Use external_ref as your primary join key. It’s the reference ID you
pass at session creation, so you can map events back to users in your system
without storing Verifa session IDs.
Treat result as optional. Not all approval paths include the result
object. If you need extracted data, fall back to the
Get Session API when result is absent.
Subscribe to check.monitoring.new_hits if you do AML. This is the only
way to get real-time alerts when ongoing monitoring finds new sanctions or PEP
matches after the initial screening.
Don’t subscribe to everything. Use "*" only during development. In
production, subscribe to the specific events you handle. This reduces noise
and makes your handler simpler.
Log every event. Even if you don’t act on an event, log it for debugging and audit trails.