# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.danaya.africa/documentation/integration-mode/rest-api/kyc/face-match.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
