---
title: Image Passive Liveliness
slug: api-marketplace/image-passive-liveliness
description: Stay ahead of the game with our upcoming document featuring valuable information coming soon. Be prepared to access essential insights and stay tuned for its release in the near future. Subscribe now to be the first to receive this highly anticipated reso
createdAt: 2023-04-20T21:12:16.000Z
---

## Introduction

The Image Passive Liveness API helps in detecting if a live person is present in front of the camera during the onboarding process. This API is useful for identifying any spoofing attacks by fraudsters. It is recommended to use this API in conjunction with the Signzy face match solution. This documentation provides details on how to call the API, input guidelines, sample responses, and other relevant information.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/image/passive_liveliness
```
:::

:::CodeblockTabs
UAT/Testing Endpoint

```text
POST https://api-preproduction.signzy.app/api/v3/image/passive_liveliness
```
:::

***

### Request Headers

| **Name**      | **Value**        | **Required** | **Description**                                                                                            |
| ------------- | ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory    | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory    | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Request body parameters

| **Parameter** | **Data Type** | **Description**                                                                                                                                                                                                           | **Required**   |
| ------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| image         | String        | Input image URL                                                                                                                                                                                                           | Mandatory      |
| strict        | Boolean       | To enable strict mode for the model. The default value is `false` (strict mode enforces more robust checks for liveliness, rejecting cases where the face is not very clear based on the given  image requirements below) | Optional<br /> |
| showQuality   | Boolean       | Optional boolean parameter (default: `false`). When set to `true`, the API response will include additional `quality` and `probability` scores along with the default output values.                                      |                |

:::CodeblockTabs
JSON

```json
{
    "image": "image-url"
}
```
:::

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api.signzy.app/api/v3/image/passive_liveliness' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Access-Token>' \
--data '{
    "image": "input-image-url"
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "image": "input-image-url"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.signzy.app/api/v3/image/passive_liveliness',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<Access-Token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api.signzy.app")
payload = json.dumps({
  "image": "input-image-url"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<Access-Token>'
}
conn.request("POST", "/api/v3/image/passive_liveliness", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.signzy.app/api/v3/image/passive_liveliness"
  method := "POST"

  payload := strings.NewReader(`{
    "image": "input-image-url"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<Access-Token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| **Parameter**      | **Data Type** | **Description**                                                                                                                                           |
| ------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result             | Object        | Contains the liveliness result of the input image.                                                                                                        |
| result.liveness    | Boolean       | "true" if the image is live else "false"                                                                                                                  |
| result.score       | Float         | LIveliness score of the input image. The value can be between 0 and 1.                                                                                    |
| result.quality     | Float         | Included in the response only when the showquality parameter is enabled in the request. Indicates the quality score of the provided image.                |
| result.probability | Float         | Included in the response only when the showquality parameter is enabled in the request. Represents the model’s probability score for the returned result. |
| status             | Integer       | It represents the HTTP status code                                                                                                                        |

:::CodeblockTabs
200

```json
{
    "result": {
        "liveness": false,
        "score": 0
    },
    "status": 200
}

// showQuality parameter set to true
{
    "result": {
        "liveness": false,
        "score": 0,
        "quality": 1,
        "probability": 0
    },
    "status": 200
}

// Face not detected
{
    "result": {
        "name": "error",
        "status": 400,
        "reason": "FACE_NOT_FOUND",
        "type": "Bad Request",
        "statusCode": 400
    },
    "status": 200
}

// Multiple face detected
{
    "result": {
        "name": "error",
        "status": 400,
        "reason": "MULTIPLE_FACES_DETECTED",
        "type": "Bad Request",
        "statusCode": 400
    },
    "status": 200
}
```

400

```json
{
    "error": {
        "statusCode": 400,
        "status": "Bad Request",
        "message": "\"requestBody.image\" must be a string",
        "id": "bb35334d-9495-46a9-88d0-10603acbaa33"
    }
}

// Empty input url
{
    "error": {
        "statusCode": 400,
        "status": "Bad Request",
        "message": "\"requestBody.image\" is not allowed to be empty",
        "id": "f0d34da6-858d-46d9-9ad6-7fa89fea5720"
    }
}

// File szie limit exceeded
{
    "error": {
        "message": "File size is greater than 5.000 MB",
        "name": "error",
        "status": 400,
        "reason": "Error",
        "type": "Bad Request",
        "statusCode": 400
    }
}

// Required field not sent
{
    "error": {
        "message": "\"image\" is required",
        "name": "error",
        "status": 400,
        "reason": "VALIDATION_ERROR",
        "type": "Bad Request",
        "statusCode": 400
    }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

409

```json
{
    "error": {
        "reason": "Error From Upstream",
        "status": 409,
        "message": "Upstream Down",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```
:::

***

### Document related constraints

:::hint{type="info"}
If **strict=true** is passed in the request then the strict liveliness check model will be used and to get the best results please follow the below-mentioned guidelines.

- The size of the document should not exceed&#x20;**&#x20;5 MB**.
- The image should be clicked in a well-lit room, with the face shown clearly to the camera. Extreme darkness/brightness on the face might result in the API behaving unexpectedly.
- The complete face should be clearly visible in the image. Tilted faces might result in API behaving unexpectedly.
- The minimum size of the detected face should be 224X224 pixels.
- Motion Blur might result in API behaving unexpectedly.
- Any occlusions on parts of the face like Glasses and masks should be removed while performing a Liveness Check.
- The detected Face should occupy at least 20% of the total image area.
- The image should be clicked as a selfie (portrait mode only).
- No image compression is highly recommended for accurate results.
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!
