> ## 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 Lead Operations: Inputs, Cost & CLI Example

> Listing leads in an Instantly campaign to verify push worked. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=instantly_list_leads:{}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                     | Type      | Required | Default | Description                            |
| ------------------------ | --------- | -------- | ------- | -------------------------------------- |
| `payload.campaign`       | `string`  | No       |         | Campaign ID to filter leads by.        |
| `payload.campaign_id`    | `string`  | No       |         | Alias for campaign.                    |
| `payload.list_id`        | `string`  | No       |         | Lead list ID to filter by.             |
| `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       |         |                                        |
| `payload.starting_after` | `string`  | No       |         |                                        |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "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 Schema

| Name                         | Type     | Required | Default | Description |
| ---------------------------- | -------- | -------- | ------- | ----------- |
| `result.items`               | `array`  | Yes      |         |             |
| `result.next_starting_after` | `string` | No       |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "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>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute instantly_list_leads --payload '{}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > 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`

  ## 137. Merge two leads

  Source: https://developer.instantly.ai/api-reference/lead/merge-two-leads.md
  ```
</details>

## Cost

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