> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla/people/get-by-phone.md).

# Get by Phone

The Get Person by Phone operation finds a person record in your contacts database using a phone number as the search criterion.

This action is essential for automations that originate from a phone interaction or messaging channels like WhatsApp, SMS, or Telegram. Upon receiving a communication, you can use the sender's number to fetch the contact's full profile in Hablla and personalize the rest of the flow.

If a contact with the specified phone is found, the operation returns the complete person object. Otherwise, the result will be empty.

#### How to Configure

1. In Hablla Studio, add the "People" block to your automation flow.
2. In the "Operation" field, select the "Get by Phone" option.
3. In the "Phone" field (`phone`), enter the phone number you want to use for the search. This value can be a fixed text or a variable coming from a trigger.

***

### Parameters

| Field           | Type | Required? | Description                                                                                                           |
| --------------- | ---- | --------- | --------------------------------------------------------------------------------------------------------------------- |
| Phone (`phone`) | Text | ✅ Yes     | The exact phone number of the person to be located. The international format is recommended (e.g.: `+5511999998888`). |

Export to Spreadsheets

***

### Output Structure (Example Result)

If a person is found, the result will be a JSON object with a structure similar to the "Get by ID" operation.

JSON

```
{
  "id": "person_abcdef123456",
  "name": "Ricardo Mendes",
  "customer_status": "opportunity",
  "is_blocked": false,
  "created_at": "2023-11-05T14:00:00Z",
  "phones": [
    {
      "type": "personal",
      "phone": "+5511999998888",
      "is_whatsapp": true
    }
  ],
  "emails": [
    {
      "email": "ricardo.mendes@example.com"
    }
  ]
}
```

***

### 🚀 Example Use Case

Goal: When a customer sends a message to the company's WhatsApp, fetch their record in Hablla and route the conversation to the salesperson responsible for them.

1. Create a flow that starts with a "New Message Received" trigger from your WhatsApp connector. The trigger will provide the sender's number (`trigger.sender.phone`).
2. Add the "People" block with the "Get by Phone" operation.
3. In the "Phone" field, enter the sender number variable: `{{trigger.sender.phone}}`.
4. Add a Condition (If) block to check if a person was found (`{{steps.2.result.id}}` is not empty).
   * If Yes: Use the "Get User by ID" operation to fetch the responsible user's data (`{{steps.2.result.users[0].id}}`) and then transfer the conversation to them.
   * If No: Create a new person with the "Create Person" operation and route the conversation to the general triage queue.

With this automation, you provide immediate and personalized service, as the system recognizes the customer and directs them to the right person without manual intervention.


---

# 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.hablla.com/hablla-docs-en/automation-flows/all-components/hablla/people/get-by-phone.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.
