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

# Face authentication

### **Setting up the webhook**

To configure the default webhook URL of a query template, navigate to the **Query Templates** menu on the CAF [Trust Platform](https://trust.caf.io/) and enter the desired template and edit the **Webhook** field.

> * *Each Query Template created in the CAF* [*Trust Platform*](https://trust.caf.io/profile-templates/profile-models) *will need a call-back URL assigned for the webhooks. This URL can be different across active templates or the same.*

{% hint style="info" %}
[*<mark style="color:blue;">**Webhook Tester**</mark>*](https://webhook.site/) *and* [***Request Bin***](https://requestbin.com/) *are useful tools for receiving webhook calls. You can use them to generate a webhook URL and use that URL for any Postman requests that require you to specify a webhook URL, then use the sites to inspect the content of any webhooks they received.*
{% endhint %}

### **Webhook notifications**

You will receive a notification via webhook on the following event:

* **Face authentication from web onboarding**

You will be notified each time face authentication is attempted, whether it is `true` or `false`.

### Webhook response parameters

| Name                                              | Type    | Description                                                                                           |
| ------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| tenant<mark style="color:red;">\*</mark>          | String  | Unique identifier of the tenant.                                                                      |
| onboardingId<mark style="color:red;">\*</mark>    | String  | Unique ID of the onboarding process.                                                                  |
| type<mark style="color:red;">\*</mark>            | String  | Type of webhook.                                                                                      |
| personId<mark style="color:red;">\*</mark>        | String  | Unique ID of the person undergoing authentication. (CPF)                                              |
| attemptId<mark style="color:red;">\*</mark>       | String  | Unique ID of the authentication attempt.                                                              |
| isMatch<mark style="color:red;">\*</mark>         | Boolean | Indicates whether there was a successful match between the face authentication and the person's data. |
| date<mark style="color:red;">\*</mark>            | String  | Date and time when the authentication occurred.                                                       |
| onboardingToken<mark style="color:red;">\*</mark> | String  | Token from the onboarding link.                                                                       |

#### Example webhook post:

```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/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.
