> ## 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, runs & send

Campaign CRUD, run history, and the send endpoint (queues delivery like “Send now” in the app).

## GET `/v1/campaigns`

**List campaigns**

Lists campaigns for the user.

### Examples

#### 200 — OK

```json theme={null}
{ "data": [ … ] }
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/campaigns" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## POST `/v1/campaigns`

**Create campaign**

schedule\_type: manual | scheduled\_once | recurring | recurring\_new\_contacts. For scheduled\_once set scheduled\_at (ISO 8601). For recurring set recurrence\_interval (≥1) and recurrence\_unit: day | week | month.

### Request body — Body

```json theme={null}
{
  "title": "April newsletter",
  "description": "Internal note",
  "segment_id": "uuid",
  "template_id": "uuid",
  "schedule_type": "manual"
}
```

### Examples

#### 201 — Created

```json theme={null}
{ "data": { … } }
```

### cURL

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

## GET `/v1/campaigns/{id}`

**Get campaign**

Fetch one campaign.

### Examples

#### 200 — OK

```json theme={null}
{ "data": { … } }
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/campaigns/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## PATCH `/v1/campaigns/{id}`

**Update campaign**

Partial update.

### Request body — Body

```json theme={null}
{ "title": "Renamed" }
```

### Examples

#### 200 — OK

```json theme={null}
{ "data": { … } }
```

### cURL

```bash theme={null}
curl -sS -X PATCH "https://api.mailofly.com/v1/campaigns/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"title":"Renamed"}'
```

## DELETE `/v1/campaigns/{id}`

**Delete campaign**

Deletes the campaign.

### Examples

#### 200 — OK

```json theme={null}
{ "ok": true }
```

### cURL

```bash theme={null}
curl -sS -X DELETE "https://api.mailofly.com/v1/campaigns/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## GET `/v1/campaigns/{id}/runs`

**List campaign runs**

Runs for the campaign, newest first. Items include aggregate counts from mail logs: total, sent, failed, pending, etc.

### Examples

#### 200 — OK

```json theme={null}
{ "data": [ … ] }
```

### cURL

```bash theme={null}
curl -sS -X GET "https://api.mailofly.com/v1/campaigns/00000000-0000-0000-0000-000000000001/runs" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"
```

## POST `/v1/campaigns/{id}/send`

**Send campaign**

Queues delivery to the segment audience. Requires segment and template. JSON aliases: sendNow, senderAccountIds. Omit sender\_account\_ids for default account selection.

### Request body — Body

```json theme={null}
{
  "send_now": true,
  "sender_account_ids": ["00000000-0000-0000-0000-000000000002"]
}
```

### Examples

#### 200 — OK

```json theme={null}
{ "ok": true, "campaign_id": "…", "contacts_messaged": 10 }
```

### cURL

```bash theme={null}
curl -sS -X POST "https://api.mailofly.com/v1/campaigns/00000000-0000-0000-0000-000000000001/send" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"send_now":true,"sender_account_ids":["00000000-0000-0000-0000-000000000002"]}'
```

## Related

* [Product: Campaigns](../product/campaigns.md)
* [Emails API](emails.md)
* [Mail logs API](mail-logs.md)
* [← API overview](README.md)


## Related topics

- [Create Campaign](/api/campaigns/create-campaign.md)
- [Delete Campaign](/api/campaigns/delete-campaign.md)
- [Retrieve Campaign](/api/campaigns/get-campaign.md)
- [List Campaigns](/api/campaigns/list-campaigns.md)
- [Send Campaign](/api/campaigns/send-campaign.md)
