Skip to main content
OCR endpoints take the image as multipart/form-data in a field named file. This recipe reads a PAN card with POST /v2/verify/pan_ocr. The same pattern works for dl_ocr, aadhaar_ocr and invoice_ocr.
1

Set your credentials

Use https://dev.idto.ai (staging) while you build and https://prod.idto.ai (production) when you go live. Keep the client ID and API key on your server only. Never ship them to a browser or a mobile app.
.env
2

Upload the image

3

Read the result

200
A readable image that is not a PAN card, or has no readable PAN, returns a 2xx with a non-null error_code. Branch on error_code as in Verify a PAN and branch on error_code.

Good to know

  • Do not set the Content-Type header yourself. curl -F and requests files= set the multipart boundary for you.
  • Send an Idempotency-Key to make retries safe. See Retry safely with an idempotency key.
Was this page helpful? Email us at tech@idto.ai with the page link.
Last modified on October 4, 2026