> 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.     |
| {% 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
