A webhook is a POST request the system sends to your server when something happens to a session or a questionnaire. It tells you the result without constant API polling.
Setup
The webhook address is set in the KYC scenario settings in the personal account, in the «Backend callback URL» field. Each scenario has its own address. If the field is empty, no webhooks are sent for the scenario.
The same settings include:
| Setting | What it does |
|---|---|
| Encrypt POST body with secret key | The body arrives encrypted with the scenario secret key, see “Encryption” |
| Do not send personal data | Recognised and entered data are removed from the body, see “Mode without personal data” |
| Notify only when the session is finalized | SESSION_COMPLETE arrives only when the session is closed, see “SESSION_COMPLETE”. We recommend leaving it off |
| Send test request | Sends a trial request to the given address, see “Test request” |
Test request
The «Send test request» button sends a trial request from your browser, not from the system's server, so it differs from a real webhook:
- your address must accept requests from the personal account page (CORS) and answer with the code 200, otherwise the account shows an error even though real webhooks are delivered;
- the body is a sample of session data without the
eventfield, there are noX-Webhook-IdandX-Webhook-Attemptheaders, and an encrypted body has noscenarioIdfield.
Check real delivery with a test session: its webhooks and your server's responses are shown on the «Callback Logs» tab.
Delivery
- Method
POST, headerContent-Type: application/json, the body is JSON in UTF-8. - Requests are not signed. To make sure a request came from the system, enable encryption: only the scenario secret key decrypts the body.
- The response timeout is 30 seconds. Any 2xx response completes the delivery; the body of your response is ignored.
- A webhook is sent only to the address set in the scenario: redirects (3xx) are not followed. If your address answers with a redirect — for example from
httptohttpsor to another path — set the final address in the scenario.
Delivery headers
Every webhook arrives with the headers:
| Header | Value |
|---|---|
X-Webhook-Id | The delivery identifier. The same in every attempt of one delivery |
X-Webhook-Attempt | The attempt number, starting from 1 |
X-Webhook-Resend-Of | Present only in a webhook resent by hand from the webhook log in the personal account: the X-Webhook-Id of the original delivery |
Retries
If your server did not answer with a 2xx code, the webhook is sent again with a growing pause: the first retry comes after 30 seconds, every next pause is one and a half times longer than the previous one, up to 15 attempts in total within about 4 h 50 min. The Retry-After header of your response is ignored.
| Result of an attempt | What happens next |
|---|---|
| A 2xx response | The delivery is complete |
| A network error, a timeout, a 5xx, 408 or 429 response | A new attempt after the pause |
| Any other response, including 4xx and a 3xx redirect | The delivery ends without retries |
If all attempts are used up, get the current state with an API method (see the events table) or send the webhook again from the personal account — see "Resending from the personal account".
Repeats and the order of events
- The same webhook may arrive more than once. This happens when your server received and processed the webhook but its response did not reach us — for example because of a network failure or because the response took longer than 30 seconds. We cannot know the webhook was received, so we send it again with the same
X-Webhook-Id. - Store the
X-Webhook-Idof processed webhooks. If a webhook with thatX-Webhook-Idhas already been processed, it is enough to confirm the repeated attempt with a 2xx response without processing it again. - Webhooks of one session are delivered in the order they occurred: the next one is sent after the response to the previous one. Webhooks of different sessions do not wait for each other.
- The webhook body is built anew at every attempt. A retry carries the state of the session at the moment it is sent, so its body may differ from the body of the first attempt with the same
X-Webhook-Id. - If a new event of the same type occurs for the same session or questionnaire while the earlier delivery is still not complete, the earlier delivery is no longer retried (its outcome in the webhook log is «Superseded»), and the new event arrives with a new
X-Webhook-Id. Do not count on receiving every intermediate state: decide by the last event you received. - Incomplete deliveries are cancelled (outcome «Cancelled») when the personal data of the session are erased, the session or the questionnaire is deleted, or the webhook address is removed from the scenario. The
PD_ERASURE_COMPLETEevent is not cancelled by the erasure.
Resending from the personal account
If your server did not receive a webhook, you can send it again with the «Resend webhook» button: in the session card, in the questionnaire row on the «Questionnaires» tab and in the row of an undelivered delivery on the «Callback Logs» tab. A resend is a new delivery with a new X-Webhook-Id, so handle the event idempotently and by its content: by sessionId (or questionnaireSessionId) and status.
The body of a resend is built from the current data. The account refuses it if the scenario has no webhook address, the personal data of the session are erased, or the session or questionnaire is not finished yet — then the webhook will go out by itself. If the same delivery is already in progress, a second one is not created.
Webhook log
Every webhook delivery and your server's responses are shown in the personal account: «KYC/AML» section, «Callback Logs» tab. The tab and the resend are available to a user with the «KYC logs» permission. The log keeps deliveries for 35 days.
A delivery row shows the event, the X-Webhook-Id, the address, the number of attempts, the result of the last attempt and the time of the next one; the row expands into the list of attempts. The «Outcome» column:
| Outcome | What it means |
|---|---|
| Pending | The delivery is still in progress: the first or the next attempt is ahead |
| Delivered | Your server answered with a 2xx code |
| Failed | All attempts are used up |
| Rejected | Your server answered with a code that ends the retries: 4xx, except 408 and 429, or a 3xx redirect |
| Superseded | A new event of the same type occurred for the same session or questionnaire; that one is delivered |
| Cancelled | The delivery was cancelled; the reason is in the «Cancel reason» column: «Personal data erased», «Session deleted», «Questionnaire deleted» or «Webhook URL removed» |
A row with the outcome «Failed» or «Rejected» has the «Resend webhook» button. A webhook sent from a log row carries the X-Webhook-Resend-Of header with the X-Webhook-Id of the original delivery.
Events
The event type is in the event field of the request body.
| event | When it arrives | How to get the same through the API |
|---|---|---|
SESSION_COMPLETE | The KYC session result changed | kyc/session/status |
DATABASE_CHECKS_COMPLETE | All database checks of the session finished | kyc/session/databases |
QUESTIONNAIRE_COMPLETE | The user filled in the stage-1 questionnaire | kyc/questionnaire/sessions |
PD_ERASURE_COMPLETE | Erasure of the session personal data finished | kyc/session/erase |
SESSION_COMPLETE
The body is the session data in the same form as the kyc/session/status response, plus the event field.
- By default the event arrives on every change of the session result while the user is going through it. The user's repeated attempts produce new events.
- The
isFinalfield tells whether the result is final:true— the user can do nothing more in the session and its processing is over, including the checks the scenario runs;false— wait for the nextSESSION_COMPLETEor poll kyc/session/status. A status set by hand — by an operator in the account or withkyc/session/status/change— is final at once. - The event can arrive again after a final status: when the session status was changed manually or when a repeated database check changed the result. Handle it idempotently by
sessionId,statusandisFinal: the same state may arrive twice. - If the user did not complete the session within its lifetime,
SESSION_COMPLETEarrives with the statusexpired. - When the user has used up the tries of a step, the session ends with the status
failed, and the code[general] too many triesarrives in theerrorsof the session and of that step. This result is final even ifsecondsToLiveis above 0: after the liveness tries are used up the remaining time of the session is not zeroed, but the session cannot be continued. - With «Notify only when the session is finalized» the event arrives only when the session is finished: the status is
successorsuspicious, the tries of a step are used up, the outcome of the database checks is in (including a failure of a blocking check), or the status was changed manually. An intermediatefailed, after which the user can still retry the step, does not arrive in this mode. We recommend the default mode: pick the final statuses on your side (see Session statuses). - If the scenario has database checks, the final session event arrives after they finish, and no separate
DATABASE_CHECKS_COMPLETEis sent for that session: the results of the checks come inSESSION_COMPLETEitself, in thechecksandchecksStatusfields (completewhen all checks have finished). - While the session has the status
idleorprocessing,checksStatusispending:checkslists the checks of the scenario that have not started or have not finished yet. The checks start only after the steps are passed: in an event with the statusfailedorsuspiciousthe checks that were not started arrive withoutcome: "skipped"andnotPerformedReason: "sessionNotPassed". - If the database checks have not finished within 10 minutes,
SESSION_COMPLETEarrives with the statusprocessing, the fieldchecksStatus: "timeout"andisFinal: false. The outcome of the checks comes later inDATABASE_CHECKS_COMPLETE, followed by one moreSESSION_COMPLETEwith the final status andisFinal: true, even if the status did not change. - Sessions that work this way have the
versionfield equal to8. - The
faceReferencefield (comparison with the reference session) arrives in every mode.
{
"event": "SESSION_COMPLETE",
"sessionId": "00000000-0000-0000-0000-000000000000",
"schemaId": "00000000-0000-0000-0000-000000000000",
"clientKey": "client-0001",
"status": "success",
"isFinal": true,
"secondsToLive": 0,
"results": []
} The full list of fields is on the Session status page. Status values are on the Session statuses page.
DATABASE_CHECKS_COMPLETE
Arrives when all database checks of the session have finished. Not sent for a session whose personal data were erased.
- For sessions with
version: 8it arrives only if the checks did not finish before the finalSESSION_COMPLETE(that one came withchecksStatus: "timeout"), and after a check is started again. In the other cases the results of the checks come inSESSION_COMPLETEitself. - If a check was started again, a new event arrives. Time limits of checks and re-runs — on the page Waits, retries and timeouts of database checks.
- The body has no
clientKeyand nostatus: link the event to the session bysessionId, and take the session status fromSESSION_COMPLETEor kyc/session/status.
{
"event": "DATABASE_CHECKS_COMPLETE",
"sessionId": "00000000-0000-0000-0000-000000000000",
"schemaId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"results": [
{
"checker": "insolvencyStatus",
"spent": 1230,
"outcome": "performed",
"notPerformedReason": null,
"missingInputs": [],
"passed": true
}
],
"responseTime": "2026-01-01T10:00:00.000Z"
} The fields of a check result are described on the kyc/session/databases page. Look at outcome first, then at passed: a skipped check is not "clean".
QUESTIONNAIRE_COMPLETE
Arrives when the user has submitted the stage-1 questionnaire (see Two-stage verification: Questionnaire → KYC). If the questionnaire scenario has database checks, the event arrives after they finish and carries the checks array.
{
"event": "QUESTIONNAIRE_COMPLETE",
"type": "questionnaire",
"questionnaireSessionId": "00000000-0000-0000-0000-000000000000",
"schemaId": "00000000-0000-0000-0000-000000000000",
"clientKey": "client-0001",
"clientUser": "user-0001",
"status": "success",
"createdAt": "2026-01-01T10:00:00.000Z",
"fullName": "John Doe",
"dob": "1990-01-01",
"email": "user@example.com",
"phone": "+70000000000",
"fields": [
{ "key": "city", "title": "City", "value": "Springfield" }
],
"checks": [
{
"checker": "insolvencyStatus",
"status": "success",
"outcome": "performed",
"notPerformedReason": null,
"missingInputs": [],
"result": { "passed": true }
}
]
} status: "success" means the questionnaire answers were recorded. It is not a decision about the user.
PD_ERASURE_COMPLETE
Arrives once, when the erasure of the session personal data is complete: on a kyc/session/erase request or when the session is deleted in the personal account.
{
"event": "PD_ERASURE_COMPLETE",
"sessionId": "00000000-0000-0000-0000-000000000000",
"schemaId": "00000000-0000-0000-0000-000000000000",
"clientKey": "client-0001",
"pdErasedAt": "2026-03-02T10:15:30Z",
"parts": {
"text": { "state": "erased" },
"media": { "state": "erased" },
"person": { "state": "kept", "reason": "linked_session" },
"questionnaire": { "state": "absent" }
},
"responseTime": "2026-03-02T10:15:30Z"
} If the event was lost, call kyc/session/erase again: it answers erased with the same pdErasedAt.
Linked scenarios
If a session was created through linked scenarios, webhooks go to the address of the scenario the session started from and are encrypted with its secret key; in an encrypted webhook scenarioId is the ID of that scenario. The body has selectedSchemaId — the scenario selected by the document, or null.
Mode without personal data
With «Do not send personal data»:
SESSION_COMPLETEcarries no recognised document data (ocrinresultsandhistory) and no questionnaire data: full name, date of birth, email, phone and field values (keyandtitleremain);QUESTIONNAIRE_COMPLETEcarries no entered values; thechecksresults arrive in full.
The full data are available through the API methods.
Encryption
Encryption works when «Encrypt POST body with secret key» is enabled and the scenario has a «Secret key» — the same one that encrypts clientKey.
The body of an encrypted request:
{
"encrypted": "<base64>",
"scenarioId": "<scenario ID>"
} encryptedis the encrypted request body.scenarioIdis a string, not encrypted: the ID of the scenario whose secret key encrypted the body. For session webhooks it is the scenario the session was created with. The field is present in every encrypted webhook.
If you receive webhooks of several scenarios at one address, use scenarioId to pick the right secret key before decrypting.
How to decrypt:
- The key is the first 32 characters of the hexadecimal SHA-256 string of the scenario secret key.
- Decode
encryptedfrom base64. - The first 16 bytes are the initialisation vector (IV), the rest is the ciphertext.
- Decrypt with AES-256-CBC and parse the result as JSON.
Node.js example
const crypto = require('crypto');
function decryptWebhook(body, secretKey) {
const key = crypto.createHash('sha256').update(secretKey).digest('hex').substring(0, 32);
const buf = Buffer.from(body.encrypted, 'base64');
const decipher = crypto.createDecipheriv('aes-256-cbc', key, buf.subarray(0, 16));
const text = Buffer.concat([decipher.update(buf.subarray(16)), decipher.final()]).toString('utf8');
return JSON.parse(text);
}