API SuiteDocument OCR (ML)
Aadhaar Front OCR
OCR the front of an Aadhaar card from an image. Server-side multipart POST with Bearer auth.
API reference
Try itLoading playground…
Loading…
AuthorizationBearer <token>
JWT Bearer token authentication. Obtain a token from the KwikID dashboard.
In: header
filestring
flags?string
Optional JSON string. Keys: CARD_ORIENT (0/1) corrects orientation; CARD_CROP (0/1) runs document crop before OCR.
unique_id?string
Optional correlation id for logs.
Response Body
curl -X POST "https://__mock__/ocr/aadhaar/front" \ -F file="string"{
"aadhaar_number": "string",
"aadhaar_validity": "string",
"dob": "string",
"gender": "string",
"name": "string"
}{
"detail": {
"<location>": {
"<field_name>": [
"string"
]
}
},
"message": "string"
}{
"detail": {},
"message": "string"
}Overview
Call POST /ocr/aadhaar/front with Authorization: Bearer <token> and file (image). Optional flags and unique_id. Warning: Output may contain Aadhaar numbers. Mask or tokenize before display; prefer Aadhaar masking for storage-safe copies.
Key features
- Digitizes front-of-card fields for downstream validation.
- Pairs with DigiLocker when you need source-of-truth XML instead of OCR.
Implementation
Step 1: Call from your backend
Post file as multipart per OpenAPI.
Error handling
| HTTP status | When |
|---|---|
| 400 | Unreadable image. |
| 401 | Invalid token. |
Security notes
- Never log full OCR JSON in plain text.
Benefits
- Faster onboarding when DigiLocker is not in scope for that journey.