# Face Query

## Query

<mark style="color:green;">`POST`</mark> `https://okaydocdemo.innov8tif.com/ekyc/api/innov-face/facequery/query`

This API enables the querying and match the facial image in database to check for existence

#### Request Body

| Name        | Type   | Description                                                       |
| ----------- | ------ | ----------------------------------------------------------------- |
| apiKey      | string | To be assigned by Innov8tif                                       |
| imageBase64 | string | Selfie image or portrait image in base64                          |
| imageFile   | string | Selfie image or portrait image                                    |
| groupName   | string | Group name that existed in database that matches the facial image |

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

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "zhiyan",
    "score": 0.0
}
```

{% endtab %}
{% endtabs %}

### Input Example in Postman

![](/files/-MjTistx9xCGGTsxyQqo)

{% hint style="warning" %}
Query facial image need to fulfill the [image requirement](https://api.innov8tif.com/okayface/image-requirements) for better accuracy
{% endhint %}

### Possible Responses

{% code title="When image is found in the group (database table)" %}

```
{
    "status": "success",
    "resultFound": true,
    "groupFound": true,
    "name": "zhiyan",
    "score": 0.0
}
```

{% endcode %}

{% code title="When group does exists but cannot find similar face" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": true
}
```

{% endcode %}

{% code title="When group does not exist" %}

```
{
    "status": "success",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}

{% code title="When no face detected in image" %}

```
{
    "status": "error",
    "message": "There is No Face Detected in Image",
    "resultFound": false,
    "groupFound": false
}
```

{% endcode %}

### Threshold

The score of the successful image found are listed below:

| Threshold Value   | Description Status |
| ----------------- | ------------------ |
| **Score** > 0.53  | Query Pass         |
| **Score** <= 0.53 | Query Fail         |

{% hint style="info" %}
The lower the score, the higher the confidence of the Face Search API comparing the face with the database.
{% endhint %}


---

# 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://api-old.innov8tif.com/okayface/face-search/face-query.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.
