> 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/topicos/api/api-chamada-api-para-buscar-o-id-de-um-lead.md).

# API - Chamada API para buscar o ID de um Lead

## Create a new user

<mark style="color:green;">`POST`</mark> `/leadsadvanced`

Endpoint completo: <https://sprinthub-api-master.sprinthub.app/leadsadvanced?i=instancia>

i = nome da sua instância

**Você pode buscar o ID do Lead pelo nome, sobrenome, telefone ou e-mail.**

**Body (abaixo exemplo em JSON)**

```javascript
{
  "query": "{leads{id,fullname}}",
  "page": 0,
  "limit": 15,
  "search": "551131818777"
}

```

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |
| apitoken      | XXXXXXX            |

**Resposta**

{% tabs %}
{% tab title="200" %}

```json
{
    "data": {
        "leads": [
            {
                "id": 8473,
                "fullname": "Marco Giroto"
            }
        ]
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

**Exemplo no Postman**

<figure><img src="https://3534414179-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2Fqv37LxPJ5OrQnKAjV1j8%2FCaptura%20de%20Tela%202024-04-02%20a%CC%80s%2014.33.13.png?alt=media&amp;token=b04d1860-ac22-4db9-a4fc-3409286205ef" alt=""><figcaption></figcaption></figure>
