Base URLs
idto runs two environments. See Environments for keys and what differs.
Staging and production keys are separate pairs and are not interchangeable.
Required headers
Every call to/verify/* (v1) or /v2/verify/* (v2) needs both of these on every request:
Endpoints that take a document image, such as the OCR products and
face_match, take multipart/form-data instead of JSON. aadhaar_qr takes either: JSON with the decoded QR text, or multipart/form-data with the image. Let your HTTP client set the multipart Content-Type with its boundary; do not set it by hand.
Authentication is checked before anything else, and its failures do not use the v2 envelope. They return a plain detail string:
Request and response bodies
Most v2 endpoints take a JSON body and return a JSON body. Here is a complete example against/v2/verify/pan_validation.
Request
data, tranx_id and timestamp. See Error response shapes.
The full request and response schema for every v2 endpoint, including every field on data, lives under the API Reference tab, generated directly from the OpenAPI spec.
What the HTTP status tells you (v2)
For every/v2/verify/* endpoint, the HTTP status is the first thing to branch on:
- 2xx: the call ran to completion. This covers both a full match (
error_code: null) and a definitive no-record outcome (error_code: "IDTO_202",data: null). Both arestatus: "success"and both are billed, except when a verification session already pays for that step (see Billing). A non-nullerror_codeon a 2xx is an answer, not a failure: the record does not exist or is invalid. - 4xx / 5xx: the call was raised as an error before or during processing (bad input, missing consent, rate limiting, a downstream failure).
statusis"error"andbilledisfalse, with no exceptions.
IDTO_2xx range of the code. Some codes in that range are raised errors: IDTO_204 (unreadable Aadhaar QR, 422), IDTO_205 (wrong OTP, 422) and IDTO_206 (OTP attempts used up, 429). The HTTP status, or status, is what separates an answer from an error.
In order, your handler should:
- Check the HTTP status. On 401 or 403, read
detailand fix credentials; do not retry. - On 2xx, read
error_code.nullmeans usedata;IDTO_202means a definitive no-record answer. - On 4xx, show or log
messageand fix the request. Retrying the same body returns the same error. - On 429
IDTO_006or on 503, retry with backoff and the sameIdempotency-Key. See Rate limits.
IDTO_001 with HTTP 422 and a message that starts with Invalid request and names each failing field. A value that is present but invalid, such as a malformed PAN, returns IDTO_001 with HTTP 400. Treat both the same way: fix the input.
Every v2 body also carries chargeble and user_consent as "true" or "false" strings. They are legacy flags that mirror billed; read billed instead. tranx_id identifies the call: it is on every 2xx body and on most raised errors. Store it, find the call by it in the dashboard under Transactions, and quote it when you contact support.
The exact status code for each IDTO_* code is fixed and documented in the Error Codes reference, for example IDTO_006 is always 429.
Error response shapes
Every family below is what the code returns today. The values are samples.v2 success and no-record (2xx)
data is an object on a full match and null on IDTO_202.
v2 raised error (4xx, 5xx)
The fields sit at the top level, not underdetail.
- Always present:
status("error"),message,error_code,billed(false),chargebleanduser_consent(both"false"). error_codeis anIDTO_*code on every raised error except the insufficient balance 400, where it isnull.data(alwaysnullwhen present),tranx_idandtimestampare on most raised errors but not all. A malformed PAN can return only the always-present keys, and a 422 schema error, anIDTO_004orIDTO_010idempotency conflict and a load-shedIDTO_008carrydata: nullwithouttranx_id. Treat all three as optional on a raised error.
v2 schema validation (422)
A missing required field or a wrong type returns HTTP 422 in the same flat shape, witherror_code: "IDTO_001", data: null and no tranx_id:
message starts with Invalid request and names each failing field, for example pan_number: Field required.
Authentication errors (v1 and v2)
401 and 403 from the credential check return only a string,{"detail": "Client is inactive"}. See Required headers.
v1 success
A v1 body is shaped by the product, with no shared envelope. Most products addtranx_id and timestamp. A charged call carries chargeble: "true" and user_consent: "true"; an uncharged one carries neither. There is no billed field on v1.
v1 raised error
FastAPI-style: the error object is nested underdetail.
error_code can be null on v1, and data, tranx_id and timestamp can be absent, as on v2. Some v1 products put only a message string in detail. A v1 load-shed 503 uses status: "failed" with error_code: "IDTO_008" under detail and a Retry-After: 5 header.
v1 schema validation (422)
A v1 request that fails schema validation returns{"detail": ...} with a description of the invalid fields, a string or a list depending on the endpoint. It has no error_code.
v1 asynchronous result (202)
detail) and comes with a Retry-After: 5 header. Poll /verify/result/{reference_id}; an unknown reference_id returns HTTP 404 with the flat body {"status": "error", "message": "No result found for this reference_id.", "error_code": "IDTO_207", "data": null}.
See API Versioning for the wider v1 and v2 comparison.
Was this page helpful? Email us at tech@idto.ai with the page link.