# 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 JSON 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 filtering 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

Now let's 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 fields from the query for some leads.
{% endhint %}

### Conclusion

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