For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
HomeAPI Reference
HomeAPI Reference
  • Get started
    • Welcome
    • Quick Start
  • API basics
    • Authentication
    • Conventions
    • Errors
    • Webhooks
  • Products
    • Digital Identity
    • OCR & Computer Vision
    • E-Contracting
    • OAuth Registration
    • Iframe Integration
  • SDKs
    • Flutter SDK
  • Resources
    • Support
  • Changelog
    • Changelog
Dashboard
LogoLogo
On this page
  • Concepts
  • Validation vs. Verification
  • The transaction
  • Prerequisites
  • Step 1 — Scan ID front
  • Step 2 — Scan ID back
  • Step 3 — Liveness detection
  • Alternative: link an existing transaction
  • Backend verification services
  • Admin: retrieve verification images
Products

Digital Identity

Verify users via national ID scanning and liveness detection
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Webhooks

Next

OCR & Computer Vision

Built with

Digital Identity (DI) verification confirms that your users are who they say they are. Vlens performs OCR on the Egyptian national ID (front + back), runs passive liveness detection using three face images, and optionally validates against NTRA and CSO authority databases.


Concepts

Validation vs. Verification

Validated

The user completed all three capture steps and the OCR data passed Vlens internal checks. isVerificationProcessCompleted: true

Verified

Validated plus NTRA and CSO authority checks both passed. isDigitalIdentityVerified: true

Whether NTRA and CSO checks are required depends on your tenant configuration. If both are disabled, a user is marked Verified as soon as all three capture steps pass.

The transaction

All three capture steps share a single transaction_id. The ID is returned in the first step’s response and must be passed to every subsequent step.

You may submit id/front or id/back in any order, but both must complete before liveness.


Prerequisites

The user must be registered before calling the verification endpoints. Registration returns a user access token — use it as Authorization: Bearer <token> for all verification calls.

See the Quick Start for the registration steps.


Step 1 — Scan ID front

cURL
JavaScript
Python
$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 '{
> "image": "BASE64_ID_FRONT_IMAGE",
> "getExtractedData": true
> }'

Save data.idFrontData.transaction_id — you need it for steps 2 and 3.

Fields extracted from the front:

FieldDescription
first_name / last_namesArabic name
first_name_english / last_names_englishTransliterated name
idNumberNational ID number
dateOfBirthISO 8601 date
govern / city / districtAddress
genderM / F

Step 2 — Scan ID back

cURL
JavaScript
Python
$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 '{
> "image": "BASE64_ID_BACK_IMAGE",
> "transaction_id": "TRANSACTION_ID"
> }'

Additional fields from the back:

FieldDescription
maritalStatusMarital status
job / jobTitleOccupation
religionReligion
idExpiryID expiry date
releaseDateID issue date

Step 3 — Liveness detection

All three images must be captured within 0.5 seconds of each other. Identical images or images captured too far apart will fail the liveness check. Compress each image to under 500 KB for best performance.

cURL
JavaScript
Python
$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 '{
> "image": "BASE64_ID_FRONT",
> "face_1": "BASE64_FACE_1",
> "face_2": "BASE64_FACE_2",
> "face_3": "BASE64_FACE_3",
> "transaction_id": "TRANSACTION_ID",
> "getExtractedData": true
> }'

Success response:

1{
2 "data": {
3 "isVerificationProcessCompleted": true,
4 "isDigitalIdentityVerified": true,
5 "user": { "idNumber": "29901234567890" }
6 },
7 "services": {
8 "liveness": true,
9 "spoofing": { "fake": false },
10 "SRC": { "isValid": true },
11 "AML": { "AML_matched": false }
12 },
13 "error_code": null
14}

Alternative: link an existing transaction

If your app captures the national ID before the user logs in (using API-key-only calls), you can link the completed transaction to the user after login instead of repeating the capture flow.

$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/LinkUserWithExistingTransaction \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer USER_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "transactionId": "EXISTING_TRANSACTION_ID",
> "getExtractedData": true
> }'

When to use this: The client performs OCR using only the ApiKey while the user is not yet authenticated. After login, call this endpoint to associate the completed verification with the user’s account — no re-capture needed.


Backend verification services

Each response includes a services object with results from the backend checks:

ServiceFieldWhat it checks
Spoofingservices.spoofing.fakeWhether the document is a photocopy or digital reproduction
Classificationservices.classification.doc_typeDocument type detection
Livenessservices.livenessWhether the face images passed liveness detection
AMLservices.AML.AML_matchedWhether the user is on an AML watchlist
SRCservices.SRC.isValidWhether the ID validates against the national registry

Admin: retrieve verification images

Admins with the Requests permission can retrieve stored identity images for audit or support:

$# Step 1 — Get file names
$curl "https://api.vlenseg.com/api/DigitalIdentity/GetUserDigitalIdentityImages\
>?emailOrPhoneNumber=%2B201234567890" \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer ADMIN_TOKEN"
$
$# Step 2 — Download a specific image as base64
$curl "https://api.vlenseg.com/api/DigitalIdentity/GetStepImage\
>?TransactionId=TX_ID&FileName=FILENAME" \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Authorization: Bearer ADMIN_TOKEN"