Get a list of KYC sessions with filtering

POST /kyc/sessions/filter


Description

The method returns user KYC sessions filtered by parameters such as status, errors, dates, OCR values, clientId, and other criteria. A JWT token is required in the header.


Request Format

  • HTTP method: POST
  • URL: /kyc/sessions/filter
  • Content-Type: application/json
  • Authorization: required

Request Parameters

ParameterTypeLocationRequiredDescription
tokenstringHeaderUser JWT token

Request Body (JSON)

FieldTypeRequiredDescription
tokenstringUser JWT token
pageintegerPage number (for pagination)
pageSizeintegerPage size (for pagination)
filtersobjectFilter object (see example below)

Possible filters in the filters object

  • checks: object, filters by specific check statuses (e.g., "dbFBI": "failed").
  • ocr: array of strings, filters by OCR results.
  • range: object with fields start, end (dates) and sortOrder (ASC/DESC).
  • client: string, client identifier.
  • errors: array of error codes.
  • groupByClientId: boolean, group by clientId.
  • session: string, session identifier.
  • status: string, session status (success, failed, etc.).
  • clientKey: string, client key.
  • schemaId: string, schema identifier.

Request Example (cURL)

«`bash id=»hm2c0n»
curl -X POST «https://api.enface.ai/kyc/sessions/filter» -H «Content-Type: application/json» -H «Authorization: Bearer jwt.temporary.token» -d ‘{
«token»: «jwt.temporary.token»,
«page»: 1,
«pageSize»: 10,
«filters»: {
«checks»: { «dbFBI»: «failed» },
«ocr»: [«John Doe»],
«range»: {
«start»: «2024-07-02T13:29:38.000Z»,
«end»: «2024-07-04T13:29:38.000Z»,
«sortOrder»: «DESC»
},
«client»: «3fa85f64-5717-4562-b3fc-2c963f66afa4»,
«errors»: [
«[general] bad image»,
«[general] too small image»
],
«groupByClientId»: false,
«session»: «3fa85f64-5717-4562-b3fc-2c963f66afa1»,
«status»: «success»,
«clientKey»: «clientKeyABC»,
«schemaId»: «3fa85f64-5717-4562-b3fc-2c963f66afa6»
}
}’


---

#### Response Examples

<details>

<summary>Success (200 OK)</summary>

<div class="spoiler__content">
<p>```json id="5z5x3i"<br>
{<br>
  "status": "ok"<br>
}<br>
```</p>
</div>
</details>

<details>

<summary>Error (400 Bad Request)</summary>

<div class="spoiler__content">
<p>```json id="o3zjlu"<br>
{<br>
  "message": "invalid schema",<br>
  "status": "error"<br>
}<br>
```</p>
</div>
</details>

<details>

<summary>Error (401 Unauthorized)</summary>

<div class="spoiler__content">
<p>```json id="zovfyu"<br>
{<br>
  "message": "access denied",<br>
  "status": "error"<br>
}<br>
```</p>
</div>
</details>

<details>

<summary>Error (404 Not Found)</summary>

<div class="spoiler__content">
<p>```json id="t8jzsw"<br>
{<br>
  "message": "item with this id does not found",<br>
  "status": "error"<br>
}<br>
```</p>
</div>
</details>