> For the complete documentation index, see [llms.txt](https://docs.1kosmos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1kosmos.com/identity-verification/verification-methods/document-verification.md).

# Document Verification

***

### Overview

Document verification asks one question: *"Is the document the user submitted real, current, and unmodified?"* It's the foundation of every higher-assurance flow.

The user scans the front and (where applicable) back of an identity document. 1Kosmos checks the document's security features, parses its MRZ or barcode, validates internal checksums, OCRs the printed fields, and returns a structured payload with a per-field confidence score.

### What 1Kosmos checks

For every submitted document, the analyzer runs a battery of checks:

* **Image quality** — focus, glare, exposure, and edge detection. Failing images prompt the user to recapture.
* **Document classification** — match against the country + region + type template library to identify which document was submitted.
* **Security features** — holograms, microprinting, UV patterns, ghost images, and tactile features (where capture quality permits).
* **MRZ / barcode** — checksum validation and field cross-check against the visual zone.
* **Field consistency** — DOB vs. age, document number vs. region pattern, expiry vs. issue date.
* **Expiry** — IDs past their expiry date are rejected by default (configurable per flow).
* **Template integrity** — fonts, layout, and field positions are compared against the known template for that document version. Modifications, replacements, and digital injections are flagged.

### Enrolling a document in a wallet — the user experience

End users go through the same UI regardless of which document they're enrolling. The example below uses a driver's license; passport, ID card, and SSN flows are identical except where noted.

#### Driver's License

{% stepper %}
{% step %}

#### Open the Identity Wallet

The user signs in to your portal and navigates to **My Profile → Identity Wallet**.
{% endstep %}

{% step %}

#### Click Enroll on the Driver's License tile

The Driver's License tile in the Identity Wallet.
{% endstep %}

{% step %}

#### Enter a phone number to receive the verification link

The user enters their mobile number with country code. 1Kosmos sends a one-time link by SMS.
{% endstep %}

{% step %}

#### Open the link on the phone

The user taps the SMS link, lands on the verification start screen, accepts the consent, and taps **Let's Get Started**.
{% endstep %}

{% step %}

#### Scan front and back

The user holds the ID in frame. Auto-capture fires when focus, glare, and edge detection all pass. The UI flips to the back side automatically.&#x20;
{% endstep %}

{% step %}

#### Take a selfie

The user holds the ID in frame. Auto-capture fires when focus, glare, and edge detection all pass. The UI flips to the back side automatically.&#x20;
{% endstep %}

{% step %}

#### See it land in the wallet

Once all server-side checks pass, the document is signed into the user's wallet and the AdminX UI updates to show the new credential.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
&#x20;**SSN enrollment requires a prior DL.** You can only enroll a Social Security Number *after* a driver's license has been verified for the same user. The wallet uses the DL as the binding evidence.&#x20;
{% endhint %}

**Passport**

The flow is identical to driver's license, with three differences:

* The user is prompted for the **bio-data page** rather than front/back.
* The MRZ on the bio-data page is read and cross-checked.
* AAMVA is not performed (it's US DL-only). For US passports, no equivalent database check is run unless your flow includes a separate SSN step.

**National ID Card**

Same flow as driver's license. Country-specific templates determine which fields are extracted, for example, Indian PAN cards extract the PAN number, German eIDs read the chip data via NFC where supported by the device.

**Social Security Number**

The SSN flow is **data-only,** no document scan. The user enters their SSN, 1Kosmos cross-checks it against the previously enrolled driver's license, and (with proper configuration) hits the SSA / eCBSV database.&#x20;

#### Unenrolling a document in a wallet

A user can remove a credential from their wallet at any time from the Identity Wallet tab. The credential is revoked, future relying-party requests for that document will see it as withdrawn, but past audit records remain.

{% hint style="warning" %}
**Unenrolling a driver's license cascades.** Because the SSN credential is bound to the DL, revoking the DL also revokes the SSN. The user must re-enroll the DL first if they want to restore the SSN.
{% endhint %}

#### Extracted fields

Every successful verification adds an `extracted` payload to the result. Fields available depend on document type. The most common:

| Field            | DL | Passport | ID Card | Notes                                         |
| ---------------- | -- | -------- | ------- | --------------------------------------------- |
| `firstName`      | ✓  | ✓        | ✓       |                                               |
| `lastName`       | ✓  | ✓        | ✓       |                                               |
| `dob`            | ✓  | ✓        | ✓       | ISO-8601                                      |
| `documentNumber` | ✓  | ✓        | ✓       |                                               |
| `issuedAt`       | ✓  | ✓        | ✓       |                                               |
| `expiresAt`      | ✓  | ✓        | ✓       | Documents past expiry are rejected by default |
| `address`        | ✓  |          | partial | Country-dependent                             |
| `mrz`            |    | ✓        | partial | Available on MRTD-compliant documents         |
| `gender`         | ✓  | ✓        | partial |                                               |
| `nationality`    |    | ✓        | partial |                                               |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.1kosmos.com/identity-verification/verification-methods/document-verification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
