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

# Autenticação facial

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