> 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/caf-api-pt-br/api-core/webhooks/face-authentication.md).

# Autenticação facial

Os webhooks de autenticação facial são usados para comunicar a autenticação entre o cliente e o servidor.

### **Configurando o webhook**

Para configurar a URL padrão do webhook de um modelo de consulta, navegue até o **Modelos de Consulta** menu no CAF [Trust Platform](https://trust.caf.io/) e selecione o modelo desejado e edite o **Webhook** campo.

> * *Cada Modelo de Consulta criado no CAF* [*Trust Platform*](https://trust.caf.io/profile-templates/profile-models) *precisará de uma URL de callback atribuída para os webhooks. Essa URL pode ser diferente entre os modelos ativos ou a mesma.*

{% hint style="info" %}
[*<mark style="color:azul;">**Testador de Webhook**</mark>*](https://webhook.site/) *e* [***Request Bin***](https://requestbin.com/) *são ferramentas úteis para receber chamadas de webhook. Você pode usá-las para gerar uma URL de webhook e usar essa URL em quaisquer requisições do Postman que exijam que você especifique uma URL de webhook; em seguida, use os sites para inspecionar o conteúdo de quaisquer webhooks que eles tenham recebido.*
{% endhint %}

### **Notificações de webhook**

Você receberá uma notificação via webhook no seguinte evento:

* **Autenticação facial do onboarding web**

Você será notificado sempre que uma tentativa de autenticação facial for feita, seja ela `true` ou `falso`.

### Parâmetros de resposta do webhook

| Nome                                                   | Tipo     | Descrição                                                                                      |
| ------------------------------------------------------ | -------- | ---------------------------------------------------------------------------------------------- |
| tenant<mark style="color:vermelho;">\*</mark>          | String   | Identificador único do tenant.                                                                 |
| onboardingId<mark style="color:vermelho;">\*</mark>    | String   | ID único do processo de onboarding.                                                            |
| tipo<mark style="color:vermelho;">\*</mark>            | String   | Tipo de webhook.                                                                               |
| personId<mark style="color:vermelho;">\*</mark>        | String   | ID único da pessoa em processo de autenticação. (CPF)                                          |
| attemptId<mark style="color:vermelho;">\*</mark>       | String   | ID único da tentativa de autenticação.                                                         |
| isMatch<mark style="color:vermelho;">\*</mark>         | Booleano | Indica se houve correspondência bem-sucedida entre a autenticação facial e os dados da pessoa. |
| data<mark style="color:vermelho;">\*</mark>            | String   | Data e hora em que a autenticação ocorreu.                                                     |
| onboardingToken<mark style="color:vermelho;">\*</mark> | String   | Token do link de onboarding.                                                                   |

#### Exemplo de envio do webhook:

```json
{
  "tenant": "335dbb7c-xxxx-xxxx-xxxx-c559d3e4126a",
  "onboardingId": "xxxxxx1c9ca4d60008xxxxxx",
  "type": "face_authentication",
  "personId": "00011122233",
  "attemptId": "xxxxxx509be13997f6xxxxxx",
  "isMatch": true,
  "date": "2024-04-30T13:34:09.232Z",
  "onboardingToken": "xxxxxxd44a9ce15ce0b6d2cc63xxxxxx"
}
```


---

# 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/caf-api-pt-br/api-core/webhooks/face-authentication.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.
