Quick Start

Register a user and verify their identity in minutes
View as Markdown

This guide walks through the standard registration path: register a user, then verify their identity in a second phase. All steps need only your ApiKey header until verification — then the user token from StepCreate.

Users with hasCDI: true should use Consent-based Digital Identity (CDI) instead — they skip steps 3–5 in this guide.

The ApiKey goes in every request as a header. The user accessToken (returned by StepCreate) is used as Authorization: Bearer <token> for the verification steps.


1. Check phone and email availability

Before registering, confirm the phone number and email are not already in use.

$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/CheckExistenceOfEmailOrPhone \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "phoneNumber": "+201234567890",
> "email": "user@example.com"
> }'

If the phone or email is already in use, the response will indicate it — redirect the user to login instead.


2. Register the user

Registration is three calls: send phone OTP → validate OTP → create account.

$# 2a — Send OTP to phone
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyPhone \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{"phoneNumber": "+201234567890"}'
$
$# 2b — Validate OTP (phoneNumberOtpRequestId from above response)
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyPhone \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "phoneNumber": "+201234567890",
> "phoneNumberOtpRequestId": "SAVED_REQUEST_ID",
> "phoneNumberOtp": "123456"
> }'
$
$# 2c — Create account
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepCreate \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "geoLocation": { "latitude": 30.0444, "longitude": 31.2357 },
> "imei": "DEVICE_ID",
> "password": "USER_PASSWORD",
> "phoneNumberOtpRequestId": "SAVED_REQUEST_ID",
> "skipEmail": "true"
> }'

data.accessToken from StepCreate is the user token — pass it as Authorization: Bearer <token> in steps 3–5.


3 – 5. Verify identity

With the user token, scan the national ID and run liveness detection.

$# 3 — ID front (transaction_id is optional; always returned in the response)
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/verify/id/front \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer USER_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "transaction_id": "YOUR_UUID",
> "image": "BASE64_ID_FRONT"
> }'
$
$# 4 — ID back (use transaction_id returned from step 3)
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/verify/id/back \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer USER_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "transaction_id": "TX_ID",
> "image": "BASE64_ID_BACK"
> }'
$
$# 5 — Liveness (3 face frames, no ID image)
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/verify/liveness/multi \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer USER_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "transaction_id": "TX_ID",
> "face_1": "BASE64_FACE_1",
> "face_2": "BASE64_FACE_2",
> "face_3": "BASE64_FACE_3"
> }'

When data.isDigitalIdentityVerified is true, the user is fully verified and eligible to create contracts.


Next steps