REST API

Campaigns, runs & send

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

GET/api/v1/campaigns

List campaigns

Lists campaigns for the user.

Authentication: Authorization: Bearer with your Mailofly API key

cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/campaigns" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": [ … ] }
GET/api/v1/campaigns
POST/api/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.

Authentication: Authorization: Bearer with your Mailofly API key

Request body

{
  "title": "April newsletter",
  "description": "Internal note",
  "segment_id": "uuid",
  "template_id": "uuid",
  "schedule_type": "manual"
}
cURL
curl -sS -X POST "https://www.mailofly.com/api/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"}'

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": { … } }
POST/api/v1/campaigns
GET/api/v1/campaigns/{id}

Get campaign

Fetch one campaign.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/campaigns/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": { … } }
GET/api/v1/campaigns/{id}
PATCH/api/v1/campaigns/{id}

Update campaign

Partial update.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Request body

{ "title": "Renamed" }
cURL
curl -sS -X PATCH "https://www.mailofly.com/api/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"}'

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": { … } }
PATCH/api/v1/campaigns/{id}
DELETE/api/v1/campaigns/{id}

Delete campaign

Deletes the campaign.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X DELETE "https://www.mailofly.com/api/v1/campaigns/00000000-0000-0000-0000-000000000001" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "ok": true }
DELETE/api/v1/campaigns/{id}
GET/api/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.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid
cURL
curl -sS -X GET "https://www.mailofly.com/api/v1/campaigns/00000000-0000-0000-0000-000000000001/runs" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer mf_live_your_key_here"

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "data": [ … ] }
GET/api/v1/campaigns/{id}/runs
POST/api/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.

Authentication: Authorization: Bearer with your Mailofly API key

Path parameters

FieldType
iduuid

Request body

{
  "send_now": true,
  "sender_account_ids": ["00000000-0000-0000-0000-000000000002"]
}
cURL
curl -sS -X POST "https://www.mailofly.com/api/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"]}'

Requests use https://www.mailofly.com

Response

Try it sends the request through this app to https://www.mailofly.com (no browser CORS issues).

Click Try it to run the example against the live API.

Example responses

{ "ok": true, "campaign_id": "…", "contacts_messaged": 10 }
POST/api/v1/campaigns/{id}/send