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

# Face Comparison

> Compare two face images to determine whether they belong to the same person.

The Face Comparison endpoint uses biometric analysis to compare two face images and returns a confidence score indicating whether they depict the same individual. Use this for identity verification during onboarding or transaction approval.

## Endpoint

```
POST /api/onboarding/biometrics/face/comparison
```

## Request

### Headers

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

### Body Parameters

| Parameter   | Type   | Required | Description                                           |
| ----------- | ------ | -------- | ----------------------------------------------------- |
| `image_one` | string | Yes      | URL or base64-encoded string of the first face image  |
| `image_two` | string | Yes      | URL or base64-encoded string of the second face image |

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/biometrics/face/comparison" \
    -H "x-access-token: YOUR_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "image_one": "https://example.com/photo1.jpg",
      "image_two": "https://example.com/photo2.jpg"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://adhere-api.smartcomply.com/api/onboarding/biometrics/face/comparison",
    {
      method: "POST",
      headers: {
        "x-access-token": "YOUR_SECRET_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        image_one: "https://example.com/photo1.jpg",
        image_two: "https://example.com/photo2.jpg",
      }),
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://adhere-api.smartcomply.com/api/onboarding/biometrics/face/comparison",
      headers={
          "x-access-token": "YOUR_SECRET_KEY",
          "Content-Type": "application/json",
      },
      json={
          "image_one": "https://example.com/photo1.jpg",
          "image_two": "https://example.com/photo2.jpg",
      },
  )
  data = response.json()
  ```
</CodeGroup>

## Response

### 200 OK

| Field                | Type    | Description                                       |
| -------------------- | ------- | ------------------------------------------------- |
| `data.status`        | boolean | `true` if the faces match, `false` if they do not |
| `data.response_code` | string  | `"00"` indicates a successful comparison          |
| `data.message`       | string  | Human-readable match result                       |
| `data.confidence`    | integer | Match confidence percentage (0–100)               |

```json theme={null}
{
  "status": "success",
  "data": {
    "status": true,
    "response_code": "00",
    "message": "Face Match",
    "confidence": 100
  },
  "message": "Face comparison completed successfully"
}
```

A `data.status` of `false` indicates the faces do not match. Use `data.confidence` to apply your own threshold for acceptance (e.g., require `>= 80` for a positive match).

### 400 Bad Request

Returned when one or both image URLs are missing, inaccessible, or do not contain a detectable face.

```json theme={null}
{
  "status": "failed",
  "data": [],
  "message": "Could not process one or both images"
}
```

### 401 Unauthorized

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


## OpenAPI

````yaml POST /api/onboarding/biometrics/face/comparison
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: 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/comparison:
    post:
      tags:
        - Biometrics
      summary: Face Comparison
      operationId: faceComparison
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_url
                - selfie_url
              properties:
                image_url:
                  type: string
                  description: URL of the reference ID photo
                selfie_url:
                  type: string
                  description: URL of the selfie image
      responses:
        '200':
          description: Comparison successful
        '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

````