---
title: "API Explorer / List leads"
description: "Instantly tool instantly-api-leads-list on looot: input fields, $0 per call, output shape, and code to run it with curl, JavaScript or Python."
sidebar:
  hidden: true
---

{/* Generated by scripts/generate-api-reference.mjs from data/api-reference.json. Do not edit. */}

:::note
Instantly acts on your own account here. Connect it first; see [Access](/concepts/access).
:::

This endpoint is a POST endpoint, instead of GET - a deviation from the REST APIs standards we’re following because of the complex arguments it accepts, which would be too hard to express through query parameters. Results are ordered by each lead's `id` field in ascending order (or by `contact` when distinct_contacts is true) so clients can paginate chronologically by reusing the cursor returned in `next_starting_after`. Leads created on or after October 15, 2025 respect this chronological ordering; older records may appear out of sequence when sorted by ID. Requires one of the following scopes: `leads:read`, `leads:all`, `all:read`, `all:all` Every field is optional; an empty body lists all leads visible to the workspace.

- **Tool id:** `instantly-api-leads-list`
- **Provider:** [Instantly](/providers/instantly)
- **Job:** [List outreach lead](/reference/jobs/outreach-lead-list) (`outreach.lead.list`)
- **Price:** $0 per call. A call that fails at the provider costs $0.

## Inputs

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign` | string | no | Campaign ID to filter leads. Example: "01a0abd0-8b15-7c60-831e-17bdca89a00f" |
| `contacts` | array | no | Array of emails the leads needs to have |
| `distinct_contacts` | boolean | no | Whether to return distinct contacts. Example: true |
| `enrichment_status` | number | no | Enrichment status to filter leads. Example: 1 |
| `esg_code` | string | no | ESG code to filter leads. Example: "1" |
| `excluded_ids` | array | no | Array of lead IDs to exclude |
| `filter` | string | no | Filter criteria for leads. For custom lead labels, use the `interest_status` field. Example: "FILTER_VAL_CONTACTED" |
| `ids` | array | no | Array of lead IDs to include |
| `in_campaign` | boolean | no | Whether the lead is in a campaign. Example: true |
| `in_list` | boolean | no | Whether the lead is in a list. Example: true |
| `is_website_visitor` | boolean | no | Whether the lead is a website visitor. Example: true |
| `limit` | integer | no | The number of items to return. Example: 10 |
| `list_id` | string | no | List ID to filter leads. |
| `organization_user_ids` | array | no | Array of organization user IDs to filter leads |
| `queries` | array | no |   |
| `search` | string | no | Search term matched against the lead's email and profile fields (first and last name, company, job title, and similar). Matches whole words, and the beginning of a field's value, "smith" finds "John Smith", "mith" does not. Provide `campaign` or `list_id` to also match inside values. Newly created or updated leads can take a few seconds to become searchable. Example: "John Doe" |
| `smart_view_id` | string | no | Smart view ID to filter leads. |
| `starting_after` | string | no | Forward pagination cursor. When distinct_contacts is false, provide the `id` value from the last lead of the previous page; when true, provide the lead's email. Example: "01a0abd0-9ab5-7c0d-b00a-f00a1adddcc4" |

## Output

The run's `result` holds the provider's answer. Signed in, `looot inspect instantly-api-leads-list` prints its fields.

## Run it

Every call needs your API token in `LOOOT_TOKEN`; [Sign in](/get-started/sign-in#use-the-token-in-scripts-and-agents) shows how to get one. Each run also needs a new idempotency key, so a retry never pays twice. With `wait: 30` the answer comes back inline when the run ends within 30 seconds. Otherwise you get the running run back: poll `GET /v1/runs/<runId>`.

Example input with placeholder values:

<CodeGroup>

```bash curl
curl -X POST "https://api.looot.ai/v1/runs" \
  -H "Authorization: Bearer $LOOOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"endpointId":"instantly-api-leads-list","input":{"limit":10,"filter":"FILTER_VAL_CONTACTED","search":"John Doe","in_list":true,"list_id":"<list_id>","campaign":"01a0abd0-8b15-7c60-831e-17bdca89a00f","esg_code":"1","in_campaign":true,"smart_view_id":"<smart_view_id>","starting_after":"01a0abd0-9ab5-7c0d-b00a-f00a1adddcc4","distinct_contacts":true,"enrichment_status":1,"is_website_visitor":true},"wait":30}'
```

```js JavaScript
const response = await fetch("https://api.looot.ai/v1/runs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LOOOT_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    endpointId: "instantly-api-leads-list",
    input: {
      limit: 10,
      filter: "FILTER_VAL_CONTACTED",
      search: "John Doe",
      in_list: true,
      list_id: "<list_id>",
      campaign: "01a0abd0-8b15-7c60-831e-17bdca89a00f",
      esg_code: "1",
      in_campaign: true,
      smart_view_id: "<smart_view_id>",
      starting_after: "01a0abd0-9ab5-7c0d-b00a-f00a1adddcc4",
      distinct_contacts: true,
      enrichment_status: 1,
      is_website_visitor: true,
    },
    wait: 30,
  }),
});
const run = await response.json();
console.log(run.status, run.result);
```

```python Python
import os
import uuid

import requests

response = requests.post(
    "https://api.looot.ai/v1/runs",
    headers={
        "Authorization": f"Bearer {os.environ['LOOOT_TOKEN']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "endpointId": "instantly-api-leads-list",
        "input": {
            "limit": 10,
            "filter": "FILTER_VAL_CONTACTED",
            "search": "John Doe",
            "in_list": True,
            "list_id": "<list_id>",
            "campaign": "01a0abd0-8b15-7c60-831e-17bdca89a00f",
            "esg_code": "1",
            "in_campaign": True,
            "smart_view_id": "<smart_view_id>",
            "starting_after": "01a0abd0-9ab5-7c0d-b00a-f00a1adddcc4",
            "distinct_contacts": True,
            "enrichment_status": 1,
            "is_website_visitor": True,
        },
        "wait": 30,
    },
    timeout=90,
)
run = response.json()
print(run["status"], run.get("result"))
```

</CodeGroup>

To let looot pick among every provider of this job instead, send `job:outreach.lead.list` as `endpointId`; see [the job page](/reference/jobs/outreach-lead-list).
