Skip to main content
PUT
/
campaigns
/
{campaign_id}
curl -X PUT https://api2.ecomailapp.cz/campaigns/1 \
  -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, 2]
  }'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'key: YOUR_API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    '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, 2],
]));
$response = curl_exec($ch);
curl_close($ch);
{
  "id": 1,
  "from_name": "From name",
  "from_email": "from@foo.cz",
  "reply_to": "reply@bar.cz",
  "title": "My first campaign",
  "subject": "First hello",
  "status": 0,
  "archive_url": "https://foo.ecomailapp.cz/campaigns/render/1"
}
campaign_id
integer
required
Campaign ID.
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.
curl -X PUT https://api2.ecomailapp.cz/campaigns/1 \
  -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, 2]
  }'
$campaignId = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api2.ecomailapp.cz/campaigns/{$campaignId}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'key: YOUR_API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    '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, 2],
]));
$response = curl_exec($ch);
curl_close($ch);
{
  "id": 1,
  "from_name": "From name",
  "from_email": "from@foo.cz",
  "reply_to": "reply@bar.cz",
  "title": "My first campaign",
  "subject": "First hello",
  "status": 0,
  "archive_url": "https://foo.ecomailapp.cz/campaigns/render/1"
}