Skip to main content
POST
https://api2.ecomailapp.cz
/
campaigns
curl -X POST https://api2.ecomailapp.cz/campaigns \
  -H "key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Campaign title",
    "from_name": "Senders name",
    "from_email": "test@ecomailapp.cz",
    "reply_to": "test@ecomailapp.cz",
    "subject": "New campaign subject",
    "html_text": "HTML content of new campaign",
    "recepient_lists": [1]
  }'
{
  "id": 712,
  "title": "Campaign title",
  "from_name": "Senders name",
  "from_email": "test@ecomailapp.cz",
  "reply_to": "test@ecomailapp.cz",
  "subject": "New campaign subject",
  "recepient_lists": [1],
  "template_type": "html",
  "campaign_type": "email",
  "updated_at": "2023-06-14T10:16:16.112614Z"
}
For list segments selection instead of a whole recipient list, use "recepient_lists": {"segments": [{"id": "segment_id", "list": 14}]}. Segment IDs can be obtained from the Show list detail endpoint.
title
string
required
Campaign title.
from_name
string
required
Sender’s name.
from_email
string
required
Sender’s email address.
reply_to
string
required
Reply-to email address.
subject
string
required
Campaign subject line.
html_text
string
required
HTML content of the campaign.
recepient_lists
array|object
required
Array of list IDs or an object with segments. See the example above for the segments format.
curl -X POST https://api2.ecomailapp.cz/campaigns \
  -H "key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Campaign title",
    "from_name": "Senders name",
    "from_email": "test@ecomailapp.cz",
    "reply_to": "test@ecomailapp.cz",
    "subject": "New campaign subject",
    "html_text": "HTML content of new campaign",
    "recepient_lists": [1]
  }'
{
  "id": 712,
  "title": "Campaign title",
  "from_name": "Senders name",
  "from_email": "test@ecomailapp.cz",
  "reply_to": "test@ecomailapp.cz",
  "subject": "New campaign subject",
  "recepient_lists": [1],
  "template_type": "html",
  "campaign_type": "email",
  "updated_at": "2023-06-14T10:16:16.112614Z"
}