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

# Liveness Check API: Verify Real Person from a Selfie Image

> Send a selfie image as Base64 to get a liveness score and face attributes. Use the result to confirm a live person was captured and to gate verification or authentication flows.

This endpoint accepts a single selfie image (Base64) and returns a liveness probability score plus face detection details. A liveness probability above 50 indicates that a real person was present; below that, the image may be a photo, print, or screen. Use the response to decide whether to allow the user to continue in your flow or to require a retry.

### Request

```http [POST] theme={null}
{{baseUrl}}/api/v1/ml/liveness/
```

### Header

| Header        | Type   | Description                                                                                         |
| ------------- | ------ | --------------------------------------------------------------------------------------------------- |
| AppId         | string | Create an app to get your app ID on dashboard [here](https://app.dojah.io/developers/configuration) |
| Authorization | string | Private/secret key. Use `<key>` not `Bearer <key>`                                                  |

### Body parameter

| Parameter | Type   | Description                        | Required |
| --------- | ------ | ---------------------------------- | -------- |
| image     | string | `Image format should be in Base64` | required |

<Info>
  `liveness_probability` above 50 means liveness is confirmed.
</Info>

### Response

```json Response theme={null}
{
    "entity":{
       "liveness": {
            "liveness_check": false,
            "liveness_probability": 0.014614949759561568
        },
        "face": {
            "face_detected": true,
            "message": "face detected",
            "multiface_detected": false,
            "details": {
                "age_range": {
                    "low": 25,
                    "high": 35
                },
                "smile": {
                    "value": false,
                    "confidence": 92.67727661132812
                },
                "gender": {
                    "value": "Female",
                    "confidence": 99.92608642578125
                },
                "eyeglasses": {
                    "value": false,
                    "confidence": 96.146484375
                },
                "sunglasses": {
                    "value": false,
                    "confidence": 99.99609375
                },
                "beard": {
                    "value": false,
                    "confidence": 85.18626403808594
                },
                "mustache": {
                    "value": false,
                    "confidence": 96.13561248779297
                },
                "eyes_open": {
                    "value": true,
                    "confidence": 88.61351776123047
                },
                "mouth_open": {
                    "value": false,
                    "confidence": 76.0062484741211
                },
                "emotions": [
                    {
                        "type": "CALM",
                        "confidence": 81.77631378173828
                    },
                    {
                        "type": "FEAR",
                        "confidence": 6.811796188354492
                    },
                    {
                        "type": "SURPRISED",
                        "confidence": 6.772216320037842
                    },
                    {
                        "type": "SAD",
                        "confidence": 6.691151142120361
                    },
                    {
                        "type": "ANGRY",
                        "confidence": 2.304255723953247
                    },
                    {
                        "type": "DISGUSTED",
                        "confidence": 2.147843599319458
                    },
                    {
                        "type": "HAPPY",
                        "confidence": 1.2251189947128296
                    },
                    {
                        "type": "CONFUSED",
                        "confidence": 0.9095264673233032
                    }
                ]
            },
            "quality": {
                "brightness": 65.93645477294922,
                "sharpness": 97.45164489746094
            },
            "confidence": 99.99896240234375,
            "bounding_box": {
                "width": 0.4954420328140259,
                "height": 0.39241859316825867,
                "left": 0.27790528535842896,
                "top": 0.3333175778388977
            }
        }
    }
}
```

### Response Fields

| Field                                      | Type    | Description                                                                                                                                          |
| ------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| entity                                     | object  | Contains the response data                                                                                                                           |
| entity.liveness                            | object  | Liveness detection results                                                                                                                           |
| entity.liveness.liveness\_check            | boolean | Whether the face passed the liveness check (true if `liveness_probability` > 50)                                                                     |
| entity.liveness.liveness\_probability      | number  | Probability score (0–100) that the image contains a live person. Values above 50 indicate a real person; below 50 suggests a photo, print, or screen |
| entity.face                                | object  | Face detection results and attributes                                                                                                                |
| entity.face.face\_detected                 | boolean | Whether a face was detected in the image                                                                                                             |
| entity.face.message                        | string  | Human-readable face detection status message                                                                                                         |
| entity.face.multiface\_detected            | boolean | Whether multiple faces were detected in the image                                                                                                    |
| entity.face.details                        | object  | Detailed face attributes extracted from the image                                                                                                    |
| entity.face.details.age\_range             | object  | Estimated age range of the detected face                                                                                                             |
| entity.face.details.age\_range.low         | integer | Lower bound of the estimated age                                                                                                                     |
| entity.face.details.age\_range.high        | integer | Upper bound of the estimated age                                                                                                                     |
| entity.face.details.smile                  | object  | Smile detection result                                                                                                                               |
| entity.face.details.smile.value            | boolean | Whether the person is smiling                                                                                                                        |
| entity.face.details.smile.confidence       | number  | Confidence score (0–100) for the smile detection                                                                                                     |
| entity.face.details.gender                 | object  | Gender classification result                                                                                                                         |
| entity.face.details.gender.value           | string  | Detected gender (e.g., `Male`, `Female`)                                                                                                             |
| entity.face.details.gender.confidence      | number  | Confidence score (0–100) for the gender classification                                                                                               |
| entity.face.details.eyeglasses             | object  | Eyeglasses detection result                                                                                                                          |
| entity.face.details.eyeglasses.value       | boolean | Whether the person is wearing eyeglasses                                                                                                             |
| entity.face.details.eyeglasses.confidence  | number  | Confidence score (0–100) for eyeglasses detection                                                                                                    |
| entity.face.details.sunglasses             | object  | Sunglasses detection result                                                                                                                          |
| entity.face.details.sunglasses.value       | boolean | Whether the person is wearing sunglasses                                                                                                             |
| entity.face.details.sunglasses.confidence  | number  | Confidence score (0–100) for sunglasses detection                                                                                                    |
| entity.face.details.beard                  | object  | Beard detection result                                                                                                                               |
| entity.face.details.beard.value            | boolean | Whether the person has a beard                                                                                                                       |
| entity.face.details.beard.confidence       | number  | Confidence score (0–100) for beard detection                                                                                                         |
| entity.face.details.mustache               | object  | Mustache detection result                                                                                                                            |
| entity.face.details.mustache.value         | boolean | Whether the person has a mustache                                                                                                                    |
| entity.face.details.mustache.confidence    | number  | Confidence score (0–100) for mustache detection                                                                                                      |
| entity.face.details.eyes\_open             | object  | Eyes open detection result                                                                                                                           |
| entity.face.details.eyes\_open.value       | boolean | Whether the person's eyes are open                                                                                                                   |
| entity.face.details.eyes\_open.confidence  | number  | Confidence score (0–100) for eyes open detection                                                                                                     |
| entity.face.details.mouth\_open            | object  | Mouth open detection result                                                                                                                          |
| entity.face.details.mouth\_open.value      | boolean | Whether the person's mouth is open                                                                                                                   |
| entity.face.details.mouth\_open.confidence | number  | Confidence score (0–100) for mouth open detection                                                                                                    |
| entity.face.details.emotions               | array   | List of detected emotions ranked by confidence                                                                                                       |
| entity.face.details.emotions\[].type       | string  | Emotion type (e.g., `CALM`, `HAPPY`, `SAD`, `ANGRY`, `SURPRISED`, `DISGUSTED`, `FEAR`, `CONFUSED`)                                                   |
| entity.face.details.emotions\[].confidence | number  | Confidence score (0–100) for the detected emotion                                                                                                    |
| entity.face.quality                        | object  | Image quality metrics for the detected face                                                                                                          |
| entity.face.quality.brightness             | number  | Brightness score (0–100) of the face region                                                                                                          |
| entity.face.quality.sharpness              | number  | Sharpness score (0–100) of the face region                                                                                                           |
| entity.face.confidence                     | number  | Overall confidence score (0–100) that a face is present in the image                                                                                 |
| entity.face.bounding\_box                  | object  | Coordinates of the face bounding box as proportions of the image dimensions                                                                          |
| entity.face.bounding\_box.width            | number  | Width of the bounding box as a ratio (0–1) of the image width                                                                                        |
| entity.face.bounding\_box.height           | number  | Height of the bounding box as a ratio (0–1) of the image height                                                                                      |
| entity.face.bounding\_box.left             | number  | Left edge position as a ratio (0–1) from the left side of the image                                                                                  |
| entity.face.bounding\_box.top              | number  | Top edge position as a ratio (0–1) from the top of the image                                                                                         |
