API SuiteDocument Processing (ML)
Card Detection
Detect ID card boundaries in an image for auto-cropping or quality checks. 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
unique_id?string
Response Body
curl -X POST "https://__mock__/card_detection/card_detection" \ -F file="string"{
"card_type": "string",
"confidence": 0
}{
"detail": {
"<location>": {
"<field_name>": [
"string"
]
}
},
"message": "string"
}{
"detail": {},
"message": "string"
}Overview
Call POST /card_detection/card_detection with Authorization: Bearer <token> and file multipart field. Optional unique_id. Use the geometry output to crop before OCR routes such as PAN OCR or Aadhaar front OCR.
Key features
- Capture UX: Helps users fix skew and framing before expensive OCR.
- Shared pattern with other ML endpoints (Bearer + multipart).
Implementation
Step 1: Call from your backend
Post the full-frame photo as file.
Error handling
| HTTP status | When |
|---|---|
| 400 | Detection failed on input. |
| 401 | Invalid token. |
Benefits
- Fewer OCR failures on poorly framed mobile captures.