API SuiteDocument OCR (ML)
Passport Front OCR
OCR the main data page of a passport 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/passport/front" \ -F file="string"{
"DOB": "string",
"date_of_expiry": "string",
"date_of_issue": "string",
"name": "string",
"nationality": "string",
"passport_number": "string",
"place_of_birth": "string",
"sex": "string",
"surname": "string"
}{
"detail": {
"<location>": {
"<field_name>": [
"string"
]
}
},
"message": "string"
}{
"detail": {},
"message": "string"
}Overview
Call POST /ocr/passport/front with Authorization: Bearer <token> and file. Optional flags and unique_id. Compare OCR output with Verify Passport when you need issuer-validated data.
Key features
- Structured capture of passport fields from a photo.
- Pairs with back OCR when you collect both sides.
Implementation
Step 1: Call from your backend
Post passport main page image as file.
Error handling
| HTTP status | When |
|---|---|
| 400 | Unreadable image. |
| 401 | Invalid token. |
Benefits
- Reduces typing errors on international ID onboarding.