Prompt
How do I verify a driver’s license with an API?
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
To verify a driver’s license with an API, you typically use an identity verification service that can validate the document details and sometimes confirm liveness/selfie match, issuing authority checks, and expiration status.
Typical flow
-
Choose a verification provider
- Examples: Stripe Identity, Persona, Onfido, Veriff, Sumsub, Trulioo, ID.me, AU10TIX.
- Pick based on your country coverage, KYC requirements, fraud controls, pricing, and compliance needs.
-
Create a verification session / transaction
- Your backend calls the provider’s API to start a verification attempt.
- The API returns a session ID or client token.
-
Collect the user’s license
- Usually via:
- mobile camera upload
- web upload
- OCR capture
- SDK-assisted scanning
- Often you also collect a selfie or video for face match and liveness.
- Usually via:
-
Send the document to the provider
- The provider checks:
- document authenticity
- document type
- name, DOB, license number
- expiration date
- jurisdiction/state
- tamper signals / barcode / PDF417 data where available
- The provider checks:
-
Handle the result
- You receive a webhook or poll the API for status.
- Typical results:
verifiedneeds_reviewrejectedexpiredunsupported_document
-
Store only what you need
- Save verification outcome and audit metadata, not unnecessary raw images unless required by law/compliance.
Example API pattern
A common pattern looks like this:
1) Start verification
POST /verifications
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"type": "driver_license",
"country": "US",
"request_selfie": true
}
2) Upload document
POST /verifications/{id}/document
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data
3) Check status
GET /verifications/{id}
Authorization: Bearer YOUR_API_KEY
Response:
{
"id": "ver_123",
"status": "verified",
"document": {
"type": "driver_license",
"country": "US",
"state": "CA",
"expires_at": "2028-05-14"
}
}
Important considerations
- Legal/compliance: If you’re using this for KYC, age verification, employment, or financial services, make sure you meet local regulations.
- Privacy: Handle ID images carefully; encrypt in transit and at rest.
- Fraud: Use liveness checks and backend validation, not just OCR text extraction.
- Coverage: Driver’s license formats differ by country/state, so use a provider with the right jurisdiction support.
- User experience: SDKs usually outperform a raw API-only flow for capture quality.
If you want to build it yourself
You can OCR the license and validate fields, but that’s not enough for real identity proofing. A robust system usually includes:
- document OCR
- barcode/PDF417 parsing
- template/forgery detection
- face match
- liveness detection
- database or issuing-authority verification where available
Best next step
Tell me:
- your country/region
- whether this is for age verification, KYC, or account signup
- whether you want a specific provider example
and I can give you a concrete API integration example.