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

# Lemlist: Get Campaigns Campaignid Export Leads

> Export Campaign Leads (legacy). Includes SDK V2 and CLI requests, input constraints, response fields, and Deepline credit cost.

Export Campaign Leads (legacy).

<Info>
  Tool ID: `lemlist_get_campaigns_campaignid_export_leads`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_get_campaigns_campaignid_export_leads',
  {
    "campaignId": "campaign_123"
  },
);

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

### CLI

```bash theme={null}
deepline tools execute lemlist_get_campaigns_campaignid_export_leads --input '{
  "campaignId": "campaign_123"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": [
    {
      "emailStatus": "deliverable",
      "email": "jane.doe@example.com",
      "firstName": "Jane"
    }
  ]
}
```

Use `deepline tools get lemlist_get_campaigns_campaignid_export_leads --json` for the latest machine-readable contract.

## Input reference

Export leads from a campaign with filtering options. Returns leads in CSV or JSON format based on their state (e.g., contacted, interested, replied, etc.).

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.campaignId` | `string` | Yes | — | The unique identifier of the campaign |
| `payload.state` | `"all" \| "imported" \| "scanned" \| "skipped" \| "reviewed" \| "contacted" \| "hooked" \| "attracted" \| "warmed" \| "interested" \| "notInterested" \| "emailsBounced" \| "emailsUnsubscribed" \| "failed" \| "meetingBooked" \| "paused" \| "emailsSent" \| "emailsOpened" \| "emailsClicked" \| "emailsReplied" \| "emailsInterested" \| "emailsNotInterested" \| "emailsFailed" \| "opportunitiesDone" \| "aircallDone" \| "aircallInterested" \| "aircallNotInterested" \| "apiDone" \| "apiInterested" \| "apiNotInterested" \| "linkedinVisitDone" \| "linkedinVisitFailed" \| "linkedinInviteDone" \| "linkedinInviteAccepted" \| "linkedinInviteFailed" \| "linkedinSent" \| "linkedinOpened" \| "linkedinReplied" \| "linkedinInterested" \| "linkedinNotInterested" \| "linkedinSendFailed" \| "manualInterested" \| "manualNotInterested"` | No | `"all"` | Filter to export only the specified lead's last states. Use 'all' to export all states. Can be a comma-separated list of states. **Global states**: imported, scanned, skipped, reviewed, contacted, hooked, attracted, warmed, interested, notInterested, emailsBounced, emailsUnsubscribed, failed, meetingBooked, paused. **Detailed states**: emailsSent, emailsOpened, emailsClicked, emailsReplied, emailsInterested, emailsNotInterested, emailsFailed, opportunitiesDone, aircallDone, aircallInterested, See the live schema for the complete constraint. |
| `payload.format` | `"json" \| "csv"` | No | — | Output format: 'json' or 'csv'. Default is CSV. Allowed: `json`, `csv`. |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Export leads from a campaign with filtering options. Returns leads in CSV or JSON format based on their state (e.g., contacted, interested, replied, etc.).",
    "properties": {
      "campaignId": {
        "type": "string",
        "description": "The unique identifier of the campaign"
      },
      "state": {
        "type": "string",
        "description": "Filter to export only the specified lead's last states. Use 'all' to export all states. Can be a comma-separated list of states. **Global states**: imported, scanned, skipped, reviewed, contacted, hooked, attracted, warmed, interested, notInterested, emailsBounced, emailsUnsubscribed, failed, meetingBooked, paused. **Detailed states**: emailsSent, emailsOpened, emailsClicked, emailsReplied, emailsInterested, emailsNotInterested, emailsFailed, opportunitiesDone, aircallDone, aircallInterested, aircallNotInterested, apiDone, apiInterested, apiNotInterested, linkedinVisitDone, linkedinVisitFailed, linkedinInviteDone, linkedinInviteAccepted, linkedinInviteFailed, linkedinSent, linkedinOpened, linkedinReplied, linkedinInterested, linkedinNotInterested, linkedinSendFailed, manualInterested, manualNotInterested",
        "default": "all",
        "enum": [
          "all",
          "imported",
          "scanned",
          "skipped",
          "reviewed",
          "contacted",
          "hooked",
          "attracted",
          "warmed",
          "interested",
          "notInterested",
          "emailsBounced",
          "emailsUnsubscribed",
          "failed",
          "meetingBooked",
          "paused",
          "emailsSent",
          "emailsOpened",
          "emailsClicked",
          "emailsReplied",
          "emailsInterested",
          "emailsNotInterested",
          "emailsFailed",
          "opportunitiesDone",
          "aircallDone",
          "aircallInterested",
          "aircallNotInterested",
          "apiDone",
          "apiInterested",
          "apiNotInterested",
          "linkedinVisitDone",
          "linkedinVisitFailed",
          "linkedinInviteDone",
          "linkedinInviteAccepted",
          "linkedinInviteFailed",
          "linkedinSent",
          "linkedinOpened",
          "linkedinReplied",
          "linkedinInterested",
          "linkedinNotInterested",
          "linkedinSendFailed",
          "manualInterested",
          "manualNotInterested"
        ]
      },
      "format": {
        "type": "string",
        "description": "Output format: 'json' or 'csv'. Default is CSV.",
        "enum": [
          "json",
          "csv"
        ]
      }
    },
    "required": [
      "campaignId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `array` | Yes | — | Provider response payload. |
| `result.data[].emailStatus` | `"deliverable" \| "risky" \| "undeliverable"` | No | — | Allowed: `deliverable`, `risky`, `undeliverable`. |
| `result.data[].email` | `string` | No | — | Format: `email`. |
| `result.data[].firstName` | `string` | No | — | — |
| `result.data[].lastName` | `string` | No | — | — |
| `result.data[].picture` | `string` | No | — | — |
| `result.data[].phone` | `string` | No | — | — |
| `result.data[].linkedinUrl` | `string` | No | — | — |
| `result.data[].timezone` | `string` | No | — | — |
| `result.data[].companyName` | `string` | No | — | — |
| `result.data[].companyDomain` | `string` | No | — | — |
| `result.data[].icebreaker` | `string` | No | — | — |
| `result.data[].jobTitle` | `string` | No | — | — |
| `result.data[].lastState` | `string` | No | — | — |
| `result.data[].status` | `string` | No | — | — |
| `result.data[]._id` | `string` | No | — | — |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "array",
        "description": "Provider response payload.",
        "items": {
          "type": "object",
          "properties": {
            "emailStatus": {
              "type": "string",
              "enum": [
                "deliverable",
                "risky",
                "undeliverable"
              ]
            },
            "email": {
              "type": "string",
              "format": "email"
            },
            "firstName": {
              "type": "string"
            },
            "lastName": {
              "type": "string"
            },
            "picture": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "linkedinUrl": {
              "type": "string"
            },
            "timezone": {
              "type": "string"
            },
            "companyName": {
              "type": "string"
            },
            "companyDomain": {
              "type": "string"
            },
            "icebreaker": {
              "type": "string"
            },
            "jobTitle": {
              "type": "string"
            },
            "lastState": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "_id": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "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

* [Lemlist provider guide](/docs/providers/lemlist/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


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