Webhooks

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:

SettingWhat it does
Encrypt POST body with secret keyThe body arrives encrypted with the scenario secret key, see “Encryption”
Do not send personal dataRecognised and entered data are removed from the body, see “Mode without personal data”
Notify only when the session is finalizedSESSION_COMPLETE arrives only when the session is closed, see “SESSION_COMPLETE”. We recommend leaving it off
Send test requestSends 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 event field, there are no X-Webhook-Id and X-Webhook-Attempt headers, and an encrypted body has no scenarioId field.

Check real delivery with a test session: its webhooks and your server's responses are shown on the «Callback Logs» tab.


Delivery

  • Method POST, header Content-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 http to https or to another path — set the final address in the scenario.

Delivery headers

Every webhook arrives with the headers:

HeaderValue
X-Webhook-IdThe delivery identifier. The same in every attempt of one delivery
X-Webhook-AttemptThe attempt number, starting from 1
X-Webhook-Resend-OfPresent 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 attemptWhat happens next
A 2xx responseThe delivery is complete
A network error, a timeout, a 5xx, 408 or 429 responseA new attempt after the pause
Any other response, including 4xx and a 3xx redirectThe 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-Id of processed webhooks. If a webhook with that X-Webhook-Id has 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_COMPLETE event 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:

OutcomeWhat it means
PendingThe delivery is still in progress: the first or the next attempt is ahead
DeliveredYour server answered with a 2xx code
FailedAll attempts are used up
RejectedYour server answered with a code that ends the retries: 4xx, except 408 and 429, or a 3xx redirect
SupersededA new event of the same type occurred for the same session or questionnaire; that one is delivered
CancelledThe 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.

eventWhen it arrivesHow to get the same through the API
SESSION_COMPLETEThe KYC session result changedkyc/session/status
DATABASE_CHECKS_COMPLETEAll database checks of the session finishedkyc/session/databases
QUESTIONNAIRE_COMPLETEThe user filled in the stage-1 questionnairekyc/questionnaire/sessions
PD_ERASURE_COMPLETEErasure of the session personal data finishedkyc/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 isFinal field 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 next SESSION_COMPLETE or poll kyc/session/status. A status set by hand — by an operator in the account or with kyc/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, status and isFinal: the same state may arrive twice.
  • If the user did not complete the session within its lifetime, SESSION_COMPLETE arrives with the status expired.
  • When the user has used up the tries of a step, the session ends with the status failed, and the code [general] too many tries arrives in the errors of the session and of that step. This result is final even if secondsToLive is 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 success or suspicious, 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 intermediate failed, 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_COMPLETE is sent for that session: the results of the checks come in SESSION_COMPLETE itself, in the checks and checksStatus fields (complete when all checks have finished).
  • While the session has the status idle or processing, checksStatus is pending: checks lists 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 status failed or suspicious the checks that were not started arrive with outcome: "skipped" and notPerformedReason: "sessionNotPassed".
  • If the database checks have not finished within 10 minutes, SESSION_COMPLETE arrives with the status processing, the field checksStatus: "timeout" and isFinal: false. The outcome of the checks comes later in DATABASE_CHECKS_COMPLETE, followed by one more SESSION_COMPLETE with the final status and isFinal: true, even if the status did not change.
  • Sessions that work this way have the version field equal to 8.
  • The faceReference field (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: 8 it arrives only if the checks did not finish before the final SESSION_COMPLETE (that one came with checksStatus: "timeout"), and after a check is started again. In the other cases the results of the checks come in SESSION_COMPLETE itself.
  • 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 clientKey and no status: link the event to the session by sessionId, and take the session status from SESSION_COMPLETE or 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_COMPLETE carries no recognised document data (ocr in results and history) and no questionnaire data: full name, date of birth, email, phone and field values (key and title remain);
  • QUESTIONNAIRE_COMPLETE carries no entered values; the checks results 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>"
}
  • encrypted is the encrypted request body.
  • scenarioId is 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:

  1. The key is the first 32 characters of the hexadecimal SHA-256 string of the scenario secret key.
  2. Decode encrypted from base64.
  3. The first 16 bytes are the initialisation vector (IV), the rest is the ciphertext.
  4. 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);
}