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

# Campaigns

> List, inspect, send, schedule, and unschedule campaigns and read engagement stats with the client.campaigns resource in the Lettr Python SDK.

The `client.campaigns` resource gives you read access to campaigns plus lifecycle actions — send now, schedule, and unschedule. The SDK doesn't create campaigns yet. To create a draft from code, call the [create a campaign](https://docs.lettr.com/api-reference/campaigns/create-a-campaign.md) endpoint directly, then send or schedule it with the SDK. Editing and deleting campaigns happen in the dashboard.

Reads require an API key with the `campaigns:read` scope; actions require `campaigns:write`.

```python theme={null}
import lettr

client = lettr.Lettr("lttr_your_api_key")
```

## List Campaigns

```python theme={null}
page = client.campaigns.list(status="sent", per_page=50)
for campaign in page.campaigns:
    print(f"{campaign.name}: {campaign.status} — {campaign.stats.unique_opens} opens")
    print(campaign.sent_count)
```

> [card] [API Reference](https://docs.lettr.com/api-reference/campaigns/list-campaigns.md)
>
> GET /campaigns

## Get a Campaign

`get()` returns a `CampaignDetail` with the rendered `html_content` body. The `list`, `send`, `schedule`, and `unschedule` methods return the base `Campaign`, which does not carry `html_content`.

```python theme={null}
campaign = client.campaigns.get(page.campaigns[0].id)
print(campaign.subject)
print(campaign.html_content)
print(campaign.stats.clicks)
```

> [card] [API Reference](https://docs.lettr.com/api-reference/campaigns/show-a-campaign.md)
>
> GET /campaigns/{campaignId}

## List Campaign Events

Engagement events use cursor-based pagination:

```python theme={null}
events = client.campaigns.list_events(campaign.id, event_type="open")
for event in events.events:
    print(f"{event.timestamp} {event.event_type} {event.email}")
    print(event.target_link_url)  # for click events

if events.next_cursor:
    more = client.campaigns.list_events(campaign.id, cursor=events.next_cursor)
```

> [card] [API Reference](https://docs.lettr.com/api-reference/campaigns/list-campaign-engagement-events.md)
>
> GET /campaigns/{campaignId}/events

## Send / Schedule / Unschedule

```python theme={null}
# Dispatch a draft campaign immediately (asynchronous; transitions to "preparing")
client.campaigns.send(campaign.id)

# Schedule for future delivery — ISO 8601 string or a datetime; must be in the future.
# Calling schedule() again on a scheduled campaign reschedules it.
client.campaigns.schedule(campaign.id, scheduled_at="2026-06-01T09:00:00+00:00")

# Cancel a scheduled send, returning the campaign to draft
client.campaigns.unschedule(campaign.id)
```

The action methods return the updated `Campaign`, or `None` if the API omits the payload.

> [card] [Send](https://docs.lettr.com/api-reference/campaigns/send-a-campaign-now.md)
>
> POST /campaigns/{id}/send

> [card] [Schedule](https://docs.lettr.com/api-reference/campaigns/schedule-a-campaign.md)
>
> POST /campaigns/{id}/schedule

> [card] [Unschedule](https://docs.lettr.com/api-reference/campaigns/unschedule-a-campaign.md)
>
> POST /campaigns/{id}/unschedule

## What's Next

> [card] [Audience](https://docs.lettr.com/quickstart/python/audience.md)
>
> Manage the contacts campaigns send to

> [card] [API Reference](https://docs.lettr.com/api-reference/campaigns/list-campaigns.md)
>
> Full campaigns API reference


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