Didit ID Verification API
Overview
Verifies identity documents by submitting images of the front and back sides. Performs OCR extraction, MRZ parsing, authenticity checks, and document liveness detection.
Key constraints:
- Supported formats: JPEG, PNG, WebP, TIFF
- Maximum file size: 5MB per image
- All document corners must be visible, full-color, no glare/shadows
- Original real-time photos only (no screenshots, scans, or digital copies)
Coverage: 4,000+ document types, 220+ countries, 130+ languages. Supports passports, national ID cards, driver's licenses, and residence permits.
Processing pipeline:
- Intelligent capture & document type detection
- OCR text extraction + MRZ/barcode parsing
- Template matching, security feature validation, tamper detection
- Document liveness (detects screen captures, printed copies, portrait manipulation)
API Reference: https://docs.didit.me/reference/id-verification-standalone-api
Authentication
All requests require x-api-key header. Get your key from Didit Business Console → API & Webhooks.
Endpoint
POST https://verification.didit.me/v3/id-verification/
Headers
| Header |
Value |
Required |
x-api-key |
Your API key |
Yes |
Content-Type |
multipart/form-data |
Yes |
Request Parameters (multipart/form-data)
| Parameter |
Type |
Required |
Default |
Constraints |
Description |
front_image |
file |
Yes |
— |
JPEG/PNG/WebP/TIFF, max 5MB |
Front image of ID document |
back_image |
file |
No |
— |
Same as above |
Back image (when applicable) |
save_api_request |
boolean |
No |
true |
— |
Save in Business Console Manual Checks |
vendor_data |
string |
No |
— |
— |
Your identifier for session tracking |
Example
import requests
response = requests.post(
"https://verification.didit.me/v3/id-verification/",
headers={"x-api-key": "YOUR_API_KEY"},
files={
"front_image": ("front.jpg", open("front.jpg", "rb"), "image/jpeg"),
"back_image": ("back.jpg", open("back.jpg", "rb"), "image/jpeg"),
},
data={"vendor_data": "user-123"},
)
const formData = new FormData();
formData.append("front_image", frontImageFile);
formData.append("back_image", backImageFile);
formData.append("vendor_data", "user-123");
const response = await fetch("https://verification.didit.me/v3/id-verification/", {
method: "POST",
headers: { "x-api-key": "YOUR_API_KEY" },
body: formData,
});
Response (200 OK)
{
"request_id": "a1b2c3d4-...",
"id_verification": {
"status": "Approved",
"document_type": "Identity Card",
"document_number": "YZA123456",
"personal_number": "X9876543L",
"first_name": "Elena",
"last_name": "Martínez Sánchez",
"full_name": "Elena Martínez Sánchez",
"date_of_birth": "1985-03-15",
"age": 40,
"gender": "F",
"nationality": "ESP",
"issuing_state": "ESP",
"issuing_state_name": "Spain",
"expiration_date": "2030-08-21",
"date_of_issue": "2020-08-21",
"address": "Calle Mayor 10, Madrid",
"formatted_address": "Calle Mayor 10, 28013 Madrid, Spain",
"place_of_birth": "Valencia",
"portrait_image": "<base64>",
"front_document_image": "<base64>",
"back_document_image": "<base64>",
"mrz": {
"surname": "MARTINEZ SANCHEZ",
"given_name": "ELENA",
"document_type": "I",
"document_number": "YZA123456",
"country": "ESP",
"nationality": "ESP",
"birth_date": "850315",
"expiry_date": "300821",
"sex": "F"
},
"parsed_address": {"city": "Madrid", "region": "...", "postal_code": "28013", "country": "ES"},
"warnings": []
},
"created_at": "2025-05-01T13:11:07.977806Z"
}
Status Values
| Status |
Meaning |
"Approved" |
Document verified successfully |
"Declined" |
Verification failed (see warnings) |
"In Review" |
Requires manual review |
Error Responses
| Code |
Meaning |
Action |
400 |
Invalid request |
Check file format, size, parameters |
401 |
Invalid API key |
Verify x-api-key header |
403 |
Insufficient credits |
Top up at business.didit.me |
Response Field Reference
| Field |
Type |
Description |
status |
string |
"Approved", "Declined", "In Review" |
document_type |
string |
"Passport", "Identity Card", "Driver's License", "Residence Permit" |
document_number |
string |
Document ID number |
personal_number |
string |
Personal/national ID number |
first_name, last_name, full_name |
string |
Extracted name fields |
date_of_birth |
string |
YYYY-MM-DD |
age |
integer |
Calculated age |
gender |
string |
"M", "F", "U" |
nationality, issuing_state |
string |
ISO 3166-1 alpha-3 |
expiration_date, date_of_issue |
string |
YYYY-MM-DD |
portrait_image |
string |
Base64-encoded portrait from document |
mrz |
object |
Machine Readable Zone data |
parsed_address |
object |
Geocoded address: {city, region, postal_code, country, street_1} |
warnings |
array |
{risk, log_type, short_description, long_description} |
Warning Tags
Auto-Decline (always)
| Tag |
Description |
ID_DOCUMENT_IN_BLOCKLIST |
Document in blocklist (previously flagged) |
PORTRAIT_IMAGE_NOT_DETECTED |
No portrait found on document |
DOCUMENT_EXPIRED |
Document expiration date has passed |
DOCUMENT_NOT_SUPPORTED_FOR_APPLICATION |
Document type not accepted |
Configurable (Decline / Review / Approve)
| Category |
Tags |
| Document liveness |
SCREEN_CAPTURE_DETECTED, PRINTED_COPY_DETECTED, PORTRAIT_MANIPULATION_DETECTED |
| MRZ issues |
MRZ_NOT_DETECTED, MRZ_VALIDATION_FAILED, MRZ_AND_DATA_EXTRACTED_FROM_OCR_NOT_SAME |
| Data issues |
NAME_NOT_DETECTED, DATE_OF_BIRTH_NOT_DETECTED, DOCUMENT_NUMBER_NOT_DETECTED, DATA_INCONSISTENT |
| Duplicates |
POSSIBLE_DUPLICATED_USER |
| Expected mismatch |
FULL_NAME_MISMATCH_WITH_PROVIDED, DOB_MISMATCH_WITH_PROVIDED, GENDER_MISMATCH_WITH_PROVIDED |
| Geolocation |
DOCUMENT_COUNTRY_MISMATCH |
Common Workflows
Basic ID Verification
1. POST /v3/id-verification/ → front_image (+ back_image if applicable)
2. If "Approved" → extract first_name, last_name, date_of_birth, document_number
If "Declined" → check warnings:
DOCUMENT_EXPIRED → ask for valid document
SCREEN_CAPTURE_DETECTED → ask for real photo of physical document
MRZ_VALIDATION_FAILED → ask for clearer image
Full Identity Verification Pipeline
1. POST /v3/id-verification/ → verify document
2. POST /v3/passive-liveness/ → verify real person
3. POST /v3/face-match/ → compare selfie to document portrait
4. POST /v3/aml/ → screen extracted name/DOB/nationality
5. All Approved → fully verified identity
Utility Scripts
export DIDIT_API_KEY="your_api_key"
python scripts/verify_id.py front.jpg
python scripts/verify_id.py front.jpg back.jpg --vendor-data user-123
1---2name: didit-id-verification3description: Integrate Didit ID Verification standalone API to verify identity documents. Use when the user wants to verify an ID, passport, driver's license, residence permit, or identity document using Didit, or mentions ID verification, document verification, OCR extraction, MRZ parsing, KYC document checks, or document authenticity validation. Supports 4000+ document types across 220+ countries.4---5
6# Didit ID Verification API
7
8## Overview
9
10Verifies identity documents by submitting images of the front and back sides. Performs OCR extraction, MRZ parsing, authenticity checks, and document liveness detection.
11
12**Key constraints:**
13- Supported formats: **JPEG, PNG, WebP, TIFF**
14- Maximum file size: **5MB** per image
15- All document corners must be visible, full-color, no glare/shadows
16- Original real-time photos only (no screenshots, scans, or digital copies)
17
18**Coverage:** 4,000+ document types, 220+ countries, 130+ languages. Supports passports, national ID cards, driver's licenses, and residence permits.
19
20**Processing pipeline:**
211. Intelligent capture & document type detection
222. OCR text extraction + MRZ/barcode parsing
233. Template matching, security feature validation, tamper detection
244. Document liveness (detects screen captures, printed copies, portrait manipulation)
25
26**API Reference:** https://docs.didit.me/reference/id-verification-standalone-api
27
28---
29
30## Authentication
31
32All requests require `x-api-key` header. Get your key from [Didit Business Console](https://business.didit.me) → API & Webhooks.
33
34---
35
36## Endpoint
37
38```
39POST https://verification.didit.me/v3/id-verification/
40```
41
42### Headers
43
44| Header | Value | Required |
45|---|---|---|
46| `x-api-key` | Your API key | **Yes** |
47| `Content-Type` | `multipart/form-data` | **Yes** |
48
49### Request Parameters (multipart/form-data)
50
51| Parameter | Type | Required | Default | Constraints | Description |
52|---|---|---|---|---|---|
53| `front_image` | file | **Yes** | — | JPEG/PNG/WebP/TIFF, max 5MB | Front image of ID document |
54| `back_image` | file | No | — | Same as above | Back image (when applicable) |
55| `save_api_request` | boolean | No | `true` | — | Save in Business Console Manual Checks |
56| `vendor_data` | string | No | — | — | Your identifier for session tracking |
57
58### Example
59
60```python
61import requests
62
63response = requests.post(
64 "https://verification.didit.me/v3/id-verification/",
65 headers={"x-api-key": "YOUR_API_KEY"},
66 files={
67 "front_image": ("front.jpg", open("front.jpg", "rb"), "image/jpeg"),
68 "back_image": ("back.jpg", open("back.jpg", "rb"), "image/jpeg"),
69 },
70 data={"vendor_data": "user-123"},
71)
72```
73
74```typescript
75const formData = new FormData();
76formData.append("front_image", frontImageFile);
77formData.append("back_image", backImageFile);
78formData.append("vendor_data", "user-123");
79
80const response = await fetch("https://verification.didit.me/v3/id-verification/", {
81 method: "POST",
82 headers: { "x-api-key": "YOUR_API_KEY" },
83 body: formData,
84});
85```
86
87### Response (200 OK)
88
89```json
90{
91 "request_id": "a1b2c3d4-...",
92 "id_verification": {
93 "status": "Approved",
94 "document_type": "Identity Card",
95 "document_number": "YZA123456",
96 "personal_number": "X9876543L",
97 "first_name": "Elena",
98 "last_name": "Martínez Sánchez",
99 "full_name": "Elena Martínez Sánchez",
100 "date_of_birth": "1985-03-15",
101 "age": 40,
102 "gender": "F",
103 "nationality": "ESP",
104 "issuing_state": "ESP",
105 "issuing_state_name": "Spain",
106 "expiration_date": "2030-08-21",
107 "date_of_issue": "2020-08-21",
108 "address": "Calle Mayor 10, Madrid",
109 "formatted_address": "Calle Mayor 10, 28013 Madrid, Spain",
110 "place_of_birth": "Valencia",
111 "portrait_image": "<base64>",
112 "front_document_image": "<base64>",
113 "back_document_image": "<base64>",
114 "mrz": {
115 "surname": "MARTINEZ SANCHEZ",
116 "given_name": "ELENA",
117 "document_type": "I",
118 "document_number": "YZA123456",
119 "country": "ESP",
120 "nationality": "ESP",
121 "birth_date": "850315",
122 "expiry_date": "300821",
123 "sex": "F"
124 },
125 "parsed_address": {"city": "Madrid", "region": "...", "postal_code": "28013", "country": "ES"},
126 "warnings": []
127 },
128 "created_at": "2025-05-01T13:11:07.977806Z"
129}
130```
131
132### Status Values
133
134| Status | Meaning |
135|---|---|
136| `"Approved"` | Document verified successfully |
137| `"Declined"` | Verification failed (see `warnings`) |
138| `"In Review"` | Requires manual review |
139
140### Error Responses
141
142| Code | Meaning | Action |
143|---|---|---|
144| `400` | Invalid request | Check file format, size, parameters |
145| `401` | Invalid API key | Verify `x-api-key` header |
146| `403` | Insufficient credits | Top up at business.didit.me |
147
148---
149
150## Response Field Reference
151
152| Field | Type | Description |
153|---|---|---|
154| `status` | string | `"Approved"`, `"Declined"`, `"In Review"` |
155| `document_type` | string | `"Passport"`, `"Identity Card"`, `"Driver's License"`, `"Residence Permit"` |
156| `document_number` | string | Document ID number |
157| `personal_number` | string | Personal/national ID number |
158| `first_name`, `last_name`, `full_name` | string | Extracted name fields |
159| `date_of_birth` | string | `YYYY-MM-DD` |
160| `age` | integer | Calculated age |
161| `gender` | string | `"M"`, `"F"`, `"U"` |
162| `nationality`, `issuing_state` | string | ISO 3166-1 alpha-3 |
163| `expiration_date`, `date_of_issue` | string | `YYYY-MM-DD` |
164| `portrait_image` | string | Base64-encoded portrait from document |
165| `mrz` | object | Machine Readable Zone data |
166| `parsed_address` | object | Geocoded address: `{city, region, postal_code, country, street_1}` |
167| `warnings` | array | `{risk, log_type, short_description, long_description}` |
168
169---
170
171## Warning Tags
172
173### Auto-Decline (always)
174
175| Tag | Description |
176|---|---|
177| `ID_DOCUMENT_IN_BLOCKLIST` | Document in blocklist (previously flagged) |
178| `PORTRAIT_IMAGE_NOT_DETECTED` | No portrait found on document |
179| `DOCUMENT_EXPIRED` | Document expiration date has passed |
180| `DOCUMENT_NOT_SUPPORTED_FOR_APPLICATION` | Document type not accepted |
181
182### Configurable (Decline / Review / Approve)
183
184| Category | Tags |
185|---|---|
186| **Document liveness** | `SCREEN_CAPTURE_DETECTED`, `PRINTED_COPY_DETECTED`, `PORTRAIT_MANIPULATION_DETECTED` |
187| **MRZ issues** | `MRZ_NOT_DETECTED`, `MRZ_VALIDATION_FAILED`, `MRZ_AND_DATA_EXTRACTED_FROM_OCR_NOT_SAME` |
188| **Data issues** | `NAME_NOT_DETECTED`, `DATE_OF_BIRTH_NOT_DETECTED`, `DOCUMENT_NUMBER_NOT_DETECTED`, `DATA_INCONSISTENT` |
189| **Duplicates** | `POSSIBLE_DUPLICATED_USER` |
190| **Expected mismatch** | `FULL_NAME_MISMATCH_WITH_PROVIDED`, `DOB_MISMATCH_WITH_PROVIDED`, `GENDER_MISMATCH_WITH_PROVIDED` |
191| **Geolocation** | `DOCUMENT_COUNTRY_MISMATCH` |
192
193---
194
195## Common Workflows
196
197### Basic ID Verification
198
199```
2001. POST /v3/id-verification/ → front_image (+ back_image if applicable)
2012. If "Approved" → extract first_name, last_name, date_of_birth, document_number
202 If "Declined" → check warnings:
203 DOCUMENT_EXPIRED → ask for valid document
204 SCREEN_CAPTURE_DETECTED → ask for real photo of physical document
205 MRZ_VALIDATION_FAILED → ask for clearer image
206```
207
208### Full Identity Verification Pipeline
209
210```
2111. POST /v3/id-verification/ → verify document
2122. POST /v3/passive-liveness/ → verify real person
2133. POST /v3/face-match/ → compare selfie to document portrait
2144. POST /v3/aml/ → screen extracted name/DOB/nationality
2155. All Approved → fully verified identity
216```
217
218---
219
220## Utility Scripts
221
222```bash
223export DIDIT_API_KEY="your_api_key"
224
225python scripts/verify_id.py front.jpg
226python scripts/verify_id.py front.jpg back.jpg --vendor-data user-123
227```