curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"html": "<html><body> Sample HTML </body></html>",
"list_ids": [
"sCVJ",
"ghy"
],
"name": "Campaign name",
"sender": {
"sender_email": "sender@yourdomain.com",
"sender_name": "Sender Name"
},
"scheduled_at": "2021-04-17 15:48:00",
"subject": "Prime member notification."
}
'{
"id": "hdjh"
}{
"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
A newer version of this endpoint with more options is available: Create Campaign (v2).
API for creating an email campaign. For creating a campaign, HTML or plain text and list id or segment are mandatory.
POST
/
campaign
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/campaign \
--header 'Authorization: <api-key>' \
--header 'Content-Type: <content-type>' \
--data '
{
"html": "<html><body> Sample HTML </body></html>",
"list_ids": [
"sCVJ",
"ghy"
],
"name": "Campaign name",
"sender": {
"sender_email": "sender@yourdomain.com",
"sender_name": "Sender Name"
},
"scheduled_at": "2021-04-17 15:48:00",
"subject": "Prime member notification."
}
'{
"id": "hdjh"
}{
"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
Body
application/json
Response
Created