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

# List Campaigns

> Retrieve a list of all campaigns

# List Campaigns

Returns a list of all campaigns configured in your account. Campaigns represent different outreach initiatives like no-show recovery, patient reactivation, appointment reminders, and more.

## Request

```bash theme={null}
GET https://api.getdoppel.ai/api/v1/campaigns
```

### Headers

| Header          | Required | Description                    |
| --------------- | -------- | ------------------------------ |
| `Authorization` | Yes      | Bearer token with your API key |

### Query Parameters

| Parameter   | Type    | Default | Description                                       |
| ----------- | ------- | ------- | ------------------------------------------------- |
| `page`      | integer | 1       | Page number (1-indexed)                           |
| `limit`     | integer | 25      | Items per page (max: 500)                         |
| `clinic_id` | string  | -       | Filter by clinic UUID                             |
| `status`    | string  | -       | Filter by status: `active`, `paused`, `completed` |

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="campaigns" type="array">
      Array of campaign objects
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="meta" type="object">
  Pagination metadata
</ResponseField>

### Campaign Object

| Field         | Type   | Description                                              |
| ------------- | ------ | -------------------------------------------------------- |
| `id`          | string | Unique campaign ID                                       |
| `name`        | string | Campaign name                                            |
| `description` | string | Campaign description                                     |
| `type`        | string | Campaign type (e.g., `no_show_recovery`, `reactivation`) |
| `channel`     | string | Channel used: `voice`, `whatsapp`, or `multi`            |
| `status`      | string | Current status: `active`, `paused`, `completed`          |
| `clinic_id`   | string | Associated clinic UUID                                   |
| `created_at`  | string | When the campaign was created (ISO 8601)                 |
| `updated_at`  | string | Last update timestamp (ISO 8601)                         |
| `settings`    | object | Campaign configuration settings                          |

## Examples

### Basic Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.getdoppel.ai/api/v1/campaigns" \
    -H "Authorization: Bearer dpl_live_YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.getdoppel.ai/api/v1/campaigns', {
    headers: {
      'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
    }
  });
  const data = await response.json();
  ```

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

  response = requests.get(
      'https://api.getdoppel.ai/api/v1/campaigns',
      headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
  )
  data = response.json()
  ```
</CodeGroup>

### Filter Active Campaigns

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.getdoppel.ai/api/v1/campaigns?status=active" \
    -H "Authorization: Bearer dpl_live_YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.getdoppel.ai/api/v1/campaigns?status=active',
    {
      headers: {
        'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
      }
    }
  );
  ```

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

  response = requests.get(
      'https://api.getdoppel.ai/api/v1/campaigns',
      params={'status': 'active'},
      headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
  )
  ```
</CodeGroup>

### Filter by Clinic

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.getdoppel.ai/api/v1/campaigns?clinic_id=550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer dpl_live_YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.getdoppel.ai/api/v1/campaigns?clinic_id=550e8400-e29b-41d4-a716-446655440000',
    {
      headers: {
        'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
      }
    }
  );
  ```

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

  response = requests.get(
      'https://api.getdoppel.ai/api/v1/campaigns',
      params={'clinic_id': '550e8400-e29b-41d4-a716-446655440000'},
      headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
  )
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "success": true,
  "data": {
    "campaigns": [
      {
        "id": "camp_abc123",
        "name": "No-Show Recovery",
        "description": "Reach out to patients who missed their appointments",
        "type": "no_show_recovery",
        "channel": "voice",
        "status": "active",
        "clinic_id": "550e8400-e29b-41d4-a716-446655440000",
        "created_at": "2024-01-01T00:00:00.000Z",
        "updated_at": "2024-01-15T10:30:00.000Z",
        "settings": {
          "max_attempts": 3,
          "retry_interval_hours": 24,
          "call_window_start": "09:00",
          "call_window_end": "18:00"
        }
      },
      {
        "id": "camp_def456",
        "name": "Patient Reactivation",
        "description": "Re-engage patients who haven't visited in 6+ months",
        "type": "reactivation",
        "channel": "whatsapp",
        "status": "active",
        "clinic_id": "550e8400-e29b-41d4-a716-446655440000",
        "created_at": "2024-02-01T00:00:00.000Z",
        "updated_at": "2024-02-15T14:20:00.000Z",
        "settings": {
          "inactivity_threshold_days": 180,
          "message_template": "reactivation_v2"
        }
      },
      {
        "id": "camp_ghi789",
        "name": "Appointment Reminders",
        "description": "Send reminders 24h before appointments",
        "type": "appointment_reminder",
        "channel": "whatsapp",
        "status": "active",
        "clinic_id": "550e8400-e29b-41d4-a716-446655440000",
        "created_at": "2024-01-15T00:00:00.000Z",
        "updated_at": "2024-01-15T00:00:00.000Z",
        "settings": {
          "reminder_hours_before": 24,
          "allow_reschedule": true,
          "allow_cancel": true
        }
      }
    ]
  },
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 3,
    "total_pages": 1,
    "has_more": false
  },
  "request_id": "req_abc123xyz",
  "timestamp": "2024-01-15T10:30:00.000Z"
}
```

## Campaign Types

| Type                   | Description                              |
| ---------------------- | ---------------------------------------- |
| `no_show_recovery`     | Contact patients who missed appointments |
| `reactivation`         | Re-engage inactive patients              |
| `appointment_reminder` | Send appointment reminders               |
| `follow_up`            | Post-appointment follow-up               |
| `recall`               | Periodic health check reminders          |
| `custom`               | Custom campaign types                    |

## Use Cases

### List All Active Campaigns

```javascript theme={null}
async function getActiveCampaigns(apiKey) {
  const response = await fetch(
    'https://api.getdoppel.ai/api/v1/campaigns?status=active',
    {
      headers: { 'Authorization': `Bearer ${apiKey}` }
    }
  );
  const { data } = await response.json();
  return data.campaigns;
}
```

### Get Campaigns by Type

```python theme={null}
import requests

def get_campaigns_by_type(api_key, campaign_type):
    response = requests.get(
        'https://api.getdoppel.ai/api/v1/campaigns',
        headers={'Authorization': f'Bearer {api_key}'}
    )
    campaigns = response.json()['data']['campaigns']
    return [c for c in campaigns if c['type'] == campaign_type]

# Get all no-show recovery campaigns
no_show_campaigns = get_campaigns_by_type(
    'dpl_live_YOUR_API_KEY',
    'no_show_recovery'
)
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List Clinics" icon="hospital" href="/api-reference/clinics/list-clinics">
    Get clinic information for your campaigns.
  </Card>

  <Card title="List Interactions" icon="phone" href="/api-reference/interactions/list-interactions">
    View interactions generated by campaigns.
  </Card>
</CardGroup>
