Skip to content

Verify Identities

Get Started > API User Guide > Verify Identities

Verify Identities

ClearDil uses the latest in facial recognition and biometric algorithms to calculate a similarity score of how likely two faces belong to the same person. The service compares a customer’s selfie image with their ID document scan (e.g. Passport, Driving License).

Create Document

Documents can be created for a given customer using the following cURL sample code:

Example request:

Terminal window
curl -X POST https://sandbox.cleardil.com/v1/customer/{customer_id}/documents \
-H 'Authorization: Bearer your_token' \
-F 'front_image=@foo.jpg' \
-F 'back_image=@bar.jpg' \
-F 'type=PASSPORT' \
-F 'document_name=Customer passport' \
-F 'document_description=Primary ID document' \
-F 'document_number=N1234567890' \
-F 'issuing_country=GBR' \
-F 'issue_date=2010-01-01' \
-F 'expiry_date=2020-01-01' \
-F 'mrz_line1=IDGBRDOE<<<<<<<<<<<<<<<<<<<<<<<<<<<<' \
-F 'mrz_line2=N1234567890JOHN<<<<<<<<<<<<6512068F4'

Example response:

{
"id": "d78913a9-7dcd-46c8-a8fc-91b4f85329f5",
"type": "PASSPORT",
"document_name": "Customer passport",
"document_description": "Primary ID document",
"document_number": "N1234567890",
"issuing_country": "GBR",
"issue_date": "2010-01-01",
"expiry_date": "2020-01-01",
"created_at": "2017-06-28T08:04:32Z",
"updated_at": "2017-06-28T08:04:32Z",
"front_side": {
"id": "cb3673b1-003d-49e4-ac49-3462bf704232",
"name": "foo.jpg",
"content_type": "image/jpeg",
"size": 15
},
"back_side": {
"id": "6aa4d0c6-d7d4-4dbd-8a04-ad2491d0cef6",
"name": "bar.jpg",
"content_type": "image/jpeg",
"size": 15
},
"mrz_line1": "IDGBRDOE<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
"mrz_line2": "N1234567890JOHN<<<<<<<<<<<<6512068F4"
}

Verify Identity

Once a document has been uploaded, it can now be compared with a selfie image.

Example request:

Terminal window
curl -X POST https://sandbox.cleardil.com/v1/customer/{customer_id}/identifications \
-H 'Authorization: Bearer your_token' \
-d '{
"document_id": "d78913a9-7dcd-46c8-a8fc-91b4f85329f5",
"selfie_image": <BASE64 encoded image>
}'

Example response:

{
"created_at": "2017-11-10T22:54:17Z",
"updated_at": "2017-11-10T22:54:17Z",
"document_id": "c29ed1c4-59ee-4b8f-ab9c-4829fabaffd5",
"customer_id": "b19872d0-07ea-4d04-84eb-eb7758869b28",
"entity_name": "John Doe",
"selfie_id": "a7794f29-ed41-4ceb-8fce-9b368d570059",
"status": "DONE",
"face_match": "true",
"similarity": 0.987,
"face_analysis": {
"selfie_image": {
"age": 25;,
"gender": "MALE",
"exposure_level": "GOOD_EXPOSURE",
"noise_level": "LOW",
"blur_level": "LOW",
},
"identity_document": {
"age": 25;,
"gender": "MALE",
"exposure_level": "GOOD_EXPOSURE",
"noise_level": "LOW",
"blur_level": "LOW",
}
},
"id": "42583ade-f2b9-4bed-903a-bc46a215040c"
}