# Verify

#### Endpoint

```bash
POST https://cloud.ooto-ai.com/api/v1.0/verify
```

#### Request Format

* Method: POST
* Content-Type: multipart/form-data
* Query Parameters: check\_liveness, check\_deepfake

#### Query Parameters

<table data-header-hidden><thead><tr><th width="187"></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>Name</td><td>Type</td><td>Required</td><td>Description</td></tr><tr><td>check_liveness</td><td>Boolean</td><td>No</td><td>Enable liveness detection</td></tr><tr><td>check_deepfake</td><td>Boolean</td><td>No</td><td>Enable deepfake detection</td></tr></tbody></table>

#### Authentication Headers

To access the API, you need to include the following headers in your request:

* APP-ID: Your application's unique identifier.
* APP-KEY: Your application's authentication key.

#### Form Data

| Field         | Type | Required | Description               |
| ------------- | ---- | -------- | ------------------------- |
| first\_photo  | File | Yes      | User selfie (JPEG or PNG) |
| second\_photo | File | Yes      | User selfie (JPEG or PNG) |

#### Example Request (cURL)

```bash
curl -X POST --location 'https://cloud.ooto-ai.com/api/v1.0/doc/verify?check_liveness=true&check_deepfake=true' \
--header 'APP-ID: put_app_id_here' \
--header 'APP-KEY: put_app_key_here' \
--form 'first_photo=@"/path/to/first_photo"' \
--form 'second_photo=@"/path/to/second_photo"'
```

Replace «app\_id», «app\_key» with your actual credentials and the path to your doc image.

#### Successful Response (HTTP 200)

```json
{
  "transactionId": "2e286eb2-7c7b-4893-9298-ce9fa4c0d7d5",
  "result": {
    "firstFace": {
      "box": {
        "x": 655,
        "y": 1083,
        "w": 937,
        "h": 1210
      },
      "landmarks": [
        [
          912,
          1580
        ],
        [
          1344,
          1583
        ],
        [
          1125,
          1835
        ],
        [
          946,
          1996
        ],
        [
          1297,
          1999
        ]
      ],
      "liveness": {
        "score": 0.9657026651967726,
        "fine": true
      },
      "deepfake": {
        "score": 0.9491408169269562,
        "fine": true
      },
      "quality": {
        "uniformity": {
          "value": 0.7976967765996249,
          "fine": true
        },
        "exposure": {
          "value": 0.6352452907096943,
          "fine": true
        },
        "contrast": {
          "value": 0.780912373462111,
          "fine": true
        },
        "flare": {
          "score": 0.026086460798978806,
          "fine": true
        },
        "blur": {
          "score": 0.000007942797310533933,
          "fine": true
        },
        "occlusion": {
          "score": 0.0005318471812643111,
          "fine": true
        },
        "macroblocks": {
          "score": 8.378465921055067e-9,
          "fine": true
        },
        "emotion": {
          "score": 0.020526384934782982,
          "fine": true
        },
        "leftEyeClosed": {
          "score": 0.004296362400054932,
          "fine": true
        },
        "rightEyeClosed": {
          "score": 0.000009238719940185547,
          "fine": true
        },
        "crfiqa": {
          "score": 0.5999192595481873,
          "fine": true
        },
        "distortion": {
          "score": 0.907139241695404,
          "fine": false
        },
        "gender": "male",
        "age": 59,
        "race": "latino hispanic",
        "pitch": 5.798101723194122,
        "yaw": -2.267319895327091,
        "roll": -0.3308084886521101
      },
      "demography": {
        "gender": "male",
        "age": 59,
        "race": "latino hispanic"
      }
    },
    "secondFace": {
      "box": {
        "x": 721,
        "y": 1090,
        "w": 887,
        "h": 1180
      },
      "landmarks": [
        [
          970,
          1475
        ],
        [
          1359,
          1545
        ],
        [
          1101,
          1734
        ],
        [
          922,
          1909
        ],
        [
          1233,
          1969
        ]
      ],
      "liveness": {
        "score": 0.9435631834637448,
        "fine": true
      },
      "deepfake": {
        "score": 0.9503215253353119,
        "fine": true
      },
      "quality": {
        "uniformity": {
          "value": 0.7449888391064861,
          "fine": true
        },
        "exposure": {
          "value": 0.5834772152336258,
          "fine": true
        },
        "contrast": {
          "value": 0.6654583274963126,
          "fine": true
        },
        "flare": {
          "score": 0.04973117262125015,
          "fine": true
        },
        "blur": {
          "score": 0.0000016207906128329341,
          "fine": true
        },
        "occlusion": {
          "score": 0.004378660582005978,
          "fine": true
        },
        "macroblocks": {
          "score": 0.0000166263180290116,
          "fine": true
        },
        "emotion": {
          "score": 0.35481420159339905,
          "fine": true
        },
        "leftEyeClosed": {
          "score": 0,
          "fine": true
        },
        "rightEyeClosed": {
          "score": 0,
          "fine": true
        },
        "crfiqa": {
          "score": 0.5890940427780151,
          "fine": true
        },
        "distortion": {
          "score": 0.3601391315460205,
          "fine": true
        },
        "gender": "male",
        "age": 42,
        "race": "middle eastern",
        "pitch": -0.25353245437145233,
        "yaw": -8.07693064212799,
        "roll": -9.988648295402527
      },
      "demography": {
        "gender": "male",
        "age": 42,
        "race": "middle eastern"
      }
    },
    "threshold": 0.75,
    "similarity": 0.878173828125,
    "same": true
  }
}
```

#### Field Explanation

| templateId                                 | ID of the most similar template found in the database |
| ------------------------------------------ | ----------------------------------------------------- |
| similarity                                 | Cosine similarity between input and matched template  |
| firstFace.liveness and secondFace.liveness | Returned if check\_liveness=true                      |
| firstFace.deepfake and secondFace.deepfake | Returned if check\_deepfake=true                      |
| firstFace                                  | First face detection details                          |
| secondFace                                 | Second face detection details                         |

#### Error response (HTTP 400)

```json
{
  "transactionId": "efb66e50-4c87-493d-b026-543dacdbe314",
  "result": {
    "status": "error",
    "code": 1,
    "info": "photo should not be empty"
  }
}
```

**Engine & OCR Errors**

| Code | Info                                                           |
| ---- | -------------------------------------------------------------- |
| 1    | photo should not be empty                                      |
| 2    | wrong mime-type in input data                                  |
| 3    | photo size is 0 bytes                                          |
| 4    | can not decode image, check it is valid jpeg or png file       |
| 5    | can not detect face                                            |
| 6    | more than one face detected on photo                           |
| 9    | can not extract features from sample, probably it is too small |

#### Best Practices

* Use high-quality, well-lit, frontal photos
* Make sure there’s only one visible face
* Use check\_liveness in environments with higher spoofing risk
* Typical similarity threshold for a valid match: ≥ 0.75


---

# Agent Instructions: 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:

```
GET https://docs.ooto-ai.com/face-api-1-1/verify.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
