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

# Campaigns

# Campaigns

A **campaign** combines an audience (segment), message (template), and **schedule** into one sendable unit. Every execution creates a **run** with delivery stats you can audit later.

**In the app:** [Campaigns](https://www.mailofly.com/user/campaigns)

***

## Campaign anatomy

| Component        | Required      | Purpose                           |
| ---------------- | ------------- | --------------------------------- |
| Title            | ✓             | Human-readable name               |
| Segment          | ✓ before send | Who receives mail                 |
| Template         | ✓ before send | Subject + HTML body               |
| Schedule         | ✓ before send | When/how sends trigger            |
| Sending accounts | Optional      | Override default account rotation |

A campaign is **incomplete** until segment, template, and schedule are all configured.

***

## Schedule types

| Type                         | Behavior                                                            | Plan      |
| ---------------------------- | ------------------------------------------------------------------- | --------- |
| **Manual**                   | You click "Send now" each time                                      | All plans |
| **Scheduled once**           | Sends at one datetime, then reverts to manual                       | Basic+    |
| **Recurring**                | Repeats every N days/weeks/months to the **whole segment**          | Basic+    |
| **Recurring (new contacts)** | Same interval, but only contacts **not yet sent** for this campaign | Basic+    |

<Warning>
  Scheduled and recurring campaigns require **Basic plan or higher** (`allow_automation`).
</Warning>

### Schedule configuration

* **Scheduled once:** set `scheduled_at` as ISO 8601 datetime
* **Recurring:** set `recurrence_interval` + `recurrence_unit` (`day`, `week`, `month`)

Automation runs via background cron — no server setup on your side.

***

## Send a campaign

### Manual send

1. Open the campaign → confirm segment + template are set
2. Click **Send now**
3. Optionally pick specific **sending accounts**
4. Mailofly creates a **campaign run** and queues `mail_logs` rows
5. Watch progress in **[Mail logs](mail-logs.md)** or **Runs** tab

### View runs

Each send creates a run at `/{org}/campaigns/{id}/runs`:

| Run data          | Shows                           |
| ----------------- | ------------------------------- |
| Started at        | When the send began             |
| Recipients queued | Total mail log rows created     |
| Status breakdown  | sent / failed / deferred counts |

***

## Daily quota & deferral

If today's send volume exceeds an account's daily limit, excess recipients are marked **deferred** and send the next calendar day.

Tips for large blasts:

* Attach multiple sending accounts
* Set conservative per-account daily limits during warmup
* Monitor **[Mail logs](mail-logs.md)** for deferred rows

***

## API

```bash theme={null}
# Create a campaign
curl -sS -X POST "https://api.mailofly.com/v1/campaigns" \
  -H "Authorization: Bearer mf_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "March newsletter",
    "segment_id": "uuid",
    "template_id": "uuid",
    "schedule_type": "manual"
  }'

# Send now
curl -sS -X POST "https://api.mailofly.com/v1/campaigns/{id}/send" \
  -H "Authorization: Bearer mf_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "sendNow": true }'
```

Full reference: [API: Campaigns](https://docs.mailofly.com/api/campaigns)

***

## Related

* [Contacts & segments](contacts.md) — build your audience
* [Templates](templates.md) — design the message
* [Sending accounts](accounts.md) — delivery identities
* [Mail logs](mail-logs.md) — debug delivery


## Related topics

- [Email types](/getting-started/email-types.md)
- [Introduction](/broadcasts/introduction.md)
- [Index](/changelog/index.md)
- [When to Add an Unsubscribe Link](/guides/sending/when-to-add-an-unsubscribe-link.md)
- [Create Campaign](/api/campaigns/create-campaign.md)
