DL Verify
POST/dlv
Postman
This endpoint allows for the validation of a driver's license, ID card, or military ID using Agility's verification service. It accepts an image or scanned data of the license ID and returns validation results, including authenticity checks and extracted information.
A selfie can be included in the verification to match the applicant's face against the license photo and check liveness, in one of two ways:
- Upload the selfie: send it as a base64 encoded image with type
selfie, together with the license images or in a later request of the same session. - Selfie URL: send
return_selfie_url: truewith the license images. The response contains aselfie_urlfor the applicant to take their selfie. Once they have, sendend_session: truewith the samesession_idto get the results. If the selfie is still being processed, the response is a409with aRetry-Afterheader; retry the same request after that many seconds.
When the DL Verify Document Liveness add-on is enabled, every verification also checks that the front image is a live capture of a physical document, not a photo of a screen, a printed copy, or a document with an altered portrait. The result is returned under details.document_liveness. A failed check adds document_liveness to failed_checks and the decision becomes refer.
Field comparison. The fields read from the front of the license are compared with the barcode. They fall into two groups, each reported under details.ocr_match:
- Primary fields (
primary):issuer_name,document_number,name,address,dob,issue_date,expiration_date. A field that doesn't match is listed inmismatch_fields, and one that can't be compared because it wasn't found is listed inmissing_fields. Both count towardfailed_count. - Secondary fields (
secondary): every other field, such as height, weight, eye color, sex and class. Only fields that were compared and didn't match count towardfailed_count. Fields that can't be compared are listed inmissing_fieldsand never count.
A group fails once its failed_count reaches its fail_at, and then ocr_match fails and the decision becomes refer. Agility Credit sets these limits per account and can change them on request.
Expiry. The license's expiry is read from the barcode and reported under details.expiry. An expired license, or one whose expiry the barcode doesn't establish, fails expiry and the decision becomes refer. A license that never expires passes. Agility Credit can set an account to not fail expired licenses; expiry is then listed in warnings instead of failed_checks.
Best practices
- On
refer,failed_checkslists the checks that caused it. Each one is a key indetails. warningslists checks that didn't change the decision but have findings worth a look. For example, anacceptwith field mismatches below the limits hasocr_matchinwarnings, with the fields indetails.ocr_match.primaryanddetails.ocr_match.secondary.- With the Document Liveness add-on, send the front with a margin of background around all four edges, about 5% of the card's size on each side. A front cropped tight to the card edge can fail
document_liveness. - Secondary fields such as height, weight and eye color can change after a license is issued, so they differ more often than primary fields.
- When the barcode couldn't be read, both
barcodeandexpiryare infailed_checks, anddetails.expiry.processedisfalse. expiration_dateis also one of the primary fields compared between the front and the barcode. It is separate fromexpiry: a date that doesn't match or can't be compared adds toprimary.failed_countand only failsocr_matchonce that reachesprimary.fail_at.- An
errormeans no reliable decision could be made.retakeslists the images to submit again with the samesession_id. When the front of the license isn't recognized for the third time in a session, the verification completes withreferinstead and no retake is requested.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 429
- 500
- 502
Inquiry processed successfully
Response Headers
The source IP
The current limit on a 5-minute window.
The remaining calls on a 5-minute window.
The timestamp of the request reception.
Bad Request
Unauthorized
Product Not Enabled
Session Not Found. The session_id does not exist or has expired; start a new session and submit all images again.
Selfie Processing. The selfie taken on the selfie_url is still being processed. Retry the same request with the same session_id after the number of seconds in the Retry-After header.
Response Headers
Seconds to wait before retrying.
Too Many Requests
Internal Server Error
Verification Error. The verification could not be processed; errors describes what failed. Retry with the same session_id.