> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/api/api-api-call-to-list-leads-and-lead-fields/api-call-to-list-the-instances-leads-by-searching-for-a-specific-field.md).

# API - Call to list the instance's leads by searching for a specific field

## Introduction

Full endpoint: [https://sprinthub-api-master.sprinthub.app/](https://sprinthub-api-master.sprinthub.app/leads?i=instancia/leadsadvanced)[leadsadvanced](https://sprinthub-api-master.sprinthub.app/leads?i=instancia/leadsadvanced)[?i=instancia](https://sprinthub-api-master.sprinthub.app/leads?i=instancia/leadsadvanced)

i = name of your instance

Request type: <mark style="color:red;">**POST**</mark>

### JSON Example

**Body**

```
{
    "query": "{leads{id,fullname,email,whatsapp,mobile}}",
    "search": "teste@gmail.com"
}
```

#### Request Body

The request body will be in JSON format and must include two main fields: `query` and `search`.

1. **query**: This field specifies the information we want to retrieve about the leads. In the example below, we are interested in obtaining the fields `id`, `fullname`, `email`, `whatsapp` and `mobile`.
2. **search**: This field allows you to filter the results based on a search criterion. In the example, we are looking for a lead with the email `teste@gmail.com`.

### API call example

Let's now see how to make this API call using Postman:

```
{
    "data": {
        "leads": [
            {
                "id": 2059,
                "fullname": "Teste 2",
                "email": "teste@gmail.com",
                "whatsapp": null,
                "mobile": null
            }
        ]
    }
}
```

{% hint style="info" %}
If Search is not specified, the JSON will show all the fields from the query for some leads.
{% endhint %}

### Conclusion

In this article, we saw how to make an API call to obtain leads using SprintHub. We used a specific endpoint and a JSON request body to list leads and retrieve specific information. Try different search criteria to meet your specific needs.


---

# 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.sprinthub.com/en/topics/api/api-api-call-to-list-leads-and-lead-fields/api-call-to-list-the-instances-leads-by-searching-for-a-specific-field.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.
