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

> Retrieving aggregated campaign reporting data. 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=lemlist_get_campaign_reports:{"campaign_ids":"{{campaign_ids}}"}' --json
```

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

## Input Schema

| Name                   | Type              | Required | Default | Description                                          |
| ---------------------- | ----------------- | -------- | ------- | ---------------------------------------------------- |
| `payload.campaign_ids` | `string \| array` | Yes      |         | Campaign ID or IDs to include in report aggregation. |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Get campaign reports for one or many campaigns.",
    "properties": {
      "campaign_ids": {
        "description": "Campaign ID or IDs to include in report aggregation.",
        "anyOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      }
    },
    "required": [
      "campaign_ids"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name            | Type     | Required | Default | Description |
| --------------- | -------- | -------- | ------- | ----------- |
| `result.status` | `string` | Yes      |         |             |
| `result.result` | `array`  | Yes      |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string"
      },
      "result": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "_id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "createdAt": {
              "type": "string"
            },
            "status": {
              "type": "string"
            },
            "emailsSent": {
              "type": "integer"
            },
            "emailsOpened": {
              "type": "integer"
            },
            "emailsClicked": {
              "type": "integer"
            },
            "emailsReplied": {
              "type": "integer"
            },
            "emailsBounced": {
              "type": "integer"
            },
            "interested": {
              "type": "integer"
            }
          },
          "required": [
            "_id",
            "name",
            "createdAt",
            "status",
            "emailsSent",
            "emailsOpened",
            "emailsClicked",
            "emailsReplied",
            "emailsBounced",
            "interested"
          ],
          "additionalProperties": true
        }
      }
    },
    "required": [
      "status",
      "result"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Advanced: Direct CLI

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

```bash theme={null}
deepline tools execute lemlist_get_campaign_reports --payload '{
  "campaign_ids": "string"
}' --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}
  > Retrieves aggregated reports and statistics for one or multiple campaigns.

  # Get Campaign Reports

  export const SnippetObjectReference = ({objectName, objectPath = null}) => {
    const lowerCaseObjectName = objectName.toLowerCase();
    if (lowerCaseObjectName === 'lead' || lowerCaseObjectName === 'leads') {
      return &lt;Note>
          This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>. Make sure to also check the &lt;a href={`/api-reference/objects-definitions/${lowerCaseObjectName === 'lead' ? 'contact' : 'lead'}`}>{lowerCaseObjectName === 'lead' ? 'Contact' : 'Lead'} object&lt;/a> to understand the distinction between the two.
        &lt;/Note>;
    }
    return &lt;Note>
        This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>.
      &lt;/Note>;
  };

  &lt;SnippetObjectReference objectName="Report" objectPath="report" />

  It provides a convenient way to get export status and statistics across multiple campaigns in a single request.

  ## Multiple campaigns

  Pass multiple campaign IDs as a comma-separated list in the `campaignIds` parameter:

  ```bash  theme={"theme":"dracula"}
  https://api.lemlist.com/api/campaigns/reports?campaignIds=cam_123,cam_456,cam_789
  ```

  ## Response structure

  The response includes export status information similar to the [Get Campaign Export Status](/api-reference/endpoints/campaigns/get-campaign-export-status) endpoint, but can aggregate data across multiple campaigns.

  ## Use cases

  This endpoint is particularly useful for:

  * **Dashboard views**: Get stats for multiple campaigns at once
  * **Portfolio reporting**: Monitor performance across several outreach campaigns
  * **Batch processing**: Check export status for multiple campaigns initiated earlier

  &lt;Tip>
    This is more efficient than calling individual campaign endpoints when you need data from multiple campaigns.
  &lt;/Tip>

  ## Example

  &lt;CodeGroup>
    ```bash Single campaign theme={"theme":"dracula"}
    curl --request GET \
      --url 'https://api.lemlist.com/api/campaigns/reports?campaignIds=cam_A1B2C3D4E5F6G7H8I9' \
        --header 'Authorization: Basic &lt;encoded-value>'
    ```

    ```bash Multiple campaigns theme={"theme":"dracula"}
    curl --request GET \
      --url 'https://api.lemlist.com/api/campaigns/reports?campaignIds=cam_123,cam_456,cam_789' \
        --header 'Authorization: Basic &lt;encoded-value>'
    ```
  &lt;/CodeGroup>

  ## 07. Get Campaign Stats

  Source: https://developer.lemlist.com/api-reference/endpoints/campaigns/get-campaign-stats.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`.
