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 theuser/loginmethod; - the
tokenfield 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
| Parameter | Type | Passed in | Required | Description |
|---|---|---|---|---|
| token | string (UUID) | body | — | Permanent API token, if there is no token header |
| sessionId | string (UUID) | body | ✅ or clientUser | Session whose data should be erased |
| clientUser | string | body | ✅ or sessionId | User ID in your system, from 1 to 36 characters. Data of all their sessions are erased |
| reason | string | body | ❌ | 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.
| result | HTTP | status | Meaning |
|---|---|---|---|
erased | 200 | ok | Data erased |
in_progress | 202 | ok | Erasure has started and is not finished yet. parts shows the current state |
not_found | 404 | error | Session not found |
no_permission | 403 | error | No permission to delete KYC sessions. The response is the same for an existing and a non-existent session |
invalid_request | 400 | error | The 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)
| Part | What it includes |
|---|---|
| text | Document data, contacts, database check answers |
| media | Face and document images, liveness video |
| person | The person record created by the session: photo and name in the faces list |
| questionnaire | Answers of the stage-1 questionnaire the session is linked to |
Part state (state):
| state | Meaning |
|---|---|
erased | Erased |
kept | Kept, the reason is in the reason field |
unconfirmed | Erasure is not confirmed yet, the system keeps trying |
absent | The 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
clientKeyreturns this same finished session. For a new check use a newclientKey. - 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 founderror. - If erasure started while the session was waiting for database checks, the
SESSION_COMPLETEwebhook 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"
}