API reference

Campaigns

Create, schedule, send, pause, copy and report on EmailMarketer.io email campaigns through the API.

A campaign sends one email (or up to five A/B variations) to lists and segments. Its content lives in an email. All commands take APIKey and are sent to POST https://app.emailmarketer.io/api.php with Command, or to the /api/v1/ path shown.

Create and send a campaign

  1. Create the email content with email.create, then fill it with email.update. See Email content.
  2. Create the campaign with campaign.create.
  3. Set the email, audience and schedule with campaign.update.
# 1. Campaign
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.create -d APIKey="$EM_API_KEY" \
  -d CampaignName="November product update"

# 2. Email, audience and send now
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.update -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d RelEmailID=678 \
  -d RecipientListsAndSegments="123:0" \
  -d ScheduleType=Immediate \
  -d CampaignStatus=Ready

RecipientListsAndSegments is a comma-separated list of ListID:SegmentID pairs. Segment 0 means the whole list, so 123:0,124:7 sends to all of list 123 and segment 7 of list 124. An empty value removes all recipients.

The send starts when CampaignStatus is Ready and ScheduleType is not Not Scheduled. You can set the email, audience, schedule and status in one call. If the account’s campaigns need review, a Ready request becomes Pending Approval and our team releases it.

campaign.create

Requires CampaignName. Optional JourneyEnrolleeHandling: list, include or exclude, which decides what happens to recipients who are in a journey.

curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.create \
  -d APIKey="$EM_API_KEY" \
  -d CampaignName="November product update" \
  -d JourneyEnrolleeHandling=exclude
{ "Success": true, "ErrorCode": 0, "CampaignID": 12345 }

Errors: 1 missing name, 2 invalid JourneyEnrolleeHandling.

campaign.update

Requires CampaignID. Send only what you change.

Group Parameters
Basics CampaignName, CampaignStatus (Draft, Ready, Paused and the other statuses), RelEmailID (the email to send)
Audience RecipientListsAndSegments, Exclude_RecipientListsAndSegments (ListID:SegmentID pairs), RulesJsonBundle
Schedule ScheduleType: Not Scheduled, Immediate, Future or Recursive. For Future: SendDate, SendTime, SendTimeZone. For Recursive: ScheduleRecDaysOfWeek or ScheduleRecDaysOfMonth, ScheduleRecMonths, ScheduleRecHours, ScheduleRecMinutes, ScheduleRecSendMaxInstance
Resend to non-openers AutoResendEnabled, AutoResendWaitDays, AutoResendSubject, AutoResendPreHeaderText
A/B test ABTesting[Variations][N][emailid] and ABTesting[Variations][N][weight], 2 to 5 variations
Tracking GoogleAnalyticsDomains
Other PublishOnRSS, JourneyEnrolleeHandling
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.update \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d CampaignName="November product update (final)"
Code Meaning
1 Missing CampaignID
2 Campaign not found
3 Invalid status
4 Email not found
5 Invalid schedule type
6, 7 Invalid SendDate or missing SendTime
8 to 12 A field for recurring sends is missing
14, 15 Invalid wait days or missing subject for the resend
17 to 25 Invalid A/B test settings: format, unknown email, fewer than 2 or more than 5 variations, a weight below 1%
26 Resend cannot be used with a recurring campaign
27 The scheduled time is in the past
28, 29 RulesJsonBundle names a list or segment you do not own, or an invalid ID
31 Invalid JourneyEnrolleeHandling
30 A campaign pending approval can only stay there or go back to Draft
32 The email cannot be sent: subject, content or From is missing

campaign.get

Requires CampaignID.

Parameter Description
RetrieveStatistics Include statistics
StatisticsDays 1 to 365. Default 15
RetrieveTags Include campaign tags
SplitABTestStatistics Statistics per variation
RetrieveRecipientDomains Default true
FailOnNotFound Return error 3 when not found. Otherwise the call succeeds with Campaign: []
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d RetrieveStatistics=true
{ "Success": true, "ErrorCode": 0, "Campaign": { "CampaignID": 12345, "CampaignName": "November product update", "CampaignStatus": "Sent", "TotalRecipients": 50000, "TotalSent": 49870, "UniqueOpens": 14210 } }

campaigns.get

GET /api/v1/campaigns.get. All parameters are optional.

Parameter Description
CampaignStatus, ScheduleType Filter
SearchKeyword Match name
CampaignIDs Comma-separated
Date_From, Date_To Date range
Tags Campaign tag IDs
OrderField, OrderType Sort
RecordsPerRequest, RecordsFrom Paging. 0 returns all
RetrieveStatistics Default true
CountOnly Return only the count
curl -G https://app.emailmarketer.io/api/v1/campaigns.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignStatus=Sent
{ "Success": true, "ErrorCode": 0, "TotalCampaigns": 125, "Campaigns": [{ "CampaignID": 12345, "CampaignName": "...", "CampaignStatus": "Sent", "SendDate": "2026-11-10" }] }

Control a sending campaign

Command Required Errors
campaign.pause CampaignID 1 missing, 2 not found, 3 the campaign is not sending or ready
campaign.resume CampaignID 1 missing, 2 not found, 3 not paused, 32 the email cannot be sent
campaign.cancel CampaignID 1 missing, 2 not found

Examples:

# campaign.pause
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.pause \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345

# campaign.resume
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.resume \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345

# campaign.cancel
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.cancel \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345

Copy and delete

Command Required Returns Errors
campaign.copy CampaignID NewCampaignID 1 source not found
campaigns.delete Campaigns (comma-separated IDs) Success 1 missing
campaigns.counts none. Optional Tags, date_from, date_to Counts per status none documented

Examples:

# campaign.copy
curl https://app.emailmarketer.io/api.php \
  -d Command=campaign.copy \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345

# campaigns.delete
curl https://app.emailmarketer.io/api.php \
  -d Command=campaigns.delete \
  -d APIKey="$EM_API_KEY" \
  -d Campaigns=12345,12346

# campaigns.counts
curl https://app.emailmarketer.io/api.php \
  -d Command=campaigns.counts \
  -d APIKey="$EM_API_KEY"

Reports

Command Path Required Optional Returns
campaign.recipients.get GET /api/v1/campaign.recipients.get CampaignID OnlyTotal Recipients of an unsent campaign: SubscriberID, EmailAddress
campaign.recipients.activity.get GET /api/v1/campaign.recipients.activity.get CampaignID, Activity (open, click, bounce, unsubscription, forward, conversion) SearchKeyword, VariationEmailID, RecordsFrom, RecordsPerRequest Who did it: SubscriberID, ListID, EmailAddress, ActivityCount, LastActivityDate
campaign.linkclicks.get GET /api/v1/campaign.linkclicks.get CampaignID GroupBy (Links or Subscribers), RecordsFrom, RecordsPerRequest (default 25, up to 1000) Clicks per link (LinkURL, TotalClicks) or per subscriber
campaign.abtest.get GET /api/v1/campaign.abtest.get CampaignID none Variations with subject, opens, open rate and click-to-open rate, the winner, and resend results

Examples:

# campaign.recipients.get
curl -G https://app.emailmarketer.io/api/v1/campaign.recipients.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d OnlyTotal=true

# campaign.recipients.activity.get
curl -G https://app.emailmarketer.io/api/v1/campaign.recipients.activity.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d Activity=open

# campaign.linkclicks.get
curl -G https://app.emailmarketer.io/api/v1/campaign.linkclicks.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345 \
  -d GroupBy=Links

# campaign.abtest.get
curl -G https://app.emailmarketer.io/api/v1/campaign.abtest.get \
  -d APIKey="$EM_API_KEY" \
  -d CampaignID=12345

campaign.recipients.get errors: 4 the campaign is not a draft, ready or pending approval, 5 the targeting cannot be used, 6 a list is unavailable.

Export

Command Path Parameters Returns
campaigns.export.post POST /api/v1/campaigns.export ExportFormat (csv), FieldsToExport (array), and the campaigns.get filters JobID, EstimatedRows
campaigns.export.get GET /api/v1/campaigns.export JobID. Download=1 streams the CSV Status, Progress, RowCount, DownloadURL, ExpiresAt

Examples:

# campaigns.export.post
curl https://app.emailmarketer.io/api/v1/campaigns.export \
  -H "Content-Type: application/json" \
  -d '{ "APIKey": "'"$EM_API_KEY"'", "ExportFormat": "csv", "FieldsToExport": ["CampaignID", "CampaignName"] }'

# campaigns.export.get
curl -G https://app.emailmarketer.io/api/v1/campaigns.export \
  -d APIKey="$EM_API_KEY" \
  -d JobID=789

Campaign tags are on Tags.