> ## Documentation Index
> Fetch the complete documentation index at: https://idto.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Face and liveness

> Confirm a selfie comes from a live person and that it matches the photo on an ID document.

Use this module to bind a person to an identity document. Liveness confirms that the selfie was taken of a real person in front of the camera. Face match then compares that selfie with the photo on the ID.

## Endpoints

| Endpoint | What it does | Billed when |
| - | - | - |
| [Liveness](https://idto.mintlify.site/api-reference/face/liveness.md) `POST /v2/verify/liveness` | Checks one base64 selfie for presentation attacks and capture problems. | Every 2xx, including `is_live: false` |
| [Face match](https://idto.mintlify.site/api-reference/face/face-match.md) `POST /v2/verify/face_match` | Compares two faces and returns a 0 to 100 score and a match decision. | Every 2xx, including `is_match: false` |
| [Liveness (v1)](https://idto.mintlify.site/api-reference/face/liveness-v1.md) `POST /verify/liveness` | v1 contract. Checks one base64 selfie. No idempotency. | Only when `status` is `success` |
| [Face match (v1)](https://idto.mintlify.site/api-reference/face/face-match-v1.md) `POST /verify/face_match` | v1 contract. Compares a selfie with a document photo. No idempotency. | Only when `status` is `success` |

## How a selfie check works

```mermaid theme={null}
sequenceDiagram
    participant App as Your app
    participant Server as Your server
    participant idto
    App->>Server: Selfie
    Server->>idto: POST /v2/verify/liveness (person)
    idto-->>Server: data.is_live
    alt is_live true
        Server->>idto: POST /v2/verify/face_match (image1 selfie, image2 ID photo)
        idto-->>Server: data.is_match, data.match_score
        Server-->>App: Approve or send to review
    else is_live false
        Server-->>App: Ask for a new selfie
    end
```

## Outcomes and billing

Both endpoints return the idto envelope. A 2xx response is billed whatever the decision: a failed liveness check or a non-matching face is still a completed check. Errors such as an unreadable image (`IDTO_503`, 413) or no decision (`IDTO_509` or `IDTO_609`, 500) are never billed. Face match treats a score of 70 or more as a match. Error bodies follow [Error response shapes](https://idto.mintlify.site/concepts/request-response.md#error-response-shapes), and charges follow the [billing rule](https://idto.mintlify.site/concepts/billing-consent.md#billing).

## In the hosted flow

The face step of the idto verification flow guides the user through the selfie capture.

<video controls muted playsInline src="https://idto-sdk-usage-demo-bucket.s3.ap-south-1.amazonaws.com/docs/v1/video/flow-face.mp4" poster="https://idto-sdk-usage-demo-bucket.s3.ap-south-1.amazonaws.com/docs/v1/video/flow-face.jpg" aria-label="Face capture step in the idto verification flow" />

![Selfie capture screen in the idto verification flow](https://idto-sdk-usage-demo-bucket.s3.ap-south-1.amazonaws.com/docs/v1/img/sdk-face-capture.png)

## Test scenarios

| Endpoint | Input | Expected | Billed |
| - | - | - | - |
| Liveness | Clear selfie of a live person | 200, `is_live: true` | Yes |
| Liveness | Base64 that is not an image | 413, `IDTO_503` | No |
| Face match | Two photos of the same person | 200, `is_match: true` | Yes |
| Face match | Photos of two different people | 200, `is_match: false` | Yes |
| Face match | Neither `image2` nor `image2_url` | 400, `IDTO_001` | No |

Each endpoint page lists its full set. Common questions: [FAQ](https://idto.mintlify.site/products/face/faq.md).

***

Was this page helpful? Email us at [tech@idto.ai](mailto:tech@idto.ai?subject=Docs%20feedback%3A%20Face%20and%20liveness) with the page link.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.