> 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-retrieve-a-lead-id.md).

# API - API call to fetch a Lead ID

## Create a new user

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

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

i = name of your instance

**You can search for the Lead ID by first name, last name, phone or email.**

**Body (below example in JSON)**

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

```

**Headers**

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

**Response**

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

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

{% endtab %}

{% tab title="400" %}

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

{% endtab %}
{% endtabs %}

**Example in Postman**

<figure><img src="/files/bc9cc97447ce9bdaf32c69899596e77ab3dcca3d" alt=""><figcaption></figcaption></figure>


---

# 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:

```
GET https://docs.sprinthub.com/en/topics/api/api-api-call-to-retrieve-a-lead-id.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
