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

FieldTypeRequiredDescription
documentsarrayYesOne 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

FieldTypeDescription
doc_typestringThe kind of document found.
statusstringWhether the reading completed.
completed_atstringWhen the reading finished.
created_atstringWhen the reading started.
panobjectFields read from a PAN card, present when the image is a PAN card.
aadhaarobjectFields read from an Aadhaar card, present when the image is an Aadhaar card.
voter_idobjectFields read from a voter ID, present when the image is a voter ID.
passportobjectFields read from a passport, present when the image is a passport.
driving_licenseobjectFields read from a driving licence, present when the image is a driving licence.
driving_license.namestringName on the licence.
driving_license.numberstringLicence number.
driving_license.dobstringDate of birth.
driving_license.issue_datestringDate of issue.
driving_license.expiry_datestringDate of expiry.
driving_license.guardian_namestringFather's or guardian's name.
driving_license.statestringIssuing state.
driving_license.addressstringAddress on the licence.
driving_license.dl_typearrayVehicle classes the licence covers.
electricity_billobjectFields read from an electricity bill, present when the image is an electricity bill.
gas_billobjectFields read from a gas bill, present when the image is a gas bill.
broadband_billobjectFields read from a broadband bill, present when the image is a broadband bill.
lease_of_deedobjectFields 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.