> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vlenseg.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vlenseg.com/_mcp/server.

# Verify CDI liveness and face match

POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI
Content-Type: application/json

Runs the CDI verification step after the CDI phone OTP is validated. The user submits three selfie frames; Vlens checks liveness, matches the selfies against the validated ID already on file, and performs CSO and NTRA re-checks in the background.

Reference: https://docs.vlenseg.com/api-reference/vlens-api/digital-identity-registration/post-digital-identity-register-step-verify-cdi

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: example-openapi
  version: 1.0.0
paths:
  /api/DigitalIdentity/Register/StepVerifyCDI:
    post:
      operationId: post-digital-identity-register-step-verify-cdi
      summary: Verify CDI liveness and face match
      description: >-
        Runs the CDI verification step after the CDI phone OTP is validated. The
        user submits three selfie frames; Vlens checks liveness, matches the
        selfies against the validated ID already on file, and performs CSO and
        NTRA re-checks in the background.
      tags:
        - digitalIdentityRegistration
      parameters:
        - name: ApiKey
          in: header
          description: Static API key issued to your tenant. Required on every request.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            CDI verification result. On success, call `Register/StepCreate` with
            `SkipEmail: true`.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Digital Identity -
                  Registration_postDigitalIdentityRegisterStepVerifyCDI_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phoneNumberOtpRequestId:
                  type: string
                  description: OTP request ID returned from `Register/StepVerifyPhone`.
                scanTransaction:
                  $ref: >-
                    #/components/schemas/ApiDigitalIdentityRegisterStepVerifyCdiPostRequestBodyContentApplicationJsonSchemaScanTransaction
                  description: >-
                    Three base64-encoded selfie frames from the liveness
                    session.
              required:
                - phoneNumberOtpRequestId
                - scanTransaction
servers:
  - url: https://api.vlenseg.com
    description: Production
components:
  schemas:
    ApiDigitalIdentityRegisterStepVerifyCdiPostRequestBodyContentApplicationJsonSchemaScanTransaction:
      type: object
      properties:
        face_1:
          type: string
        face_2:
          type: string
        face_3:
          type: string
      required:
        - face_1
        - face_2
        - face_3
      description: Three base64-encoded selfie frames from the liveness session.
      title: >-
        ApiDigitalIdentityRegisterStepVerifyCdiPostRequestBodyContentApplicationJsonSchemaScanTransaction
    ApiDigitalIdentityRegisterStepVerifyCdiPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        isDigitalIdentityVerified:
          type: boolean
        isVerificationProcessCompleted:
          type: boolean
      title: >-
        ApiDigitalIdentityRegisterStepVerifyCdiPostResponsesContentApplicationJsonSchemaData
    Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_Response_200:
      type: object
      properties:
        data:
          $ref: >-
            #/components/schemas/ApiDigitalIdentityRegisterStepVerifyCdiPostResponsesContentApplicationJsonSchemaData
        error_code:
          type:
            - integer
            - 'null'
        error_message:
          type:
            - string
            - 'null'
      title: >-
        Digital Identity -
        Registration_postDigitalIdentityRegisterStepVerifyCDI_Response_200
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: ApiKey
      description: Static API key issued to your tenant. Required on every request.

```

## Examples



**Request**

```json
{
  "phoneNumberOtpRequestId": "{{reg_phoneNumberOtpRequestId}}",
  "scanTransaction": {
    "face_1": "{{di_face1}}",
    "face_2": "{{di_face2}}",
    "face_3": "{{di_face3}}"
  }
}
```

**Response**

```json
{
  "data": {
    "isDigitalIdentityVerified": true,
    "isVerificationProcessCompleted": true
  },
  "error_code": 1,
  "error_message": "string"
}
```

**SDK Code**

```python Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
import requests

url = "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI"

payload = {
    "phoneNumberOtpRequestId": "{{reg_phoneNumberOtpRequestId}}",
    "scanTransaction": {
        "face_1": "{{di_face1}}",
        "face_2": "{{di_face2}}",
        "face_3": "{{di_face3}}"
    }
}
headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
const url = 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"phoneNumberOtpRequestId":"{{reg_phoneNumberOtpRequestId}}","scanTransaction":{"face_1":"{{di_face1}}","face_2":"{{di_face2}}","face_3":"{{di_face3}}"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI"

	payload := strings.NewReader("{\n  \"phoneNumberOtpRequestId\": \"{{reg_phoneNumberOtpRequestId}}\",\n  \"scanTransaction\": {\n    \"face_1\": \"{{di_face1}}\",\n    \"face_2\": \"{{di_face2}}\",\n    \"face_3\": \"{{di_face3}}\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("ApiKey", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phoneNumberOtpRequestId\": \"{{reg_phoneNumberOtpRequestId}}\",\n  \"scanTransaction\": {\n    \"face_1\": \"{{di_face1}}\",\n    \"face_2\": \"{{di_face2}}\",\n    \"face_3\": \"{{di_face3}}\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phoneNumberOtpRequestId\": \"{{reg_phoneNumberOtpRequestId}}\",\n  \"scanTransaction\": {\n    \"face_1\": \"{{di_face1}}\",\n    \"face_2\": \"{{di_face2}}\",\n    \"face_3\": \"{{di_face3}}\"\n  }\n}")
  .asString();
```

```php Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI', [
  'body' => '{
  "phoneNumberOtpRequestId": "{{reg_phoneNumberOtpRequestId}}",
  "scanTransaction": {
    "face_1": "{{di_face1}}",
    "face_2": "{{di_face2}}",
    "face_3": "{{di_face3}}"
  }
}',
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phoneNumberOtpRequestId\": \"{{reg_phoneNumberOtpRequestId}}\",\n  \"scanTransaction\": {\n    \"face_1\": \"{{di_face1}}\",\n    \"face_2\": \"{{di_face2}}\",\n    \"face_3\": \"{{di_face3}}\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Digital Identity - Registration_postDigitalIdentityRegisterStepVerifyCDI_example
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "phoneNumberOtpRequestId": "{{reg_phoneNumberOtpRequestId}}",
  "scanTransaction": [
    "face_1": "{{di_face1}}",
    "face_2": "{{di_face2}}",
    "face_3": "{{di_face3}}"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyCDI")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```