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

# Campaigns

> Create, list, and update draft campaigns.

The `campaigns` command lets you manage [campaigns](/docs/api-reference/create-campaign) in your Loops account.

## `create`

Create a new draft campaign. This also creates an empty email message — use [`email-messages update`](/docs/cli/email-messages#update) to set its subject, sender, preview text, and LMX content.

```bash theme={"dark"}
loops campaigns create --name "March product update"
```

Target the campaign at an [audience segment](/docs/cli/audience-segments) and schedule it to send at a specific time:

```bash theme={"dark"}
loops campaigns create \
  --name "March product update" \
  --audience-segment-id cln0y4p6r003yl70i1j2k3l4m \
  --schedule-at 2026-07-01T12:00:00Z
```

### Flags

| Flag                     | Short | Description                                                                                                                                                                                             |
| ------------------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name`                 | `-n`  | Campaign name <Badge color="red" size="sm">Required</Badge>                                                                                                                                             |
| `--audience-segment-id`  |       | [Audience segment](/docs/cli/audience-segments) ID to target. Pass `"null"` to clear.                                                                                                                        |
| `--campaign-group-id`    |       | [Campaign group](/docs/cli/campaign-groups) ID                                                                                                                                                               |
| `--mailing-list-id`      |       | Mailing list ID to target. Pass `"null"` to clear.                                                                                                                                                      |
| `--audience-filter-file` |       | Path to a JSON file with an ad-hoc audience filter. When an audience segment is also set, this filter is applied on top of the segment's own filter — contacts must match both. Pass `"null"` to clear. |
| `--schedule-at`          |       | Send at the given ISO 8601 timestamp (e.g. `2026-07-01T12:00:00Z`)                                                                                                                                      |
| `--schedule-now`         |       | Send immediately when published                                                                                                                                                                         |

## `get`

Get a campaign by ID.

```bash theme={"dark"}
loops campaigns get cln0y4p6r003yl70i1j2k3l4m
```

## `list`

List campaigns.

```bash theme={"dark"}
loops campaigns list
```

Pass `--pick` to filter the list interactively with [fzf](https://github.com/junegunn/fzf) and copy the selected campaign ID to your clipboard. Requires `fzf` to be installed and on your `PATH`.

```bash theme={"dark"}
loops campaigns list --pick
```

### Flags

| Flag         | Description                                                                                                      |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| `--pick`     | Interactively pick a campaign and copy its ID to the clipboard. Requires [fzf](https://github.com/junegunn/fzf). |
| `--per-page` | Results per page (10–50, default 20)                                                                             |
| `--cursor`   | Pagination cursor for a specific page                                                                            |

## `update`

Update a draft campaign.

```bash theme={"dark"}
loops campaigns update cln0y4p6r003yl70i1j2k3l4m --name "April product update"
```

Retarget an existing campaign at a [campaign group](/docs/cli/campaign-groups) and send it immediately when published:

```bash theme={"dark"}
loops campaigns update cln0y4p6r003yl70i1j2k3l4m \
  --campaign-group-id clr4c8t0v008yl70x3y4z5a6b \
  --schedule-now
```

### Flags

| Flag                     | Short | Description                                                                                                                                                                                             |
| ------------------------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name`                 | `-n`  | Campaign name                                                                                                                                                                                           |
| `--audience-segment-id`  |       | [Audience segment](/docs/cli/audience-segments) ID to target. Pass `"null"` to clear.                                                                                                                        |
| `--campaign-group-id`    |       | [Campaign group](/docs/cli/campaign-groups) ID                                                                                                                                                               |
| `--mailing-list-id`      |       | Mailing list ID to target. Pass `"null"` to clear.                                                                                                                                                      |
| `--audience-filter-file` |       | Path to a JSON file with an ad-hoc audience filter. When an audience segment is also set, this filter is applied on top of the segment's own filter — contacts must match both. Pass `"null"` to clear. |
| `--schedule-at`          |       | Send at the given ISO 8601 timestamp (e.g. `2026-07-01T12:00:00Z`)                                                                                                                                      |
| `--schedule-now`         |       | Send immediately when published                                                                                                                                                                         |


## Related topics

- [API Introduction](/docs/api-reference/intro.md)
- [Types of emails](/docs/types-of-emails.md)
- [Update a campaign](/docs/api-reference/update-campaign.md)
- [Get a campaign](/docs/api-reference/get-campaign.md)
- [Campaign groups](/docs/cli/campaign-groups.md)
