# API - API call to list Leads and Lead Fields

## List all Leads

<mark style="color:green;">`GET`</mark> `/leads`

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

i = name of your instance

**Body (below example in JSON)**

````json
{
    "data": {
        "total": 1134,
        "leads": [
            {
                "id": 2035,
                "fullname": "noreply-spamdigest via TeamDev",
                "email": "dev@sprinthub.com"
            },
            {
```

````

**Headers**

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

## List only ONE specific Lead

<mark style="color:green;">`GET`</mark> `/leads/LEAD_ID`

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

```json
{
    "data": {
        "lead": {
            "id": 2065,
            "fullname": "BRKSUEDUTHSHbvncvbn werwerwe",
            "email": null
        }
    }
}
```

## List ALL fields of only ONE specific Lead

<mark style="color:green;">`GET`</mark> `/leads/LEAD_ID&`**allFields=1**

Full endpoint: [https://sprinthub-api-master.sprinthub.app/leads/2065?i=instance](https://sprinthub-api-master.sprinthub.app/leadsadvanced?i=instancia)&**allFields=1**

````json
{
    "data": {
        "lead": {
            "points": 0,
            "owner": null,
            "stage": null,
            "photoUrl": "https://sprinthub.s3.amazonaws.com/unnamed_png.PNG",
            "company": null,
            "userAccess": [],
            "departmentAccess": [],
            "ignoreSubDepartments": false,
            "firstname": "BRKSUEDUTHSHbvncvbn",
            "lastname": "werwerwe",
            "email": null,
            "phone": null,
            "whatsapp": null,
            "mobile": null,
            "address": null,
            "city": null,
            "state": null,
            "country": null,
            "zipcode": null,
            "timezone": null,
```
````

.

## List only SOME fields of only ONE specific Lead

<mark style="color:green;">`GET`</mark> `/leads/LEAD_ID`**\&query={lead{firstname,lastname,email,mobile}}**

Full endpoint: [https://sprinthub-api-master.sprinthub.app/leads/2065?i=instance](https://sprinthub-api-master.sprinthub.app/leadsadvanced?i=instancia)**\&query={lead{firstname,lastname,email,mobile}}**

```json
{
    "data": {
        "lead": {
            "firstname": "BRKSUEDUTHSHbvncvbn",
            "lastname": "werwerwe",
            "email": null,
            "mobile": null
        }
    }
}

```

.

{% hint style="info" %}
Because this is GRAPHQL, you will only be able to fetch specific fields from the Lead's fixed fields. To fetch customized fields, only by bringing everything with the parameter **\&allFields=1**
{% endhint %}


---

# Agent Instructions: 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-list-leads-and-lead-fields.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.
