# Face Match API (💲)

This API is used to verify a user who has already undergone KYC verification or Multiple KYC verification. It verifies the user's identity by comparing their face with the previously submitted documents, eliminating the need for the user to undergo KYC onboarding again. If the user is already verified, the API will prevent them from undergoing the verification process again.

{% hint style="info" %}
Method: POST

Authorization: Bearer Token

Parameter:

selfie\_image  (Image File) (\*Mandatory)
{% endhint %}

## Face Match/ Login Stels

1. Make a POST request to the URL[ ](<https://sdk.faceki.com/facelink/api/face-check&#xA;>)[https://sdk.faceki.com/facelink/api/face-check](<https://sdk.faceki.com/facelink/api/face-check&#xA;>)
2. Set the Authorization type to "Bearer Token" in the request header. You will need to generate a bearer token from /getToken API.
3. In the body of the request, including the user's selfie image file as a parameter named "selfie\_image". This parameter is mandatory.
4. Send the request to the API.
5. The API will perform a face match verification to check if the user's selfie matches the face on file for their account.
6. If the face match is successful, the API will log the user into their account.
7. If the face match fails, the API will not log the user in and will return an error message.

<figure><img src="/files/sp5zay482sHpSuk0mEHb" alt=""><figcaption><p>Select Bearer Token as Authorization using GetToken API</p></figcaption></figure>

<figure><img src="/files/WOvvMW4iHsg6zOz07Lj0" alt=""><figcaption><p>Select POST call, from-data and add selfie_image </p></figcaption></figure>

<mark style="color:green;">`POST`</mark> `https://sdk.faceki.com/facelink/api/face-check`

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \[token]     |
| Content-Type<mark style="color:red;">\*</mark>  | String | multipart/form-data |

#### Request Body

| Name                                            | Type  | Description                |
| ----------------------------------------------- | ----- | -------------------------- |
| selfie\_image<mark style="color:red;">\*</mark> | Image | <p>Upload image</p><p></p> |

{% tabs %}
{% tab title="200: OK " %}

````
```json
{
    "responseCode": 0,
    "data": {
        "face_verified": true,
        "all_face_ids": [
            "2f1ebdb7-e6d1-448e-9b2c-3ddfe97672d7"
        ],
        "kyc_records": [
            {
                "_id": "644b7cff16cc73de26ff9b9c",
                "kycResponse": {
                    "result": {
                        "documentNumber": "930813316",
                        "firstName": "Name",
                        "middleName": "Middle name",
                        "lastName": "Last name",
                        "fullName": "FIRST MIDDLE LAST NAME",
                        "fullName_local": "الاسم بالعربي",
                        "sex": "F",
                        "age": 29,
                        "dob": "1993/08/29",
                        "dob_day": 29,
                        "dob_month": 8,
                        "dob_year": 1993,
                        "expiry": "2024/08/18",
                        "expiry_day": 18,
                        "expiry_month": 8,
                        "expiry_year": 2024,
                        "daysToExpiry": 479,
                        "documentType": "I",
                        "documentSide": "DUAL",
                        "issuerOrg_full": "Bahrain",
                        "issuerOrg_iso2": "BH",
                        "issuerOrg_iso3": "BHR",
                        "nationality_full": "Bahrain",
                        "nationality_iso2": "BH",
                        "nationality_iso3": "BHR",
                        "internalId": "MRZ"
                    },
                    "confidence": {
                        "documentNumber": 0.994,
                        "firstName": 1,
                        "middleName": 1,
                        "lastName": 1,
                        "fullName": 1,
                        "fullName_local": 0.962,
                        "sex": 1,
                        "age": 1,
                        "dob": 1,
                        "dob_day": 1,
                        "dob_month": 1,
                        "dob_year": 1,
                        "expiry": 1,
                        "expiry_day": 1,
                        "expiry_month": 1,
                        "expiry_year": 1,
                        "daysToExpiry": 1,
                        "documentType": 1,
                        "documentSide": 1,
                        "issuerOrg_full": 1,
                        "issuerOrg_iso2": 1,
                        "issuerOrg_iso3": 1,
                        "nationality_full": 1,
                        "nationality_iso2": 1,
                        "nationality_iso3": 1,
                        "internalId": 1
                    },
                    "face": {
                        "isIdentical": true,
                        "confidence": "0.786"
                    },
                    "verification": {
                        "passed": true,
                        "result": {
                            "face": true,
                            "notexpired": true
                        }
                    },
                    "output": [],
                    "outputface": null,
                    "authentication": {
                        "score": 0.7,
                        "breakdown": {
                            "data_visibility": {
                                "passed": true
                            },
                            "image_quality": {
                                "passed": false,
                                "code": 112,
                                "reason": "Document image too small",
                                "severity": "low"
                            },
                            "feature_referencing": {
                                "passed": true
                            },
                            "exif_check": {
                                "passed": true
                            },
                            "publicity_check": {
                                "passed": true
                            },
                            "text_analysis": {
                                "passed": true
                            },
                            "biometric_analysis": {
                                "passed": true
                            },
                            "security_feature_check": {
                                "passed": true
                            },
                            "recapture_check": {
                                "passed": true
                            }
                        },
                        "warning": [
                            "Document image too small"
                        ]
                    },
                    "matchrate": 1,
                    "executionTime": 8.750682830810547,
                    "responseID": "581de82ea2ee0ed36b907113ea4dff15",
                    "quota": 2537,
                    "credit": 0,
                    "aml": [],
                    "vaultid": "vPpYZxjrDTSnC8MmDeFPNzvLvFghaAyy"
                },
                "livenessResponse": {
                    "success": true,
                    "transactionId": "5ab497ca82f54e93b311445740472fcd",
                    "profileId": "b0ca5a9f3c174591941ed41616a08472",
                    "reviewScore": 0,
                    "rejectScore": 0,
                    "decision": "accept",
                    "quota": 2538,
                    "credit": 0,
                    "executionTime": 0.653205889
                },
                "fullName": "First middle last name",
                "referenceId": "581de82ea2ee0ed36b907113ea4dff15",
                "documentId": "930813316",
                "DOB": "1993/08/29",
                "localName": "الاسم بالعربي",
                "country": "Bahrain",
                "countryCode": "BH",
                "countryCodeISO3": "BHR",
                "idFrontImage": "imagelink",
                "idBackImage": "imagelink",
                "status": "ACCEPTED",
                "deleteStatus": "ACTIVE",
                "companyId": "d2504fcc-a1bd-4f4c-9874-dec3706123b4",
                "selfieImage": "imagelink",
                "documentCropFaceImageUrl": "imagelink",
                "faceID": "2f1ebdb7-e6d1-448e-9b2c-3ddfe97672d7",
                "imageID": "ff56ce6a-0326-3eaa-92c4-345d4a80a2db",
                "difcCode": "",
                "link": "client",
                "deviceDetails": {
                    "ipAddress": "54.86.50.139",
                    "browserName": "Postman Desktop",
                    "osName": ""
                },
                "modifiedBy": "",
                "createdAt": "2023-04-28T07:59:59.799Z",
                "updatedAt": "2023-04-28T07:59:59.799Z",
                "__v": 0
            }
        ]
    }
}
```

````

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


---

# 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://kycdocv2.faceki.com/api-integration/verification-apis/face-match-api.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.
