> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Biometrics with photo - Flows

> Verify identity in WhatsApp Flows

<Info>
  **Version:** always use the latest available version
</Info>

This agent lets you run a complete identity verification within **WhatsApp Flows**, combining photo liveness check, document validation, and facial comparison.

<Tip>
  This agent blocks the use of documents from the gallery or files, preventing fraud.
</Tip>

## Prerequisites

### ✅ Checklist to start without blockers

* You must have a verified WhatsApp account.
* You must have a **Terms and Conditions PDF** (public URL) to configure in the agent. **This is mandatory**.
* The user must be able to **take photos** from the chat (camera permissions must be enabled on the device).
* <u>Recommended:</u> define the handling flow if you enable **Human in the loop** (who reviews, response times, and what happens if there is no response).

## How does it work?

In less than 1 minute, the user completes the following steps:

<Steps>
  <Step title="Take a photo of their face">
    Using the front camera, the user takes a photo of their face. Access to the photo gallery or documents is blocked.
  </Step>

  <Step title="Capture photos of their identity document">
    **Front and back** photos of the identity document are requested to validate *validity and authenticity*. Access to the photo gallery or documents is blocked.
  </Step>

  <Step title="Automatic facial comparison">
    The system applies the 1:1 technique, comparing the photo with the image on the document (or with the official government source if enabled).
  </Step>
</Steps>

<Info>
  Threshold configuration, expiration, and error handling depend on each stage of the flow.
</Info>

## How is the agent composed?

The **Biometrics Agent (Flows)** is made up of three specialized agents:

1. **[Liveness check agent with WhatsApp Flows](/en/guides/integraciones/identidad/flows-liveness-agent)** - Validates the person's liveness via photo: confirms there is a single face, detects recaptures, and evaluates fraud attempt signals.
2. **[Document verification agent](/en/guides/integraciones/identidad/document-check-flows)** - Verifies the authenticity and validity of the document, detects recaptures, and evaluates fraud attempt signals.
3. **[Facial comparison agent](/en/guides/integraciones/identidad/facematch-agent)** - 1:1 facial comparison between the photo and the face from the document/government entity.
   As a result it delivers a match percentage and binary status (approved/rejected) according to the configured threshold.

<Tip>
  If you only need to implement part of the process (for example, document only), see the configuration in **[Agents by stage](/en/guides/integraciones/identidad/agents-by-stage)**.
</Tip>

## How to connect the integration?

<Frame caption="How to connect the Biometrics integration">
  <iframe width="100%" height="400" src="https://www.youtube.com/embed/b_hlkjk0pQs" title="Conectar Biometría" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
</Frame>

<Info>
  The **Flows** option is available only on **Business** and **Enterprise** plans.
</Info>

<Steps>
  <Step title="Open the platform">
    Use the Agent to create a biometrics flow, or select the **Identity validation** template.
    To start a flow from scratch, click Brain Studio in the sidebar.
  </Step>

  <Step title="Select Biometrics">
    In the toolbar you will see the **Biometrics** option. Click **Connect**.
  </Step>

  <Step title="Connect the integration">
    Once connected, you will see the **Biometrics** node. In the side panel, select **Biometrics with photo — Flows WhatsApp** from the **Select biometrics type** dropdown.
  </Step>

  <Step title="Configure outputs">
    This agent has **1 success output and 3 error outputs**. Each can route to:

    * Text input with a custom message.
    * Connect, only if you have this module.
  </Step>

  <Step title="Run tests">
    With the configuration you just set, run tests with the **Test** button.
  </Step>
</Steps>

<Info>
  <span style={{ fontWeight: 600 }}>Important</span>:
  The **"Terms and Conditions PDF" field is mandatory**.
  The document must explicitly include the use, storage, and handling of personal and biometric data.
  It must be presented and accepted **before starting the verification process**.
</Info>

## Configuration

### Success

<AccordionGroup>
  <Accordion title="Biometrics approved" icon="circle-check">
    Confirms that biometric verification succeeded.

    **Variable:** `biometricVerificationSuccess`

    **Response structure (JSON):**

    ```json theme={null}
    {
      "response_document_check_success": {
        "document_check": {
          "verified_fields": { "...": "Main document data" },
          "secondary_fields": { "...": "Secondary document data" },
          "details": { "...": "Document type details" },
          "image_quality_details": { "...": "Image quality details" },
          "images_extracted": { "...": "Images extracted from the document" },
          "gov_entity_fields": { "document_number": "Identity document number" }
        },
        "gov_entity_data": { "...": "Government entity data for the country" },
        "document_image_front_url": "Front document image URL",
        "document_image_back_url": "Back document image URL",
        "document_face_image_url": "Face photo from document URL"
      },
      "response_liveness_success": {
        "result": "true/false",
        "url_selfie_image": "URL of the photo used for liveness"
      },
      "result_facematch": {
        "facematch_result": "approved / decline",
        "facematch_confidence": "Match percentage (0-100)"
      },
      "reporte_de_biometria": {
        "report": "Biometric report URL (web)",
        "report_pdf": "Biometric report URL (PDF)"
      }
    }
    ```

    **Important fields:**

    * `response_document_check_success`: ID document information
    * `response_liveness_success`: Photo used for liveness
    * `result_facematch`: Facial comparison result
    * `reporte_de_biometria`: Report URLs (web and PDF)
  </Accordion>
</AccordionGroup>

### Errors

<AccordionGroup>
  <Accordion title="Biometrics rejected" icon="ban">
    Biometric verification could not be completed.

    **Variables:** `documentCheckError` · `livenessError`

    **Description:** The user's document could not be validated, or the user's liveness could not be detected.
  </Accordion>

  <Accordion title="Process abandoned" icon="door-open">
    The user left the process before completing it.

    **Variable:** `userExitProcess`
  </Accordion>

  <Accordion title="Process error" icon="triangle-exclamation">
    A problem occurred with the service.

    **Variable:** `serviceError`
  </Accordion>
</AccordionGroup>

## Report

By default a database called **"Biometrics Agent Report"** is created with the following fields:

| **Field**              | **Description**               |
| ---------------------- | ----------------------------- |
| Biometrics Code        | Unique process identifier     |
| Date and Time          | Verification timestamp        |
| Biometrics Result      | Final process status          |
| Identification Number  | User's document               |
| Identification Type    | Document type                 |
| First Names            | User's first names            |
| Last Names             | User's last names             |
| Date of Birth          | Date of birth                 |
| Phone                  | User's phone number           |
| Email                  | Email address                 |
| Liveness Check Result  | Liveness check status         |
| Selfie Photo           | URL of extracted photo        |
| Document Check Result  | Document validation status    |
| Front Document Photo   | URL of front image            |
| Back Document Photo    | URL of back image             |
| Face Photo on Document | URL of document face photo    |
| Government Entity      | Entity queried                |
| Facematch Result       | Facial match percentage       |
| Biometrics Report      | Web report URL                |
| Failure Description    | Error details (if applicable) |
| Observations           | Additional notes              |

<Info>
  The biometric report is available for download in **PDF** format and contains all the information detailed in the table.
</Info>

## How to customize the experience?

When you click the **Biometrics** node on the canvas, a side panel opens with the following configuration tabs.

<Tabs>
  <Tab title="General">
    Configure the number of retries and validation options for the complete experience.

    * **Maximum biometrics attempts** — defines how many times the user can retry the complete process (1, 2, or 3 attempts).
    * **Expiry date verification** — enables validation of the document's expiry date.
    * **Terms and conditions** — enables the terms acceptance screen before starting the process.
  </Tab>

  <Tab title="Validations">
    Define the minimum validation levels the user must pass for the process to be considered successful.

    | Parameter                 | Description                                                                       |
    | ------------------------- | --------------------------------------------------------------------------------- |
    | **Facial comparison**     | Minimum similarity percentage accepted between the selfie and the document photo. |
    | **Government validation** | Enables identity verification against the country's government entity.            |
    | **Human in the loop**     | Activates manual review by a human agent in low-confidence or ambiguous cases.    |
  </Tab>
</Tabs>

In Flows, you can customize only the **images** that appear on each screen; the rest of the flow copy is not editable.

<Note>
  **Fields marked with a yellow box** on the flow screens are customizable. The remaining texts cannot be modified.
</Note>

<Frame caption="General view of the liveness check flow in Flows: yellow boxes indicate customizable fields">
  <img src="https://mintcdn.com/jelouai/8_dobHuJBe-kbj6o/assets/images/integraciones/identidad/flows/Prueba_vida_flows.png?fit=max&auto=format&n=8_dobHuJBe-kbj6o&q=85&s=ec6a3fbec8846f07c85231ec4c63ec41" alt="General view of the biometrics flow in Flows with yellow boxes on the customizable fields" style={{ maxWidth: '100%' }} width="960" height="540" data-path="assets/images/integraciones/identidad/flows/Prueba_vida_flows.png" />
</Frame>

<Frame caption="General view of the document flow in Flows: only sections marked with yellow boxes are replaceable">
  <img src="https://mintcdn.com/jelouai/8_dobHuJBe-kbj6o/assets/images/integraciones/identidad/flows/document_flows.png?fit=max&auto=format&n=8_dobHuJBe-kbj6o&q=85&s=04c0e62aa6c69ee5788e6abb2bd58b3f" alt="General view of the document flow in Flows with yellow boxes on the customizable sections" style={{ maxWidth: '100%' }} width="960" height="540" data-path="assets/images/integraciones/identidad/flows/document_flows.png" />
</Frame>

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Does the agent respond if I don't enter data in any field?">
    Yes, the agent can respond because all fields have default values. However, **selecting the agent version is mandatory**; we recommend always selecting the latest available public version.
  </Accordion>

  <Accordion title="What documents are needed during the biometric process?">
    Photos of the **identity document from both sides** are required: front and back.
  </Accordion>

  <Accordion title="Is it possible to skip any step in this agent?">
    No. This agent is designed as a complete flow: **photo + document + facematch**. If you only need part of it (for example, document only), you must install the agents by stage.
  </Accordion>

  <Accordion title="Can I customize the texts in this agent?">
    No, you cannot modify the interaction texts. You can add messages, conditionals, and other customizations in your workflow on the canvas.
  </Accordion>

  <Accordion title="What happens if I enable 'Human in the Loop (HIL)'?">
    HIL is an add-on service with an additional cost.
    When active, some cases may go to **manual review** (for example, if the threshold is not reached or attempts are exhausted).
    In this agent, manual review is applied **after** document validation.
  </Accordion>

  <Accordion title="What security measures does this agent apply?">
    * **Encryption in transit and at rest**.
    * **Evidence recording** with hashes to ensure integrity.
    * **Access control** with roles (RBAC) and **MFA**.
  </Accordion>

  <Accordion title="How many attempts does the user have before being blocked?">
    It depends on your configuration:

    * **Maximum biometrics attempts** (`maxBiometricAttempts`): controls biometrics attempts.
  </Accordion>
</AccordionGroup>
