Check an identity document
Reads an identity document (a passport, a national ID card, a driving licence) on its own, with no verification, the way a verification reads one: the printed fields, then the document’s own MRZ and barcode, which win where they agree with their check digits. With documentLiveness (on unless sent false) it also examines the document itself for a photo of a screen, a screenshot, a photocopy, a replaced portrait or signs of editing.
Upload the front first with POST /api/kyc/upload (multipart file and type=document_front; JPEG, PNG or WebP) and, for a two-sided document such as an ID card, the back with type=document_back; then send their mediaIds here within 30 minutes. From Spot Checks a PDF is accepted too, read by its first page.
By default an MRZ that fails its check digits, an expired document, printed text the MRZ or barcode contradicts, a screen photo, photocopy, replaced portrait or editing, and (when minimumAge is sent) a holder younger than it fail the check; no expiry date read and a layout that does not fit send it to review. rules changes what each finding does. A document that cannot be read is unavailable with failureCode unreadable and is not charged.
Charged at your Verifications document reading price. In sandbox the document is not read: a sample passport marked result.sample comes back (holder born 14 May 1990), and idType picks the outcome (sample-expired, sample-screen-photo, sample-invalid-mrz, sample-inconsistent fail, sample-unreadable unavailable, anything else pass).
Rules: send rules to set what each finding does (decline fails the check, review sends it to review, approve keeps it as a note and passes) and to change the check’s settings. Anything left out takes your organisation’s saved default rules (set in Spot Checks), else Toden’s, which judge the check as it was judged before rules existed. result.rules says which rules the check ran under, where each came from and what each finding did.
Charged per check at your price (production only); a check that could not be completed is not charged. Send a requestId: a retry with the same value returns the same check with replayed: true, without running or charging again.
Error codes
A missing or unknown key answers 401, where error is a short sentence rather than a code.
Requires a secret (sk_) key. A publishable key receives 403 secret_key_required.
Authentication
Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set flow.run, flow.config.read and verifications.status.read; a scoped secret key reaches what its scopes allow.
Request
The mediaId from uploading the front with type=document_front.
Your idempotency key, 8 to 120 characters: a retry with the same value returns the same check.
The mediaId from uploading the back with type=document_back, for two-sided documents.
The issuing country, when known (ISO 3166-1 alpha-2).
The ID type, when known, for example passport or drivers-license. Left out, the kind is recognised.
Your own reference for the check (a customer or case id), kept with it and searchable in your history.
What each finding does, and the check’s settings. Defaults: expiry_not_detected and template_mismatch review, the rest decline.
Response
A retry: the check already run under this requestId.
The check id (chk_…).
pass: nothing of concern. review: something a person should look at. fail: a clear problem. unavailable: the check could not be completed, was not charged, and is never a pass.
What was sent, minimised: never image bytes, only media ids.
Why the check could not be completed, when outcome is unavailable.
On a run only: true when this is a check already run under the same requestId.