> For the complete documentation index, see [llms.txt](https://docs.danaya.africa/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.danaya.africa/documentation/integration-mode/rest-api/kyc/face-match.md).

# Face match

This feature works with all identity documents that have a photo ID.

<details>

<summary>Verify Identity with a selfie and the provided ID document v1</summary>

<mark style="background-color:green;">POST v1/verification/face-match</mark>

**Headers:**

* &#x20;Api-Key (required): provided by Danaya
* Api-Secret (required): provided by Danaya
* Content-Type (required): multipart/form-data

**Request Body:**

```json
{
  "nni": "file", // Depreciated
  "personalImage": "file", // Depreciated (will be removed in a V2)
  "frontCNIImage": "file", // Depreciated (will be removed in a V2)
  "backCNIImage": "file", // Depreciated (will be removed in a V2)
  "selfie": "file", // Recommanded (will replace "personalImage" in a V2)
  "cniRecto": "file", // Front National ID image
  "cniVerso": "file", // Back National ID image
  "carteConsulaireRecto": "file", // Front Consular Card image
  "carteConsulaireVerso": "file", // Back Consular Card image
  "carteResidentRecto": "file", // Front Resident Card image
  "carteResidentVerso": "file", // Back Resident Card image
  "passport": "file" // Front Passport image
}
```

<mark style="color:red;">**⚠️ supported image files are: png, jpeg and jpg**</mark>

**Responses:**&#x20;

* **OK:**

  * Code: 200
  * Body

  ```json
  {
    "type": "FACE_MATCH",
    "faceMatched": true, // true if the score is > 80%
    "similarity": "string", // face matching score
    "comparedImageBase64": "string", // face detected in the provided document
    "faceMatchVerificationType": "GOVERNMENT" //OR OFFLINE; if the selfie is compared within the gov DB IMAGE --> GOVERNMENT, IF Compared with the photo on the ID Card --> OFFLINE
  }
  ```
* &#x20;Code : 401
* Code: 400

</details>

<details>

<summary>Verify Identity with a selfie and the provided ID document v2</summary>

<mark style="background-color:green;">POST v2/verification/face-match</mark>

**Headers:**

* &#x20;Api-Key (required): provided by Danaya
* Api-Secret (required): provided by Danaya
* Content-Type (required): multipart/form-data

**Request Body:** Front Consular Card image

```json
{
  "selfie": "file", // (required)
  "idDocumentFront": "file", //(required)
  "idDocumentBack": "file",
  "documentType": CNI/PASSPORT/...//(required)
}
```

<mark style="color:red;">**⚠️ supported image files are: png, jpeg and jpg**</mark>

**Responses:**&#x20;

* **OK:**

  * Code: 200
  * Body

  ```json
  {
                      "id": "dfe39085-5606-4ebb-bad0-66dae47af562",
                      "status": "EXECUTED",
                      "lastRunDate": "2024-10-11 10:07:48",
                      "type": "FACE_MATCH_CHECK",
                      "scoring": {
                          "type": "FaceMatch",
                          "faceMatched": false,
                          "similarity": "0",
                          "comparedImageBase64": null,
                          "faceMatchVerificationType": "GOVERNMENT" or "OFFLINE"
                      },
                      "clientFileDocumentId": 1255
                  }
  ```
* &#x20;Code : 401
* Code: 400

</details>
