Recognize documents and selfies from an array of images

POST /kyc/process


Description

The method defines, selects, and recognizes documents and selfies from an array of images. It allows uploading multiple files, performing OCR, and saving results in a session. Access requires a JWT token in the header or request body.


Request format

  • HTTP method: POST
  • URL: /kyc/process
  • Content type: multipart/form-data
  • Authorization: required

Query Parameters

ParameterTypePassed inRequiredDescription
tokenstringHeader, form-data✅*Permanent user token. If a temporary token is not specified in the “token” header, then this parameter is required in the request body
imagesarrayform-dataArray of images (files)
sessionIdstringform-dataBinding to an existing session. A new session will be created if not specified
schemaIdstringform-dataKYC process schema ID
captchastringform-dataCaptcha, if required
modestringform-dataExecution mode: ‘async’ or ‘sync’ (default ‘sync’)
clientKeystringform-dataKey for session search
ocrbooleanform-dataPerform OCR of documents (default true)

* One of the token transfer options is mandatory.


Example Request (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/kyc/process" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -F "images=@/path/to/passport.jpg" 
  -F "images=@/path/to/selfie.jpg" 
  -F "sessionId=00000000-0000-0000-0000-000000000000" 
  -F "schemaId=schema-001" 
  -F "ocr=true" 
  -F "mode=sync"

Example Answers

Success (200 OK)
{
  "sessionId": "00000000-0000-0000-0000-000000000000",
  "clientId": "00000000-0000-0000-0000-000000000000",
  "status": "success",
  "spent": 136.945,
  "results": [
    {
      "spent": 8.779,
      "status": "success",
      "type": "document",
      "docName": "GBR — Passport(2006)",
      "image": "url",
      "imageFull": "url",
      "checks": [
        {
          "caption": "fraud",
          "items": [
            {
              "caption": "isEdited",
              "status": "success"
            }
          ]
        }
      ],
      "ocr": {
        "fields": [
          {
            "conf": "high",
            "title": "Surname",
            "value": "DOE"
          }
        ],
        "status": "success"
      },
      "errors": [
        "[document] text fields not visible"
      ]
    }
  ],
  "createdAt": "2025-05-21T08:15:46.972Z",
  "isClientNew": false
}
## **Success (selfie & doc):**
{
  "sessionId": "10000000-0000-0000-0000-000000000000",
  "clientId": "00000000-0000-0000-0000-000000000000",
  "status": "success",
  "spent": 36.11,
  "results": [
    {
      "status": "success",
      "type": "passport",
      "spent": 4.453,
      "errors": [],
      "docName": "GBR — Passport (2006)",
      "checks": [
        {
          "caption": "fraud",
          "items": [
            {
              "status": "success",
              "caption": "isEdited"
            },
            {
              "status": "success",
              "caption": "isDisplay"
            },
            {
              "status": "success",
              "caption": "isPrinted"
            }
          ]
        }
      ],
      "ocr": {
        "status": "success",
        "fields": [
          {
            "title": "Surname",
            "value": "DOE",
            "conf": "high"
          }
        ]
      },
      "image": "url_to_passport_image",
      "imageFull": "url_to_full_passport_image"
    },
    {
      "status": "success",
      "type": "selfie",
      "spent": 4.664,
      "errors": [],
      "docName": "GBR — Passport (2006)",
      "checks": [
        {
          "caption": "fraud",
          "items": [
            {
              "status": "success",
              "caption": "isEdited"
            }
          ]
        }
      ],
      "faceSelfie": "url_to_selfie_image",
      "faceDoc": "url_to_face_document_image",
      "withDoc": "passport",
      "image": "url_to_selfie_image",
      "imageFull": "url_to_full_selfie_image"
    },
    {
      "status": "success",
      "type": "faces",
      "spent": 0.004,
      "errors": [],
      "checks": [
        {
          "caption": "Face matching",
          "items": [
            {
              "status": "success",
              "caption": "selfie with passport & passport",
              "value": "92%",
              "images": [
                "url_to_selfie_with_passport_image",
                "url_to_passport_image"
              ]
            },
            {
              "status": "success",
              "caption": "selfie & passport",
              "value": "83%",
              "images": [
                "url_to_selfie_image",
                "url_to_passport_image_for_selfie_comparison"
              ]
            }
          ]
        }
      ]
    }
  ],
  "createdAt": "2025-05-21T08:15:46.975Z",
  "isClientNew": false
}
Error (400 Invalid schema / No image attached)
{
  "message": "invalid schema",
  "status": "error"
}
Error (failed)
{
  "sessionId": "00000000-0000-0000-0000-000000000000",
  "clientId": "null",
  "status": "failed",
  "spent": 261.569,
  "results": [
    {
      "status": "failed",
      "type": "document",
      "spent": 0,
      "errors": [
        "[system] exception"
      ],
      "ocr": {
        "status": "idle",
        "fields": []
      }
    }
  ],
  "createdAt": "2025-05-21T08:15:46.980Z",
  "isClientNew": true
}