> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Instantly: List Leads

> List leads in an Instantly campaign or list, or search all leads, for example to check that leads were added. Includes SDK V2 examples, schemas, and cost.

List leads in an Instantly campaign or list, or search all leads, for example to check that leads were added.

> [!NOTE]
>
> Tool ID: `instantly_list_leads`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'instantly_list_leads',
  {
    "campaign": "example",
    "campaign_id": "campaign_123",
    "list_id": "list_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute instantly_list_leads --input '{
  "campaign": "example",
  "campaign_id": "campaign_123",
  "list_id": "list_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "items": [
    {
      "email": "jane.doe@example.com"
    }
  ]
}
```

Use `deepline describe instantly_list_leads --json` for the latest machine-readable contract.

## Input reference

List leads in an Instantly campaign or globally.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.campaign` | `string` | No | — | Campaign ID to filter leads by. Minimum length: 1. |
| `payload.campaign_id` | `string` | No | — | Alias for campaign. Minimum length: 1. |
| `payload.list_id` | `string` | No | — | Lead list ID to filter by. Minimum length: 1. |
| `payload.in_campaign` | `boolean` | No | — | Filter leads that are in any campaign. |
| `payload.in_list` | `boolean` | No | — | Filter leads that are in any list. |
| `payload.search` | `string` | No | — | Search text for lead fields. |
| `payload.limit` | `integer` | No | — | Minimum: 1. Maximum: 100. |
| `payload.starting_after` | `string` | No | — | Minimum length: 1. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "List leads in an Instantly campaign or globally.",
    "properties": {
      "campaign": {
        "type": "string",
        "description": "Campaign ID to filter leads by.",
        "minLength": 1
      },
      "campaign_id": {
        "type": "string",
        "description": "Alias for campaign.",
        "minLength": 1
      },
      "list_id": {
        "type": "string",
        "description": "Lead list ID to filter by.",
        "minLength": 1
      },
      "in_campaign": {
        "type": "boolean",
        "description": "Filter leads that are in any campaign."
      },
      "in_list": {
        "type": "boolean",
        "description": "Filter leads that are in any list."
      },
      "search": {
        "type": "string",
        "description": "Search text for lead fields."
      },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "starting_after": {
        "type": "string",
        "minLength": 1
      }
    },
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Paginated Instantly lead list response.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.items` | `array` | Yes | — | — |
| `result.items[].email` | `string` | Yes | — | — |
| `result.items[].first_name` | `string` | No | — | — |
| `result.items[].last_name` | `string` | No | — | — |
| `result.items[].company_name` | `string` | No | — | — |
| `result.items[].lead_status` | `string` | No | — | — |
| `result.items[].custom_variables` | `record` | No | — | — |
| `result.next_starting_after` | `string` | No | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Paginated Instantly lead list response.",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "description": "Instantly lead record.",
          "properties": {
            "email": {
              "type": "string"
            },
            "first_name": {
              "type": "string"
            },
            "last_name": {
              "type": "string"
            },
            "company_name": {
              "type": "string"
            },
            "lead_status": {
              "type": "string"
            },
            "custom_variables": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "required": [
            "email"
          ],
          "additionalProperties": true
        }
      },
      "next_starting_after": {
        "type": [
          "string",
          "null"
        ]
      }
    },
    "required": [
      "items"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Instantly provider guide](https://deepline.com/docs/providers/instantly/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.