How webhooks work
You subscribe a URL to a service. When a matching event occurs, Dojah sends an HTTPPOST with a JSON body to that URL. Respond 200 to acknowledge receipt.
Subscribe to a service
Register a callback URL against a service withPOST /api/v1/webhook/subscribe. You can also fetch and delete subscriptions.
cURL
kyc_widget, address, sms, and AML Monitoring, spanning verification, fraud, AML, and messaging events.
Event payload
Events arrive as JSON with the event fields at the top level — unlike REST responses, webhook payloads don’t use theentity wrapper. Always look the event up against your own records using its reference before acting on it.
KYC widget (EasyOnboard) event
Subscribers to thekyc_widget service receive an event when a hosted flow session ends. Its shape follows the flow you built, so expect these three layers:
- Top level — the summary:
reference_id,verification_status, the overallstatus, the ID captured (id_type,value), and links to the selfie, ID images, and signed PDF. data— one key per step the user went through (user_data,government_data,id,selfie,address, and so on), each with its ownstatus,message, anddata.metadata— context about the session, including geo-IP details and anything you passed in when launching the flow.
reference_id, which is the value you supplied when you launched the flow.
Sample kyc_widget event payload
Sample kyc_widget event payload
The file URLs above are truncated and expire. Real payloads carry full pre-signed links that stop working after about an hour — download the files as soon as the event arrives. See File links & expiry.
Verification status values
Theverification_status field describes where the session sits in its lifecycle. Only Completed, Failed, and Abandoned are terminal — the other two mean another event is still coming.
The same values apply across Dojah verifications, not just the widget — see Verification statuses.
Verify events are from Dojah
Before trusting a payload, confirm it came from Dojah using any of these:1
IP allowlisting
Accept webhook calls only from Dojah’s IP:
135.119.89.106.2
Signature with payload and secret key (x-dojah-signature)
HMAC SHA256 of the JSON body, keyed with your secret key. Recompute and compare.
3
Signature with secret key only (x-dojah-signature-v2)
SHA256 hash of your secret key alone. Recompute and compare.
Signature validation with payload and secret key
Events from Dojah carry thex-dojah-signature header. Its value is a HMAC SHA256 signature of the event payload, signed with your secret key. Verify it before processing the event:
Hash the payload exactly as received. Re-serialising the JSON can reorder keys or change spacing, which produces a different signature, so hash the raw request body. Compare the result with a constant-time function (
timingSafeEqual, hmac.compare_digest, hash_equals, hmac.Equal, secure_compare, MessageDigest.isEqual) rather than ==, and reject mismatches with 401.Signature validation with secret key only
Events from Dojah also carry thex-dojah-signature-v2 header. Its value is a SHA256 hash of your secret key — the payload isn’t part of the hash, so this check works even if you can’t access the raw request body. Verify it before processing the event:
File links expire. Any file URLs inside a webhook payload are temporary — see File links & expiry.