API Reference
Identity Verification
Document verification, biometric liveness detection, and identity proofing endpoints.
Document Verification
POST
/v1/identity/verifySubmit a document for identity verification
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| documentType | string | Yes | passport, national_id, drivers_license |
| documentFront | string | Yes | Base64-encoded front image of the document |
| documentBack | string | No | Base64-encoded back image (required for some IDs) |
| selfie | string | Yes | Base64-encoded selfie for face matching |
| country | string | Yes | ISO 3166-1 alpha-2 country code |
JavaScript
const response = await fetch('https://api.mobid.io/v1/identity/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Mobid-Key': process.env.MID_API_KEY
},
body: JSON.stringify({
documentType: 'passport',
documentFront: frontImageBase64,
selfie: selfieBase64,
country: 'US'
})
});
const { data } = await response.json();
console.log('Verification ID:', data.verificationId);Response
{
"code": 200,
"message": "Verification initiated",
"data": {
"verificationId": "ver_abc123",
"status": "processing",
"estimatedTime": "30s",
"createdAt": "2025-01-15T12:00:00Z"
}
}Verification Status
GET
/v1/identity/verify/:verificationIdCheck the status of a verification request
Response
{
"code": 200,
"data": {
"verificationId": "ver_abc123",
"status": "verified",
"confidence": 0.98,
"checks": {
"documentAuthenticity": "passed",
"faceMatch": "passed",
"livenessDetection": "passed",
"dataExtraction": "completed"
},
"extractedData": {
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-01-15",
"documentNumber": "AB1234567",
"expiryDate": "2030-06-20",
"nationality": "US"
}
}
}Liveness Detection
POST
/v1/identity/biometrics/livenessPerform a liveness detection check
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | string | Yes | Base64-encoded image or video frame |
| challenge | string | No | Specific challenge type: blink, smile, turn_head |
Response
{
"code": 200,
"data": {
"isLive": true,
"confidence": 0.99,
"spoofType": null,
"processingTime": "120ms"
}
}ℹ
Anti-Spoofing
Liveness detection uses AI to detect presentation attacks including printed photos, screen replays, and 3D masks. Confidence scores above 0.95 are considered reliable.