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

# Export Campaign Data

> Export campaign data as an Excel (.xlsx) file with optional filters.

Use this endpoint to **export campaign data as an Excel file** (.xlsx) with optional filters.

## Endpoint

**GET** `/export-campaign-data`

**Authentication:** Required (workspace auth)

## Query Parameters

| Parameter         | Type            | Required | Description                                         |
| ----------------- | --------------- | -------- | --------------------------------------------------- |
| `agent_id`        | number \| array | No       | Filter by agent ID(s)                               |
| `campaign_name`   | string          | No       | Partial name search (LIKE)                          |
| `campaign_status` | string \| array | No       | Filter by status. Defaults to all except `deleted`. |
| `date_range`      | string          | No       | Date range filter                                   |

## Campaign Status Values

| Status            | Description                  |
| ----------------- | ---------------------------- |
| `draft`           | Campaign is in draft mode    |
| `inprogress`      | Campaign is actively running |
| `hold`            | Campaign is on hold          |
| `pause`           | Campaign is paused           |
| `force_completed` | Campaign was force completed |

## Response

Returns an Excel file (`.xlsx`) with the following columns:

| Column          | Description                   |
| --------------- | ----------------------------- |
| ID              | Campaign identifier           |
| Campaign Name   | Name of the campaign          |
| Description     | Campaign description          |
| Agent Name      | Associated agent name         |
| Start Date      | Campaign start date           |
| End Date        | Campaign end date             |
| Status          | Campaign status label         |
| Max Retry       | Maximum retry attempts        |
| Max Delay       | Delay between retries         |
| Total Audience  | Total audience count          |
| Called Audience | Number of audiences called    |
| Created By      | User who created the campaign |
| Created Date    | Campaign creation date        |
| Updated Date    | Last update date              |

## Notes

* The response is a binary Excel file stream, not JSON.
* Set your HTTP client to handle binary/file responses.
* If no `campaign_status` is provided, all statuses except `deleted` are included.
* Date filter applies to `CREATED_DATE` of the campaign.

## Example cURL

```bash theme={null}
curl -X GET "https://www.tryunleashx.com/api/v1/global/export-campaign-data?campaign_status=inprogress&agent_id=5" \
  -H "token: <api_key>" \
  -o campaign_data.xlsx
```


## OpenAPI

````yaml api-reference/openapi.json GET /export-campaign-data
openapi: 3.1.0
info:
  title: >-
    UnleashX - Build human like conversations | Voice Agents | Automations | AI
    Workforce
  version: 1.0.0
  description: UnleashX - Your home for human like conversations
servers:
  - url: https://www.tryunleashx.com/api/v1/global/
security:
  - bearerAuth: []
paths:
  /export-campaign-data:
    get:
      tags:
        - Campaigns
      summary: Export campaign data
      description: Export campaign data as an Excel (.xlsx) file with optional filters.
      parameters:
        - name: token
          in: header
          required: true
          description: API token for authentication
          schema:
            type: string
        - name: agent_id
          in: query
          required: false
          schema:
            type: integer
          description: Filter by agent ID
        - name: campaign_name
          in: query
          required: false
          schema:
            type: string
          description: Partial name search (LIKE)
        - name: campaign_status
          in: query
          required: false
          schema:
            type: string
            enum:
              - draft
              - inprogress
              - hold
              - pause
              - force_completed
          description: >-
            Filter by status. Valid values: draft, inprogress, hold, pause,
            force_completed. Defaults to all.
        - name: date_range
          in: query
          required: false
          schema:
            type: string
          description: Date range filter
      responses:
        '200':
          description: Excel file download
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````