> For the complete documentation index, see [llms.txt](https://docs.mailofly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailofly.com/guides/campaigns-and-content/campaigns.md).

# 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+    |

{% hint style="warning" %}
Scheduled and recurring campaigns require **Basic plan or higher** (`allow_automation`).
{% endhint %}

### 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**](/guides/operations/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**](/guides/operations/mail-logs.md) for deferred rows

***

## API

```bash
# Create a campaign
curl -sS -X POST "https://www.mailofly.com/api/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://www.mailofly.com/api/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](/guides/campaigns-and-content/contacts.md) — build your audience
* [Templates](/guides/campaigns-and-content/templates.md) — design the message
* [Sending accounts](/guides/deliverability/accounts.md) — delivery identities
* [Mail logs](/guides/operations/mail-logs.md) — debug delivery


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mailofly.com/guides/campaigns-and-content/campaigns.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
