API reference / Document AI
KYC document OCR
Extracts the fields from ID and utility documents. Send one or two images as public https URLs or base64.
POST
/v1/read/kyc-ocr- Authentication
- Bearer token
- Scope
read:document
Before you integrate
- Only the object for the detected document type is filled in; the others are absent or empty.
- Images given as URLs must be reachable from the public internet and must use https.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
documents | array | Yes | One or two images of the document, front and back if needed. Each item is a public https URL (up to 2040 characters) or base64 image data of at least 100 characters, with an optional data:...;base64, prefix. |
Sample code
Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.
curl -sS -X POST 'https://grappi.ai/v1/read/kyc-ocr' \
-H "Authorization: Bearer $GRAPPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [
"https://example.com/kyc/pan-front.jpg"
]
}'Sample response
{
"request_id": "req_01HZY3K8M2",
"result": {
"doc_type": "pan",
"status": "completed",
"completed_at": "2026-11-05T10:00:05Z",
"created_at": "2026-11-05T10:00:01Z",
"pan": {
"name": "ASHA RAO",
"pan_number": "ABCDE1234F",
"dob": "17/08/1990"
}
}
}Response fields
| Field | Type | Description |
|---|---|---|
doc_type | string | The kind of document found. |
status | string | Whether the reading completed. |
completed_at | string | When the reading finished. |
created_at | string | When the reading started. |
pan | object | Fields read from a PAN card, present when the image is a PAN card. |
aadhaar | object | Fields read from an Aadhaar card, present when the image is an Aadhaar card. |
voter_id | object | Fields read from a voter ID, present when the image is a voter ID. |
passport | object | Fields read from a passport, present when the image is a passport. |
driving_license | object | Fields read from a driving licence, present when the image is a driving licence. |
driving_license.name | string | Name on the licence. |
driving_license.number | string | Licence number. |
driving_license.dob | string | Date of birth. |
driving_license.issue_date | string | Date of issue. |
driving_license.expiry_date | string | Date of expiry. |
driving_license.guardian_name | string | Father's or guardian's name. |
driving_license.state | string | Issuing state. |
driving_license.address | string | Address on the licence. |
driving_license.dl_type | array | Vehicle classes the licence covers. |
electricity_bill | object | Fields read from an electricity bill, present when the image is an electricity bill. |
gas_bill | object | Fields read from a gas bill, present when the image is a gas bill. |
broadband_bill | object | Fields read from a broadband bill, present when the image is a broadband bill. |
lease_of_deed | object | Fields read from a lease deed, present when the image is a lease deed. |
Errors
Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.