Overview
Webhooks allow your application to receive real-time notifications when users complete authentication, signatures, or message actions. UIP sends POST requests to your configured webhook URL with cryptographically signed payloads.Required Setup: You must configure your webhook URL in the Business Dashboard settings before using any UIP API endpoints. All API requests will fail with
request/webhook-missing error if no webhook URL is configured.Setting Up Webhooks
1. Configure Webhook URL
- Log into the Business Dashboard
- Navigate to Settings > Webhooks
- Enter your webhook endpoint URL (must use HTTPS in production)
- Save your configuration
2. Retrieve Webhook Secret
Your webhook secret is used to verify that requests are actually from UIP and haven’t been tampered with.- In the Business Dashboard, go to Settings > Webhooks
- Copy your Webhook Secret (shown after saving your webhook URL)
- Store this secret securely in your application’s environment variables
Verifying Webhook Signatures
Every webhook request includes anX-UIP-Signature header containing an HMAC SHA-256 signature. You must verify this signature to ensure requests are from UIP.
Signature Verification Algorithm
- Get the
X-UIP-Signatureheader from the request - Calculate HMAC SHA-256 hash of the raw request body using your webhook secret
- Compare the calculated signature with the header value
- Reject the request if signatures don’t match
Implementation Examples
Webhook Events
UIP sends different event types depending on which API was used. All webhooks follow the same structure:Event: identify
Sent when a user completes authentication via the Identify API.
uip_id- User’s unique UIP identifieraudit_id- Permanent audit trail reference (save for compliance)session_id- Session ID from your original requestname- User’s full name (if requested)date_of_birth- User’s date of birth in YYYY-MM-DD format (if requested)country_of_origin- User’s country code (if requested)
Event: sign
Sent when a user signs via the Sign API.
uip_id- User’s unique UIP identifiersession_id- Session ID from your original requestaudit_id- Permanent audit trail reference (save for compliance)
Event: message
Sent when a user signs or declines a signature-required message via the Message API.
signing_uip_id- UIP ID of the user who signed or declinedmessage_id- Message ID from your original requestaudit_id- Permanent audit trail reference (save for compliance)
Determining Action: The webhook structure is identical for both signed and declined messages. Query the Audit API using the
audit_id to determine if the user signed or declined.Event: test
Sent when you test your webhook configuration via the Test Webhook endpoint.
When Webhooks Are Sent
Identify API
Identify API
Webhook sent when: User completes biometric authenticationNo webhook sent when: User cancels or session expires (5 minutes)
Sign API
Sign API
Webhook sent when: User signs with biometric verificationNo webhook sent when: User declines or session expires (5 minutes)
Message API
Message API
Webhook sent when: User signs or declines a signature-required message (
signature_required: true)No webhook sent when:- Message does not require signature (
signature_required: false) - User doesn’t respond and message expires
- Message is invalidated before user responds
Test Webhook
Test Webhook
Webhook sent when: You call the Test Webhook endpointPurpose: Verify your webhook configuration before production use
Best Practices
Always Verify Signatures
Validate the X-UIP-Signature header on every request to prevent spoofing and tampering
Return 200 Quickly
Process webhooks asynchronously and return 200 immediately to avoid timeouts
Store Audit IDs
Save audit_id from every webhook for permanent proof, compliance, and legal verification
Handle Idempotency
UIP may send the same webhook multiple times. Use audit_id or session_id to detect duplicates
Use HTTPS
Production webhook URLs must use HTTPS. HTTP is not allowed for security reasons.
Test Before Production
Use the Test Webhook endpoint during development to verify your setup works correctly
Error Handling
If your webhook endpoint returns an error (non-200 status code) or times out, UIP will retry the webhook with exponential backoff. Retry Schedule:- Immediate retry
- Retry after 5 seconds
- Retry after 30 seconds
- Retry after 2 minutes
- Retry after 10 minutes
Webhook Handler Template
Troubleshooting
Webhook unreachable error
Webhook unreachable error
Problem: API requests fail with
request/webhook-unreachable errorCauses:- Webhook URL is not publicly accessible
- Firewall blocking UIP servers
- Webhook handler not returning 200 status code
- HTTPS certificate issues
- Verify webhook URL is publicly accessible
- Check firewall rules allow incoming requests
- Ensure webhook returns 200 status for all events
- Use valid HTTPS certificate
Invalid signature
Invalid signature
Problem: Webhook receives requests but signature validation failsCauses:
- Using wrong webhook secret
- Calculating signature on modified body
- Character encoding issues
- Get webhook secret from Business Dashboard settings
- Calculate signature on raw request body (before parsing)
- Use UTF-8 encoding for all strings
Webhook not configured
Webhook not configured
Problem: API requests fail with
request/webhook-missing errorCauses:- No webhook URL configured in Business Dashboard
- Webhook URL field is empty
- Log into Business Dashboard
- Navigate to Settings > Webhooks
- Add your webhook endpoint URL
Duplicate webhooks
Duplicate webhooks
Problem: Receiving the same webhook multiple timesCauses:
- UIP retries webhooks if your server returns errors or times out
- Network issues causing automatic retries
- Use
audit_idorsession_idto detect duplicates - Make webhook handler idempotent (safe to process multiple times)
- Store processed webhook IDs in database to skip duplicates