> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-api/core-api/transaction-details/services/facial-biometrics.md).

# Facial Biometrics

Comparison of the submitted photo with the photo on official bases.

**Section**: `officialData`

**Required parameter:** `cpf`\
**Required files:** `selfie or document image containing a picture`

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

| Attribute    | Type   | Description                                                     |
| ------------ | ------ | --------------------------------------------------------------- |
| code         | String | Response code                                                   |
| confidence   | Number | Percentage of similarity of document face with official base    |
| probability  | String | Probability of authenticity of document face with official base |
| {% endtab %} |        |                                                                 |

{% tab title="Example" %}

```json
{
  "officialData": {
    "code": "01",
    "confidence": 0.9600528478622437,
    "probability": "Altíssima probabilidade"
  }
}
```

{% endtab %}

{% tab title="Possible Values" %}
**`code`**

| Code | Description                                                                                                               |
| ---- | ------------------------------------------------------------------------------------------------------------------------- |
| `01` | Success (comparison performed). `confidence`, `confidenceStatus` and `probability` are only returned when `code` is `01`. |
| `02` | Required attribute not informed (e.g. missing CPF)                                                                        |
| `03` | Image/source not applicable to the provider (e.g. provider only accepts selfie)                                           |
| `04` | Face not found in the provider's official databases                                                                       |
| `05` | Image quality/size error, or call failure ("face not found")                                                              |
| `06` | Invalid CPF (validated by the provider itself)                                                                            |
| `07` | Generic error / query failure (default value)                                                                             |

**`probability`**

Only returned when `code` is `01`.

| Value (API response)     | Description           |
| ------------------------ | --------------------- |
| Baixíssima probabilidade | Very low probability  |
| Baixa probabilidade      | Low probability       |
| Média probabilidade      | Medium probability    |
| Alta probabilidade       | High probability      |
| Altíssima probabilidade  | Very high probability |
| {% endtab %}             |                       |

{% tab title="Validations Rules" %}

| Rule                            | Description                                                                                                                             |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| government\_document\_available | Checks if the document is available in the Government base.                                                                             |
| government\_document\_approved  | Verifies the authenticity of the document with the Government's base.                                                                   |
| liveness\_manual\_revision      | This rule sends the selfie for manual anti-spoofing verification.                                                                       |
| is\_biometrics\_approved        | Checks whether the similarity of the selfie found in the database is below the confidence threshold configured in the profile template. |
| {% endtab %}                    |                                                                                                                                         |
| {% endtabs %}                   |                                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.caf.io/caf-api/core-api/transaction-details/services/facial-biometrics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
