> 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/id-document-verification.md).

# ID Document Verification

**Documents supported**

All the below listed documents are supported. You will have to send us the front and/or the back image of the document. The answer will be send to you via a webhook. You will have to provide us the url to call for the webhook.&#x20;

| Document            | Databases check |
| ------------------- | --------------- |
| **CNI (old)**       | ✅               |
| **CNI**             | ✅               |
| **Resident Card**   | ✅               |
| **Consular Card**   |                 |
| **Passport**        |                 |
| **Driving License** |                 |

<details>

<summary>Verify KYC Document images V1</summary>

<mark style="background-color:green;">POST /v1/clients-files/upload-files</mark>

**Headers:**

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

**Request Body:**

```json
{
  "selfie": "file",
  "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;

The response will correspond to a document analysis request. The response ID can be used to retrieve the analysis result later [see this page](/documentation/integration-mode/rest-api/retrieve-document-verification-result.md). The analysis result will also be sent via a webhook.

* **OK:**

  * Code: 200
  * Body

  ```json
  {
      "id": "6a278893-6458-473f-9418-e1169fc7b",
      "createdAt": "2024-06-10 16:02:37",
      "addedBy": {},
      "clientFilesToAnalyzeDocuments": [
          {
              "id": "57327f5c-f67b-46ab-ae51-a6a455781",
              "type": "CNI",
              "jsonContent": null,
              "analyzed": false,
              "analyzedAt": null,
              "filesToAnalyse": [
                  {
                      "id": "648790a1-582f-414d-a372-f50a27f093d5",
                      "documentName": "CNI_back_87d93462-4b40-4f29-87ab-bb29cc8e_cni_recto.jpeg",
                      "extractedContent": null
                  },
                  {
                      "id": "39797276-470e-4620-9070-b99289425813",
                      "documentName": "CNI_front_25e2a9fd-f6bf-4600-87a7-7c523920_cni_recto.jpeg",
                      "extractedContent": null
                  }
              ]
          }
      ]
  }
  ```
* &#x20;Code : 401
* Code: 400

</details>

<details>

<summary>Verify KYC Document images V2</summary>

<mark style="background-color:green;">POST /v2/clients-files/upload-files</mark>

The API accepts the following input parameters:

* **selfie**: A file representing the user's selfie image. This parameter is optional.
* **idDocumentFront** (required): A file containing the front side of the user's identification document.
* **idDocumentBack**: A file containing the back side of the user's identification document. This parameter is optional.
* **documentType** (required): Specifies the type of identification document. The available values are:
  * `CNI` (National ID Card)
  * `PASSEPORT` (Passport)
  * `CARTE_RESIDENT` (Resident Card)
  * `CARTE_CONSULAIRE` (Consular Card)
  * `PERMIS_CONDUIRE` (Driver’s License)
* **verificationsToApply**: An array specifying the types of verifications to be applied. The available values are:

  * `DB_CHECK`
  * `MRZ_CHECK`
  * `EXPIRATION_CHECK`
  * `FACE_MATCH_CHECK`
  * `PEP_CHECK`
  * `SANCTION_CHECK`
  * `MEDIA_CHECK`
  * `TEMPLATE_CHECK`
  * `COMPANY_DB_CHECK`

  If `verificationsToApply` is not defined or an empty array, all verifications configured on the company's account will be applied by default.

**Headers:**

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

**Request Body:**

```json
{
  "selfie": "file",
  "idDocumentFront": "file", //(required)
  "idDocumentBack": "file",
  "externalId": "externalId in your system",
  "documentType": //(required) Available values : CNI, PASSEPORT, CARTE_RESIDENT, CARTE_CONSULAIRE, PERMIS_CONDUIRE 
  "verificationsToApply": []// Available values : DB_CHECK, MRZ_CHECK, EXPIRATION_CHECK, FACE_MATCH_CHECK, PEP_CHECK, SANCTION_CHECK, MEDIA_CHECK, TEMPLATE_CHECK, COMPANY_DB_CHECK
}
```

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

**Responses:**&#x20;

The response will correspond to a document analysis request. The response ID can be used to retrieve the analysis result later [see this page](/documentation/integration-mode/rest-api/retrieve-document-verification-result.md). The analysis result will also be sent via a webhook.

* **OK:**

  * Code: 200
  * Body

  ```json
  {
      "id": "6a278893-6458-473f-9418-e1169fc7b",
      "createdAt": "2024-06-10 16:02:37",
      "addedBy": {},
      "externalId": "39797276-470e-4620-9070-b99289425813",
      "clientFilesToAnalyzeDocuments": [
          {
              "id": "57327f5c-f67b-46ab-ae51-a6a455781",
              "type": "CNI",
              "jsonContent": null,
              "analyzed": false,
              "analyzedAt": null,
              "filesToAnalyse": [
                  {
                      "id": "648790a1-582f-414d-a372-f50a27f093d5",
                      "documentName": "CNI_back_87d93462-4b40-4f29-87ab-bb29cc8e_cni_recto.jpeg",
                      "extractedContent": null
                  },
                  {
                      "id": "39797276-470e-4620-9070-b99289425813",
                      "documentName": "CNI_front_25e2a9fd-f6bf-4600-87a7-7c523920_cni_recto.jpeg",
                      "extractedContent": null
                  }
              ]
          }
      ]
  }
  ```
* &#x20;Code : 401
* Code: 400

</details>
