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

# Face Liveness Check

> Verify that a submitted facial image belongs to a live person, not a photograph or pre-recorded video.

The Face Liveness Check endpoint analyzes a submitted selfie — recommended as a short video, though a single photo is also accepted — to confirm it shows a live person, not a spoofed replay (a photo of a photo, a screen recording, etc.). It scores liveness directly; it does not compare the submission against any other image.

Both a video and a still photo are genuinely scored for liveness, so a still image works too — but a short video is the recommended submission, since motion gives the liveness check more to work with. The endpoint detects which was submitted from the file itself.

## Endpoint

```
POST /api/onboarding/biometrics/face/liveliness_check/
```

## Request

### Headers

| Header | Value | Required |
| - | - | - |
| `x-access-token` | Your API secret key | Yes |
| `Content-Type` | `application/json` | Yes |

### Body Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `live_media` | string | Yes | URL of the short selfie video to check for liveness (recommended). Video formats: `.mp4`, `.mov`, `.webm`, `.avi`, `.m4v` — anything else is treated as a still image, which is also accepted. |

### Example

```bash cURL theme={null}
curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/biometrics/face/liveliness_check/" \
  -H "x-access-token: YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"live_media": "https://example.com/selfie_liveness.mp4"}'
```

## Response

> [!NOTE]
>
> The HTTP status is `200` whenever the check ran to completion, **regardless of whether liveness passed or failed** — a failed liveness attempt is a normal, successful check outcome, not an error. Read `status`/`data.status` in the body to get the real verdict; a `400` means the request itself couldn't be processed (missing field, unreadable file, authentication problem), not that liveness failed.

### 200 OK — liveness passed

| Field | Type | Description |
| - | - | - |
| `data.status` | boolean | `true` if liveness was detected, `false` otherwise |
| `data.detail` | string | Human-readable result |
| `data.response_code` | string | `"00"` on a pass, `"01"` on a fail |
| `data.confidence` | number | Raw confidence score (0–1) |
| `data.confidence_in_percentage` | number | Confidence as a percentage (0–100) |
| `data.liveness_passed` | boolean | The underlying pass/fail verdict — the same value `data.status` is derived from |
| `data.verification.status` | string | `"VERIFIED"` or `"NOT_VERIFIED"` |
| `data.verification.reference` | number | Internal record ID for this check |

```json theme={null}
{
  "status": "success",
  "data": {
    "status": true,
    "detail": "Liveliness Detected",
    "response_code": "00",
    "confidence": 0.968,
    "confidence_in_percentage": 96.8,
    "liveness_passed": true,
    "verification": {
      "status": "VERIFIED",
      "reference": 76981
    },
    "widget_info": {},
    "session": {}
  },
  "message": "Face Liveliness successful"
}
```

### 200 OK — liveness failed (still a successful check)

```json theme={null}
{
  "status": "failed",
  "data": {
    "status": false,
    "detail": "Liveliness Not Detected",
    "response_code": "01",
    "confidence": 0.452,
    "confidence_in_percentage": 45.2,
    "liveness_passed": false,
    "verification": {
      "status": "NOT_VERIFIED",
      "reference": 76982
    },
    "widget_info": {},
    "session": {}
  },
  "message": "Liveness check failed"
}
```

### 400 Bad Request

Returned when the request itself couldn't be processed — a missing `live_media` field, an unreachable/unreadable URL, or an unexpected error from the underlying check.

```json theme={null}
{
  "status": "failed",
  "data": [],
  "message": "live_media is required — provide the URL of the live selfie video or photo."
}
```

### 401 Unauthorized

```json theme={null}
{
  "status": "failed",
  "message": "Authentication credentials were not provided."
}
```


## OpenAPI

````yaml POST /api/onboarding/biometrics/face/liveliness_check/
openapi: 3.0.3
info:
  title: Adhere API
  description: >-
    Identity verification, credit checks, transaction monitoring, and loan fraud
    detection across Africa.
  version: 3.0.0
servers:
  - url: https://adhere-api.smartcomply.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Nigeria KYC
  - name: Kenya KYC
  - name: Ghana KYC
  - name: Rwanda KYC
  - name: Uganda KYC
  - name: Document Verification
  - name: Biometrics
  - name: Individual Credit
  - name: Business Credit
  - name: Transaction Monitoring
  - name: Transaction Screening
  - name: Transaction KYC
  - name: Loan Fraud
  - name: User Journey
paths:
  /api/onboarding/biometrics/face/liveliness_check/:
    post:
      tags:
        - Biometrics
      summary: Face Liveness Check
      operationId: faceLiveness
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - live_media
              properties:
                live_media:
                  type: string
                  description: >-
                    URL of the short selfie video to check for liveness
                    (recommended — supported formats .mp4, .mov, .webm, .avi,
                    .m4v). A still selfie photo is also accepted — anything that
                    isn't one of those video formats is treated as a still
                    image. Both a video and a still photo are genuinely scored
                    for liveness; the endpoint detects which was submitted from
                    the file itself.
      responses:
        '200':
          description: >-
            Liveness check ran to completion. Returned for both a pass and a
            fail — a failed liveness attempt is a normal, successful check
            outcome, not an error. Read data.status / data.liveness_passed for
            the real verdict.
          content:
            application/json:
              examples:
                livenessPassed:
                  summary: Liveness passed
                  value:
                    status: success
                    data:
                      status: true
                      detail: Liveliness Detected
                      response_code: '00'
                      confidence: 0.968
                      confidence_in_percentage: 96.8
                      liveness_passed: true
                      verification:
                        status: VERIFIED
                        reference: 76981
                      widget_info: {}
                      session: {}
                    message: Face Liveliness successful
                livenessFailed:
                  summary: Liveness failed (still HTTP 200)
                  value:
                    status: failed
                    data:
                      status: false
                      detail: Liveliness Not Detected
                      response_code: '01'
                      confidence: 0.452
                      confidence_in_percentage: 45.2
                      liveness_passed: false
                      verification:
                        status: NOT_VERIFIED
                        reference: 76982
                      widget_info: {}
                      session: {}
                    message: Liveness check failed
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              data:
                type: array
                items: {}
              message:
                type: string
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              message:
                type: string
                example: Authentication credentials were not provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: Your Adhere API secret key

````

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