Erase session personal data

POST /kyc/session/erase


Description

The method erases the personal data of a KYC session: recognised data, images and video. You can specify one session (sessionId) or all sessions of a user (clientUser).

The session itself and its final status are kept. Every call is written to the log, see kyc/session/erase/log.

The user who owns the token must have the permission to delete KYC sessions.


Request format

  • HTTP method: POST
  • URL: /kyc/session/erase
  • Content type: application/json

Authorization

Pass the token in one of two ways:

  • the token: <jwt-token> header — a temporary JWT token obtained with the user/login method;
  • the token field in the request body — a permanent API token (UUID) from the personal account.

Without a token the request returns 401 access denied. See Authentication for details.


Request parameters

ParameterTypePassed inRequiredDescription
tokenstring (UUID)body—Permanent API token, if there is no token header
sessionIdstring (UUID)body✅ or clientUserSession whose data should be erased
clientUserstringbody✅ or sessionIdUser ID in your system, from 1 to 36 characters. Data of all their sessions are erased
reasonstringbody❌Reason: subject_request, consent_withdrawn, purpose_achieved, unlawful_processing, operator_request. Default operator_request. Written to the log

Pass exactly one of sessionId and clientUser.


Request example (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/kyc/session/erase" -H "token: <jwt-token>" -H "Content-Type: application/json" -d '{"sessionId": "00000000-0000-0000-0000-000000000000", "reason": "subject_request"}'

How to read the response

Rely on the result field, not on the HTTP code or status.

resultHTTPstatusMeaning
erased200okData erased
in_progress202okErasure has started and is not finished yet. parts shows the current state
not_found404errorSession not found
no_permission403errorNo permission to delete KYC sessions. The response is the same for an existing and a non-existent session
invalid_request400errorThe request body does not match the schema, details are in the response

On an internal error the method returns 500 internal error.

The method waits about 20 seconds for completion. If the erasure has not finished by then, in_progress comes: the system completes it on its own, and a repeated call returns the current state. When the erasure finishes, the PD_ERASURE_COMPLETE event is sent to the scenario webhook address (see Webhooks).

Data parts (parts)

PartWhat it includes
textDocument data, contacts, database check answers
mediaFace and document images, liveness video
personThe person record created by the session: photo and name in the faces list
questionnaireAnswers of the stage-1 questionnaire the session is linked to

Part state (state):

stateMeaning
erasedErased
keptKept, the reason is in the reason field
unconfirmedErasure is not confirmed yet, the system keeps trying
absentThe session has no such data

Reasons for keeping (reason): linked_session — the record is needed by another session of the same person; manual_person — the record was added manually; blacklist_person — the record is on the blacklist.


What happens after erasure

  • If the session was active, it is closed.
  • The session remains in the list with its final status.
  • A repeated call with the same clientKey returns this same finished session. For a new check use a new clientKey.
  • Links to the session images return 404.
  • If a stage-2 session is open for a questionnaire whose data were erased, it ends with the [questionnaire] session not found error.
  • If erasure started while the session was waiting for database checks, the SESSION_COMPLETE webhook for it will not come.

This method does not delete a stage-1 questionnaire record. Use the kyc/questionnaire/session/delete method for it.

Do not pass personal data in clientKey and clientUser: use your internal identifiers.


Response examples

Success (200 OK)

{
  "status": "ok",
  "result": "erased",
  "sessionId": "00000000-0000-0000-0000-000000000000",
  "pdErasedAt": "2026-03-02T10:15:30Z",
  "parts": {
    "text": { "state": "erased" },
    "media": { "state": "erased" },
    "person": { "state": "kept", "reason": "linked_session" },
    "questionnaire": { "state": "absent" }
  }
}

Success by clientUser (200 OK)

Sessions go from newest to oldest.

{
  "status": "ok",
  "result": "erased",
  "clientUser": "user-0001",
  "sessions": [
    {
      "sessionId": "00000000-0000-0000-0000-000000000000",
      "result": "erased",
      "pdErasedAt": "2026-03-02T10:15:30Z",
      "parts": {
        "text": { "state": "erased" },
        "media": { "state": "erased" },
        "person": { "state": "erased" },
        "questionnaire": { "state": "absent" }
      }
    }
  ]
}

Erasure in progress (202 Accepted)

{
  "status": "ok",
  "result": "in_progress",
  "sessionId": "00000000-0000-0000-0000-000000000000",
  "parts": {
    "text": { "state": "erased" },
    "media": { "state": "unconfirmed" },
    "person": { "state": "kept", "reason": "linked_session" },
    "questionnaire": { "state": "absent" }
  }
}

Error (404 Not Found)

{
  "status": "error",
  "result": "not_found"
}

Error (403 Forbidden)

{
  "status": "error",
  "result": "no_permission"
}