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

# List Campaigns

This endpoint retrieves a paginated list of all campaigns for your organization. Use filters to find specific campaigns by status, type, or assistant.

### Query Parameters

* `status` (string, optional): Filter by campaign status (`draft`, `scheduled`, `running`, `paused`, `completed`, `cancelled`, `failed`)
* `campaign_type` (string, optional): Filter by type (`call`, `sms`, `mixed`)
* `assistant_id` (integer, optional): Filter by assistant ID
* `search` (string, optional): Search by campaign name or description
* `page` (integer, optional, default: 1): Page number for pagination
* `per_page` (integer, optional, default: 50, max: 1000): Number of results per page

### Response

Returns a paginated list of campaigns with basic metrics.

```json Response theme={null}
{
  "campaigns": [
    {
      "id": 1,
      "name": "Q1 Appointment Reminders",
      "description": "Reminder calls for January appointments",
      "campaign_type": "call",
      "status": "completed",
      "assistant_id": 123,
      "assistant_name": "Appointment Bot",
      "total_contacts": 500,
      "completed_contacts": 485,
      "failed_contacts": 15,
      "created_at": "2024-01-15T10:00:00Z",
      "started_at": "2024-01-16T09:00:00Z",
      "completed_at": "2024-01-16T14:30:00Z",
      "metrics": {
        "success_rate": 97.0,
        "answer_rate": 85.0,
        "average_duration_seconds": 45,
        "total_duration_seconds": 21825,
        "actual_cost": 12.50
      }
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total_items": 1,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false
  }
}
```

### Example Request

```bash cURL theme={null}
curl -X GET "https://api.burki.dev/api/v1/campaigns?status=running&page=1&per_page=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://api.burki.dev/api/v1/campaigns",
    params={"status": "running", "page": 1, "per_page": 20},
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

campaigns = response.json()
for campaign in campaigns["campaigns"]:
    print(f"{campaign['name']}: {campaign['status']}")
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://api.burki.dev/api/v1/campaigns?status=running&page=1&per_page=20",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

const data = await response.json();
data.campaigns.forEach(campaign => {
  console.log(`${campaign.name}: ${campaign.status}`);
});
```
