Overview
Webhooks allow you to receive real-time notifications when a KYC verification status changes. gu1 will automatically send HTTP POST requests to your configured webhook endpoint whenever a validation status updates.Why Use Webhooks?
Real-Time Updates
Get instant notifications when verification status changes
Efficient
No need to poll the API repeatedly
Automated Workflows
Automatically update user accounts based on verification results
Better UX
Notify customers immediately after verification
Webhook Events
gu1 sends webhooks for the following KYC validation events:| Event Type | Description | When Triggered |
|---|---|---|
kyc.validation_created | Validation session created | When you create a new KYC validation |
kyc.validation_in_progress | Customer started verification | Customer begins the verification process |
kyc.validation_approved | Verification approved | Identity successfully verified |
kyc.validation_rejected | Verification rejected | Identity verification failed |
kyc.validation_abandoned | Customer abandoned process | Customer left without completing |
kyc.validation_expired | Validation session expired | Session expired (typically after 7 days) |
Setting Up Webhooks
Step 1: Configure Webhook URL
Configure your webhook URL in the gu1 dashboard:- Go to Settings β Webhooks
- Add a new webhook endpoint (e.g.,
https://yourapp.com/webhooks/kyc) - Subscribe to KYC events (
kyc.*) - Save and activate the webhook
webhookUrl when creating individual validations.
Step 2: Create a Webhook Endpoint
Create an endpoint in your application to receive webhook POST requests:Step 3: Make Your Endpoint Publicly Accessible
Your webhook endpoint must be:- Publicly accessible via HTTPS
- Able to receive POST requests
- Return a 200 status code to acknowledge receipt
For local development, use tools like ngrok to create a public URL that tunnels to your local server.
Webhook Payload Structure
All webhooks follow this standard structure:Common Payload Fields
Unique identifier for this webhook event
The event type (e.g.,
kyc.validation_approved)ISO 8601 timestamp when the event occurred
Event-specific data (see below for each event type)
The KYC validation ID in gu1
The entity (person) ID being verified
Entity information including your
externalId for easy lookupCurrent validation status:
pending, in_progress, approved, rejected, abandoned, expiredEvent-Specific Payloads
kyc.validation_created
Sent when a new KYC validation is created.kyc.validation_in_progress
Sent when a customer starts the verification process.kyc.validation_approved
Sent when verification is successfully completed.verifiedAt: Timestamp when verification was approvedextractedData: Personal information extracted from the documentverifiedFields: Array of fields that were successfully verifiedwarnings: Array of any warnings detected during verificationdecision: Verification results (images/URLs removed for security)
kyc.validation_rejected
Sent when verification fails.kyc.validation_abandoned
Sent when a customer starts but doesnβt complete the verification.kyc.validation_expired
Sent when a validation session expires without completion.Best Practices
Return 200 Quickly
Return 200 Quickly
Always return a 200 status code as quickly as possible to acknowledge receipt. Process the webhook asynchronously if needed.
Handle Idempotency
Handle Idempotency
You might receive the same webhook multiple times. Use the
id field to ensure you process each event only once.Use entity.externalId for Lookup
Use entity.externalId for Lookup
The webhook includes
entity.externalId which is the ID you provided when creating the entity. Use this to look up the customer in your database.Store Validation IDs
Store Validation IDs
Store the
validationId from gu1 in your database. This allows you to query validation details later if needed.Handle Errors Gracefully
Handle Errors Gracefully
If processing fails, log the error but still return 200 to prevent retries. Store failed webhooks for manual review.
Verify Webhook Authenticity (Coming Soon)
Verify Webhook Authenticity (Coming Soon)
Future versions will include webhook signatures. For now, ensure your webhook URL is kept private and uses HTTPS.
Testing Webhooks
Local Development
Use ngrok to expose your local server:Testing Flow
- Create a test KYC validation
- Your webhook endpoint receives
kyc.validation_created - Customer completes verification
- Your webhook endpoint receives
kyc.validation_approvedorkyc.validation_rejected
Troubleshooting
Not Receiving Webhooks
Not Receiving Webhooks
Check these items:
- Webhook URL is publicly accessible via HTTPS
- Firewall allows incoming POST requests
- Endpoint returns 200 status code
- Webhook is configured and active in gu1 dashboard
- Check server logs for incoming requests
Receiving Duplicate Webhooks
Receiving Duplicate Webhooks
This is normal. Implement idempotency checks using the webhook
id field to handle duplicates.Webhook Endpoint Timing Out
Webhook Endpoint Timing Out
Process webhooks asynchronously. Return 200 immediately and handle business logic in background jobs.
Missing extractedData
Missing extractedData
extractedData and verifiedFields are only included in kyc.validation_approved and kyc.validation_rejected events.