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

# ID Verification

> Verify identity by matching an ID document against a selfie image or video

The ID-Selfie Model verifies a person's identity by matching their ID document against a selfie image or video. It performs face matching and anti-spoofing checks.

## How It Works

1. Upload an **ID document** (passport, driver license, etc.)
2. Upload a **selfie image or video** of the person
3. The API compares the faces and runs anti-spoofing checks
4. You receive a `verified` boolean and detailed technical checks

## Verifying Identity

Submit both files via `POST /v1/verification`:

```bash theme={null}
curl -X POST https://api.deepxl.ai/v1/verification \
  -H "x-api-key: YOUR_API_KEY" \
  -F "idFile=@passport.jpg" \
  -F "selfieFile=@selfie.jpg" \
  -F 'tags={"customerId":"9999","customerName":"Acme Corp","documentId":"DOC-001","companyName":"DeepXL","companyId":"COMP-001"}'
```

### Parameters

| Parameter    | Type   | Required | Description                                                                                                   |
| ------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------- |
| `idFile`     | file   | Yes      | ID document image (passport, driver license, etc.)                                                            |
| `selfieFile` | file   | Yes      | Selfie image or video of the person                                                                           |
| `tags`       | string | No       | JSON object with metadata key-value pairs                                                                     |
| `country`    | string | No       | Optional country hint. Supported values: `us`, `mx`, `br`. Missing, empty, or invalid values default to `us`. |

### Supported File Types

**ID document:** jpg, jpeg, png, webp

**Selfie:** jpg, jpeg, png, webp, mp4 (video)

## Response Structure

```json theme={null}
{
  "result": {
    "verificationId": 5,
    "idFileType": "jpeg",
    "idFileName": "passport.jpg",
    "idFileSize": 174112,
    "selfieFileType": "jpeg",
    "selfieFileName": "selfie.jpg",
    "selfieFileSize": 250118,
    "timestamp": 1770984835,
    "timestampISO": "2026-02-13T13:13:55.213189",
    "model": "verification",
    "modelVersion": "1.0.0",
    "verified": true,
    "modelResults": {
      "technicalChecks": [
        {
          "checkType": "face_detection",
          "faceCount": { "id": 2, "selfie": 1 },
          "idFaces": [
            {
              "faceId": "face_1",
              "detectionConfidence": 0.9992,
              "landmarks": {
                "nose": { "x": 257.7, "y": 946.13 },
                "left_eye": { "x": 287.49, "y": 911.67 },
                "right_eye": { "x": 227.69, "y": 911.25 },
                "mouth_left": { "x": 283.88, "y": 971.12 },
                "mouth_right": { "x": 232.78, "y": 971.0 }
              },
              "boundingBox": { "x1": 195, "x2": 318, "y1": 838, "y2": 1013 }
            },
            {
              "faceId": "face_2",
              "detectionConfidence": 0.9865,
              "landmarks": {
                "nose": { "x": 696.46, "y": 885.83 },
                "left_eye": { "x": 701.44, "y": 879.83 },
                "right_eye": { "x": 690.77, "y": 880.29 },
                "mouth_left": { "x": 701.06, "y": 891.11 },
                "mouth_right": { "x": 692.61, "y": 891.52 }
              },
              "boundingBox": { "x1": 684, "x2": 707, "y1": 866, "y2": 898 }
            }
          ],
          "selfieFaces": [
            {
              "faceId": "face_1",
              "detectionConfidence": 0.9985,
              "landmarks": {
                "nose": { "x": 724.91, "y": 807.64 },
                "left_eye": { "x": 803.63, "y": 708.27 },
                "right_eye": { "x": 649.76, "y": 710.14 },
                "mouth_left": { "x": 793.35, "y": 871.12 },
                "mouth_right": { "x": 659.28, "y": 871.8 }
              },
              "boundingBox": { "x1": 569, "x2": 884, "y1": 523, "y2": 986 }
            }
          ]
        }
      ]
    },
    "tags": [
      { "name": "customerId", "value": "9999" },
      { "name": "customerName", "value": "Acme Corp" },
      { "name": "documentId", "value": "DOC-001" },
      { "name": "companyName", "value": "DeepXL" },
      { "name": "companyId", "value": "COMP-001" }
    ],
    "files": [
      {
        "category": "id",
        "fileName": "passport.jpg",
        "fileSize": 174112,
        "contentType": "image/jpeg",
        "timestamp": 1770984835,
        "timestampISO": "2026-02-13T13:13:55.213189",
        "url": "https://api.deepxl.ai/v1/files/v_id_5_passport.jpg"
      },
      {
        "category": "face",
        "fileName": "selfie.jpg",
        "fileSize": 250118,
        "contentType": "image/jpeg",
        "timestamp": 1770984835,
        "timestampISO": "2026-02-13T13:13:55.213189",
        "url": "https://api.deepxl.ai/v1/files/v_face_5_selfie.jpg"
      }
    ]
  }
}
```

### Field Reference

| Field            | Type    | Description                                   |
| ---------------- | ------- | --------------------------------------------- |
| `verificationId` | integer | Unique identifier for the verification record |
| `idFileType`     | string  | File extension of the ID document             |
| `idFileName`     | string  | Original file name of the ID document         |
| `idFileSize`     | integer | File size of the ID document in bytes         |
| `selfieFileType` | string  | File extension of the selfie                  |
| `selfieFileName` | string  | Original file name of the selfie              |
| `selfieFileSize` | integer | File size of the selfie in bytes              |
| `timestamp`      | integer | Unix timestamp of the analysis                |
| `timestampISO`   | string  | ISO 8601 timestamp of the analysis            |
| `model`          | string  | Model used (`verification`)                   |
| `modelVersion`   | string  | Version of the model used for analysis        |
| `verified`       | boolean | Whether the identity was confirmed            |

### Verified

The `verified` field is a boolean indicating whether the identity was confirmed — the face in the selfie matches the face in the ID document and anti-spoofing checks passed.

### Technical Checks

The `modelResults.technicalChecks` array contains face detection results for both the ID document and the selfie.

**Face Detection** (`checkType: "face_detection"`):

| Field         | Type   | Description                                              |
| ------------- | ------ | -------------------------------------------------------- |
| `faceCount`   | object | Number of faces detected — `id` count and `selfie` count |
| `idFaces`     | array  | Faces detected in the ID document                        |
| `selfieFaces` | array  | Faces detected in the selfie                             |

**Each face object includes:**

| Field                 | Type   | Description                                                                                |
| --------------------- | ------ | ------------------------------------------------------------------------------------------ |
| `faceId`              | string | Face identifier (e.g. `face_1`, `face_2`)                                                  |
| `detectionConfidence` | float  | Face detection confidence (0.0–1.0)                                                        |
| `landmarks`           | object | Facial landmark coordinates (`nose`, `left_eye`, `right_eye`, `mouth_left`, `mouth_right`) |
| `boundingBox`         | object | Face bounding box coordinates (`x1`, `y1`, `x2`, `y2`)                                     |

### File Categories

| Category | Description                        |
| -------- | ---------------------------------- |
| `id`     | The uploaded ID document           |
| `face`   | The uploaded selfie image or video |

## Tags and Filtering

```bash theme={null}
curl "https://api.deepxl.ai/v1/verification?tagFilter=customerId=9999" \
  -H "x-api-key: YOUR_API_KEY"
```

## Browsing History

```bash theme={null}
curl "https://api.deepxl.ai/v1/verification?limit=25&offset=0&sortBy=verificationId&direction=desc" \
  -H "x-api-key: YOUR_API_KEY"
```

### Sort Options

`verificationId`, `idFileName`, `idFileSize`, `idFileType`, `selfieFileName`, `selfieFileSize`, `selfieFileType`, `verified`, `timestamp`
