curl --request POST \
--url https://cloudapi.mailercloud.com/v2/campaign/save \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"email_preheader": "Prime member: You have an unused Prime benefit",
"exclude_list_ids": [
"123",
"456"
],
"exclude_segments": [
"segment1",
"segment2"
],
"exclude_tag_ids": [
"tag1",
"tag2"
],
"frequency_cap": "daily",
"html": "<html><body>Sample HTML</body></html>",
"is_publish": "1",
"list_ids": [
"sCVJ",
"ghy"
],
"mailing_preference": true,
"name": "Campaign name",
"pause_rules": {
"pause_condition": "greater than",
"pause_criteria": "open",
"pause_limit": 1,
"pause_target": 1,
"wait_time": 10
},
"permission_reminder": "If you wish to opt out of all types of emails, click Unsubscribe.",
"plain_text": "Plain text content",
"reply_email": "sender@yourdomain.com",
"reply_id": "reply-id-1",
"report_spam": false,
"rules": {
"contacts_order": "last",
"limit": 5
},
"scheduled_at": "2021-04-17 15:48:00",
"segments": [
"hju"
],
"sender": {
"sender_email": "sender@yourdomain.com",
"sender_name": "Sender Name"
},
"sender_id": [
"sender-123"
],
"subject": "Prime member notification.",
"tag_id": "prime-tag",
"tag_ids": [
"tag-123",
"tag-456"
],
"tag_name": "Prime Campaign Tag"
}
'{
"id": "aBc12"
}{
"errors": [
{
"field": "sender_email",
"message": "sender_email must be a valid email address"
},
{
"field": "reply_email",
"message": "reply_email must be a valid email address"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Create Campaign (v2)
The newer version of Create Campaign with additional options — prefer this endpoint for new integrations.
Required: name, subject, and sender (with sender_name + sender_email). Content: provide html or plain_text. Audience: provide at least one of list_ids, segments, or tag_ids.
curl --request POST \
--url https://cloudapi.mailercloud.com/v2/campaign/save \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"email_preheader": "Prime member: You have an unused Prime benefit",
"exclude_list_ids": [
"123",
"456"
],
"exclude_segments": [
"segment1",
"segment2"
],
"exclude_tag_ids": [
"tag1",
"tag2"
],
"frequency_cap": "daily",
"html": "<html><body>Sample HTML</body></html>",
"is_publish": "1",
"list_ids": [
"sCVJ",
"ghy"
],
"mailing_preference": true,
"name": "Campaign name",
"pause_rules": {
"pause_condition": "greater than",
"pause_criteria": "open",
"pause_limit": 1,
"pause_target": 1,
"wait_time": 10
},
"permission_reminder": "If you wish to opt out of all types of emails, click Unsubscribe.",
"plain_text": "Plain text content",
"reply_email": "sender@yourdomain.com",
"reply_id": "reply-id-1",
"report_spam": false,
"rules": {
"contacts_order": "last",
"limit": 5
},
"scheduled_at": "2021-04-17 15:48:00",
"segments": [
"hju"
],
"sender": {
"sender_email": "sender@yourdomain.com",
"sender_name": "Sender Name"
},
"sender_id": [
"sender-123"
],
"subject": "Prime member notification.",
"tag_id": "prime-tag",
"tag_ids": [
"tag-123",
"tag-456"
],
"tag_name": "Prime Campaign Tag"
}
'{
"id": "aBc12"
}{
"errors": [
{
"field": "sender_email",
"message": "sender_email must be a valid email address"
},
{
"field": "reply_email",
"message": "reply_email must be a valid email address"
}
]
}{
"errors": [
{
"field": "",
"message": "Authorization failed"
}
]
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Headers
Request body type
Body
1 - 150Show child attributes
Show child attributes
1 - 65000"1" publishes/schedules the campaign; "0" saves it as a draft.
0, 1 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Schedule time in YYYY-MM-DD HH:MM:SS format. Omit to send according to is_publish.
Per-campaign open tracking. 1 enables, 0 disables. true / false are also accepted.
Omit this field to leave tracking enabled - absent means enabled, so existing integrations are unaffected. A value other than 0/1/true/false (including an empty string) is ignored and tracking stays enabled.
When disabled, the open is still counted in the campaign totals but is not attributed to any contact - it does not appear in per-recipient reports, segments or automations.
0, 1 Per-campaign click tracking. 1 enables, 0 disables. true / false are also accepted.
Omit this field to leave tracking enabled - absent means enabled, so existing integrations are unaffected. A value other than 0/1/true/false (including an empty string) is ignored and tracking stays enabled.
When disabled, links are still rewritten and the click is still counted in the campaign totals, but it is not attributed to any contact.
0, 1 Response
{ "id": "a" }
ID of the created campaign.