Skip to Content
MailerLite
MailerLite API

Campaigns

Draft, schedule, send, and cancel email campaigns, plus retrieve campaign reports and link clicks.

Campaigns are the one-off emails you send to a group or segment, as opposed to the automated emails an automation sends.

A campaign is created as a draft, edited until it is ready, then scheduled. Only drafts can be updated, so a scheduled campaign must be cancelled before you can change it.

Types

TypeDescription
regularA single email to your chosen recipients.
abAn A/B test varying the subject, sender or sending time.
resendSends a second time to recipients who did not open or click. Available on paid plans and during the free trial.
multivariateTests several variables at once, in 2 to 8 combinations. Available on paid plans and during the free trial.
rssSends automatically from a feed. Its send time comes from the feed settings. Can't be created through the API, but RSS campaigns made in the app can be listed, scheduled and reported on here.

A campaign's type is fixed at creation. The settings object matching the type (ab_settings, resend_settings or multivariate_settings) is required whenever you create or update a campaign of that type.

Recipients

Send groups, segments, or both. When both are given, only the segments are used.

Sending

Scheduling is what actually sends a campaign. The delivery parameter chooses when:

DeliverySends
instantRight away.
scheduledAt a date and time you pick.
timezone_basedAt a local time in each recipient's own timezone.
smart_sendingAt the time each recipient is most likely to engage.

Before a campaign can be scheduled it needs recipients, a designed email and a valid unsubscribe link.

Campaign list

If you want to get a list of all of your campaigns based on status or type use this GET request

GET https://connect.mailerlite.com/api/campaigns

Returns a paginated list of the campaigns in your account, each with its recipient filter, emails and delivery stats.

Without filters, campaigns of every status are returned. Once you pass any filter[…], only ready campaigns are returned unless you also set filter[status]. Use filter[type] to narrow to one campaign type.

Request parameters

ParameterTypeRequiredLimitations
filter[status]stringnoReturn only campaigns with this status. One of sent, draft or ready. Defaults to ready when any other filter is given, otherwise campaigns of every status are returned.
filter[type]stringnoReturn only campaigns of this type. One of regular, ab, resend, rss, multivariate, or all for every type. Returns all types when omitted.
filter[date_from]stringnoOnly include campaigns from this date onwards, in Y-m-d format.
filter[date_to]stringnoOnly include campaigns up to this date, in Y-m-d format.
filter[folder]integernoReturn only campaigns in this folder, by folder ID.
filter[subject]stringnoReturn only campaigns whose subject line contains this value.
limitintegernoNumber of campaigns to return per page. Defaults to 25, maximum 100.
pageintegernoPage number to return. Counting starts from 1.

Response

Response Code: 200 OK
{
  "data": [
      {
        "id": "1",
        "account_id": "1",
        "name": "dummy campaign",
        "type": "regular",
        "status": "sent",
        "missing_data": [],
        "settings": {
          "track_opens": true,
          "use_google_analytics": false,
          "ecommerce_tracking": false
        },
        "filter": [
          [
            {
              "operator": "in_any",
              "args": [
                 "groups",
                    [
                      "42"
                    ]
              ]
            }
          ]
        ],
        "filter_for_humans": [
          [
            "In any group: dummy group"
          ]
        ],
        "delivery_schedule": "instant",
        "language_id": "4",
        "created_at": "2022-07-26 15:07:52",
        "updated_at": "2022-07-26 15:12:17",
        "scheduled_for": "2022-07-26 15:11:51",
        "queued_at": "2022-07-26 15:12:04",
        "started_at": "2022-07-26 15:12:04",
        "finished_at": "2022-07-26 15:12:17",
        "stopped_at": null,
        "default_email_id": "61706700654118223",
        "emails": [
            {
                "id": "1",
                "account_id": "1",
                "emailable_id": "12",
                "emailable_type": "campaigns",
                "type": "builder",
                "from": "dummy@mailerlite.io",
                "from_name": "Dummy Testerson",
                "reply_to": "reply-to@mailerlite.io",
                "name": null,
                "subject": "hello",
                "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
                "screenshot_url": null,
                "preview_url": null,
                "created_at": "2022-07-26 15:08:15",
                "updated_at": "2022-07-26 15:15:29",
                "is_designed": true,
                "language_id": null,
                "is_winner": false,
                "stats": {
                    "sent": 10,
                    "opens_count": 6,
                    "unique_opens_count": 5,
                    "open_rate": {
                        "float": 0.5,
                        "string": "50%"
                    },
                    "clicks_count": 2,
                    "unique_clicks_count": 2,
                    "click_rate": {
                        "float": 0.2,
                        "string": "20%"
                    },
                    "unsubscribes_count": 0,
                    "unsubscribe_rate": {
                        "float": 0,
                        "string": "0%"
                    },
                    "spam_count": 0,
                    "spam_rate": {
                        "float": 0,
                        "string": "0%"
                    },
                    "hard_bounces_count": 0,
                    "hard_bounce_rate": {
                        "float": 0,
                        "string": "0%"
                    },
                    "soft_bounces_count": 0,
                    "soft_bounce_rate": {
                        "float": 0,
                        "string": "0%"
                    },
                    "forwards_count": 0
                },
                "send_after": null,
                "track_opens": true
            }
        ],
        "used_in_automations": false,
        "type_for_humans": "Regular",
        "stats": {
            "sent": 10,
            "opens_count": 6,
            "unique_opens_count": 5,
            "open_rate": {
                "float": 0.5,
                "string": "50%"
            },
            "clicks_count": 2,
            "unique_clicks_count": 2,
            "click_rate": {
                "float": 0.2,
                "string": "20%"
            },
            "unsubscribes_count": 0,
            "unsubscribe_rate": {
                "float": 0,
                "string": "0%"
            },
            "spam_count": 0,
            "spam_rate": {
                "float": 0,
                "string": "0%"
            },
            "hard_bounces_count": 0,
            "hard_bounce_rate": {
                "float": 0,
                "string": "0%"
            },
            "soft_bounces_count": 0,
            "soft_bounce_rate": {
                "float": 0,
                "string": "0%"
            },
            "forwards_count": 0,
            "click_to_open_rate": {
                "float": 1,
                "string": "100%"
            }
        },
        "is_stopped": false,
        "has_winner": null,
        "winner_version_for_human": null,
        "winner_sending_time_for_humans": null,
        "winner_selected_manually_at": null,
        "uses_ecommerce": false,
        "uses_survey": true,
        "can_be_scheduled": false,
        "warnings": [],
        "initial_created_at": null,
        "is_currently_sending_out": false
    }
  ],
  "links": {
    "first": "https://connect.mailerlite.com/api/campaigns?page=1",
    "last": "https://connect.mailerlite.com/api/campaigns?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "https://connect.mailerlite.com/api/campaigns?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "https://connect.mailerlite.com/api/campaigns",
    "per_page": 100,
    "to": 1,
    "total": 1,
    "aggregations": {
       "sum": 2,
       "draft": 1,
       "ready": 0,
       "sent": 1
    }
  }
}

Get a campaign

You can fetch an existing campaign using this GET request

GET https://connect.mailerlite.com/api/campaigns/{campaign_id}

Returns a single campaign with its emails, recipient filter and, for sent campaigns, the full delivery and engagement stats for each email.

Response

Response code: 200 OK
{
  "data": {
      "id": "1",
      "account_id": "1",
      "name": "Dummy campaign",
      "type": "regular",
      "status": "draft",
      "missing_data": [],
      "settings": {
        "track_opens": true,
        "use_google_analytics": false,
        "ecommerce_tracking": false
      },
      "filter": [
        [
          {
            "operator": "in_any",
            "args": [
               "groups",
                  [
                    "42"
                  ]
            ]
          }
        ]
      ],
      "filter_for_humans": [
        [
          "In any group: dummy group"
        ]
      ],
      "delivery_schedule": "instant",
      "language_id": "4",
      "created_at": "2022-07-26 15:07:52",
      "updated_at": "2022-07-26 15:12:17",
      "scheduled_for": "2022-07-26 15:11:51",
      "queued_at": "2022-07-26 15:12:04",
      "started_at": "2022-07-26 15:12:04",
      "finished_at": "2022-07-26 15:12:17",
      "stopped_at": null,
      "default_email_id": "61706700654118223",
      "emails": [
          {
              "id": "1",
              "account_id": "1",
              "emailable_id": "12",
              "emailable_type": "campaigns",
              "type": "builder",
              "from": "dummy@mailerlite.io",
              "from_name": "Dummy Testerson",
              "reply_to": "reply-to@mailerlite.io",
              "name": null,
              "subject": "hello",
              "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
              "screenshot_url": null,
              "preview_url": null,
              "created_at": "2022-07-26 15:08:15",
              "updated_at": "2022-07-26 15:15:29",
              "is_designed": true,
              "language_id": null,
              "is_winner": false,
              "stats": {
                  "sent": 10,
                  "opens_count": 0,
                  "unique_opens_count": 0,
                  "open_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "clicks_count": 0,
                  "unique_clicks_count": 0,
                  "click_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "unsubscribes_count": 0,
                  "unsubscribe_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "spam_count": 0,
                  "spam_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "hard_bounces_count": 0,
                  "hard_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "soft_bounces_count": 0,
                  "soft_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "forwards_count": 0
              },
              "send_after": null,
              "track_opens": true
          }
      ],
      "used_in_automations": false,
      "type_for_humans": "Regular",
      "is_stopped": false,
      "has_winner": null,
      "winner_version_for_human": null,
      "winner_sending_time_for_humans": null,
      "winner_selected_manually_at": null,
      "uses_ecommerce": false,
      "uses_survey": true,
      "can_be_scheduled": false,
      "warnings": [],
      "initial_created_at": null,
      "is_currently_sending_out": false
  }
}

Error

When providing an invalid campaign id

Response code: 404 Not Found

Create a campaign

You can create a campaign using this POST request

POST https://connect.mailerlite.com/api/campaigns

Creates a draft campaign. The campaign is not sent until you schedule it.

Request body

ParameterTypeRequiredLimitations
namestringyesThe name of the campaign. Up to 255 characters.
typestringyesThe kind of campaign to create. One of regular, ab, resend or multivariate. The resend and multivariate types are available on paid plans and during the free trial.
language_idintegernoLanguage used for the unsubscribe template, by language ID. Defaults to English.
emailsarrayyes, unless type is multivariateThe emails to send. Contains exactly one email object, unless this is a multivariate campaign testing content, in which case it contains one object per content variation. Required unless type is multivariate.
emails.*.subjectstringyes, unless multivariate campaignThe subject line of the email. Up to 255 characters. Required unless this is a multivariate campaign.
emails.*.from_namestringyes, unless multivariate campaignThe sender name shown to recipients. Up to 255 characters. Required unless this is a multivariate campaign.
emails.*.fromstringyes, unless multivariate campaignThe sender email address. Must already be verified on MailerLite. Required unless this is a multivariate campaign.
emails.*.reply_tostringnoThe reply-to email address. Must already be verified on MailerLite.
emails.*.contentstringnoThe email body as HTML. Not available on every plan and returns an error when the account is on a plan without it. Include an unsubscribe link, account name, address and country, or the default MailerLite footer is appended for you. Not allowed when editor is simple. Learn more.
emails.*.editorstringnoSet to simple to create the email in the simple editor, then build its content through the emails endpoints instead of sending content. Must be the same on every email in the request. Not available on every plan and returns an error when the account is on a plan without it.
emails.*.template_idintegernoThe simple-editor template the email starts from: one from the shared gallery, or one you saved from your own email with POST /emails/{email_id}/templates. Optional, and allowed only when editor is simple. When omitted, the email starts from the default blank template. The template is copied into the new email, so the template itself is never changed. Must be the same on every email in the request.
groupsarraynoGroup IDs to send the campaign to. Ignored when segments is also given.
segmentsarraynoSegment IDs to send the campaign to. Takes precedence over groups when both are given.
ab_settingsobjectonly if type is abA/B test configuration. Required when type is ab, and all of its keys are then required.
ab_settings[test_type]stringonly if type is abWhat the A/B test varies. One of subject, sender or sending_time.
ab_settings[select_winner_by]stringonly if type is ab and test type is not sending_timeMetric used to pick the winning version. o for opens, c for clicks. Not used when the test type is sending_time.
ab_settings[after_time_amount]integeronly if type is ab and test type is not sending_timeHow long to wait before picking the winner. Not used when the test type is sending_time.
ab_settings[after_time_unit]stringonly if type is ab and test type is not sending_timeUnit for the wait time. h for hours or d for days. Not used when the test type is sending_time.
ab_settings[test_split]integeronly if type is abPercentage of recipients who receive the test. Between 5 and 25 for the subject and sender test types, and 100 for sending_time.
ab_settings[b_value]objectonly if type is ab and test type is not sending_timeThe B version of the campaign. Not used when the test type is sending_time.
ab_settings[b_value][subject]stringonly if ab test type is subjectSubject line of the B version. Up to 255 characters. Used when the test type is subject.
ab_settings[b_value][from_name]stringonly if ab test type is senderSender name of the B version. Up to 255 characters. Used when the test type is sender.
ab_settings[b_value][from]stringonly if ab test type is senderSender email address of the B version. Must already be verified on MailerLite. Used when the test type is sender.
resend_settingsobjectonly if type is resendAuto-resend configuration. Required when type is resend, and all of its keys are then required.
resend_settings[test_type]stringonly if type is resendWhat the resend varies. Currently only subject.
resend_settings[select_winner_by]stringonly if type is resendWho receives the second email. o for recipients who did not open, c for recipients who did not click.
resend_settings[b_value]objectonly if type is resendThe content of the resent email.
resend_settings[b_value][subject]stringonly if type is resendSubject line of the resent email. Up to 255 characters.
multivariate_settingsobjectonly if type is multivariateMultivariate test configuration. Required when type is multivariate. Each email variant needs at least 10 recipients.
multivariate_settings[test_variants]objectonly if type is multivariateThe variants to test. Must contain all four keys (subject, sender, content and sending_time), and the resulting combinations must come to between 2 and 8 emails.
multivariate_settings[test_variants][subject]arrayonly if type is multivariateSubject line variants. At least one.
multivariate_settings[test_variants][subject.*]stringonly if type is multivariateA subject line variant. Up to 998 characters.
multivariate_settings[test_variants][sender]arrayonly if type is multivariateSender variants. At least one.
multivariate_settings[test_variants][sender.*.from]stringonly if type is multivariateSender email address for this variant. Must already be verified on MailerLite.
multivariate_settings[test_variants][sender.*.from_name]stringonly if type is multivariateSender name for this variant. Up to 255 characters.
multivariate_settings[test_variants][content]integeronly if type is multivariateHow many content variants to test. Between 1 and 8.
multivariate_settings[test_variants][sending_time]integeronly if type is multivariateHow many sending times to test. Between 1 and 8.
multivariate_settings[select_winner_by]stringnoMetric used to pick the winning combination. o for opens, c for clicks. Not used when sending time is tested.
multivariate_settings[after_time_amount]integernoHow long to wait before picking the winner. Between 1 and 10. Not used when sending time is tested.
multivariate_settings[after_time_unit]stringnoUnit for the wait time. h for hours or d for days. Not used when sending time is tested.
multivariate_settings[test_split]integernoPercentage of recipients who receive the test. Must be 100 when there are fewer than 1,000 recipients per variant, otherwise at most 50.
settingsobjectnoCampaign configuration options.
settings[ecommerce_tracking]booleannoEnable e-commerce link tracking when the campaign content contains shop URLs.

Each email in the response has an id. For an email created with editor set to simple, pass that ID as {email_id} to the emails endpoints to build its content.

{
  "name": "October update",
  "type": "regular",
  "emails": [
    {
      "subject": "Our October update",
      "from_name": "Dummy Testerson",
      "from": "dummy@mailerlite.io",
      "editor": "simple"
    }
  ],
  "groups": ["42"]
}

Response

Response code: 200 OK
{
  "data": {
      "id": "1",
      "account_id": "1",
      "name": "Dummy campaign",
      "type": "regular",
      "status": "draft",
      "missing_data": [],
      "settings": {
        "track_opens": true,
        "use_google_analytics": false,
        "ecommerce_tracking": false
      },
      "filter": [
        [
          {
            "operator": "in_any",
            "args": [
               "groups",
                  [
                    "42"
                  ]
            ]
          }
        ]
      ],
      "filter_for_humans": [
        [
          "In any group: dummy group"
        ]
      ],
      "delivery_schedule": "instant",
      "language_id": "4",
      "created_at": "2022-07-26 15:07:52",
      "updated_at": "2022-07-26 15:12:17",
      "scheduled_for": "2022-07-26 15:11:51",
      "queued_at": "2022-07-26 15:12:04",
      "started_at": "2022-07-26 15:12:04",
      "finished_at": "2022-07-26 15:12:17",
      "stopped_at": null,
      "default_email_id": "61706700654118223",
      "emails": [
          {
              "id": "1",
              "account_id": "1",
              "emailable_id": "12",
              "emailable_type": "campaigns",
              "type": "builder",
              "from": "dummy@mailerlite.io",
              "from_name": "Dummy Testerson",
              "reply_to": "reply-to@mailerlite.io",
              "name": null,
              "subject": "hello",
              "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
              "screenshot_url": null,
              "preview_url": null,
              "created_at": "2022-07-26 15:08:15",
              "updated_at": "2022-07-26 15:15:29",
              "is_designed": true,
              "language_id": null,
              "is_winner": false,
              "stats": {
                  "sent": 10,
                  "opens_count": 0,
                  "unique_opens_count": 0,
                  "open_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "clicks_count": 0,
                  "unique_clicks_count": 0,
                  "click_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "unsubscribes_count": 0,
                  "unsubscribe_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "spam_count": 0,
                  "spam_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "hard_bounces_count": 0,
                  "hard_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "soft_bounces_count": 0,
                  "soft_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "forwards_count": 0
              },
              "send_after": null,
              "track_opens": true
          }
      ],
      "used_in_automations": false,
      "type_for_humans": "Regular",
      "is_stopped": false,
      "has_winner": null,
      "winner_version_for_human": null,
      "winner_sending_time_for_humans": null,
      "winner_selected_manually_at": null,
      "uses_ecommerce": false,
      "uses_survey": true,
      "can_be_scheduled": false,
      "warnings": [],
      "initial_created_at": null,
      "is_currently_sending_out": false
  }
}

Error

When campaign request has missing parameters

Response code: 422 Unprocessable entity
{
  "message": "The given data was invalid.",
  "errors": {
    "type": ["The selected type is invalid."]
  }
}

Update campaign

If you want to update a campaign that is currently with draft status, use this PUT request

PUT https://connect.mailerlite.com/api/campaigns/{campaign_id}

Updates a draft campaign. Only campaigns whose status is draft can be updated, so a campaign that is already scheduled must be cancelled first.

A campaign's type is fixed at creation and cannot be changed here. The settings object matching the campaign's type (ab_settings, resend_settings or multivariate_settings) is required when updating a campaign of that type.

Request body

ParameterTypeRequiredLimitations
namestringyesThe name of the campaign. Up to 255 characters.
language_idintegernoLanguage used for the unsubscribe template, by language ID. Unchanged when omitted.
emailsarraynoThe emails to send. Contains exactly one email object, unless this is a multivariate campaign testing content, in which case it contains one object per content variation. Omit to leave the emails unchanged.
emails.*.subjectstringnoThe subject line of the email. Up to 255 characters.
emails.*.from_namestringnoThe sender name shown to recipients. Up to 255 characters.
emails.*.fromstringnoThe sender email address. Must already be verified on MailerLite.
emails.*.reply_tostringnoThe reply-to email address. Must already be verified on MailerLite.
emails.*.contentstringnoThe email body as HTML. Not available on every plan and returns an error when the account is on a plan without it. Include an unsubscribe link, account name, address and country, or the default MailerLite footer is appended for you. Learn more.
groupsarraynoGroup IDs to send the campaign to. Ignored when segments is also given.
segmentsarraynoSegment IDs to send the campaign to. Takes precedence over groups when both are given.
ab_settingsobjectonly if type is abA/B test configuration. Required when the campaign type is ab, and all of its keys are then required.
ab_settings[test_type]stringonly if type is abWhat the A/B test varies. One of subject, sender or sending_time.
ab_settings[select_winner_by]stringonly if type is ab and test type is not sending_timeMetric used to pick the winning version. o for opens, c for clicks. Not used when the test type is sending_time.
ab_settings[after_time_amount]integeronly if type is ab and test type is not sending_timeHow long to wait before picking the winner. Not used when the test type is sending_time.
ab_settings[after_time_unit]stringonly if type is ab and test type is not sending_timeUnit for the wait time. h for hours or d for days. Not used when the test type is sending_time.
ab_settings[test_split]integeronly if type is abPercentage of recipients who receive the test. Between 5 and 25 for the subject and sender test types, and 100 for sending_time.
ab_settings[b_value]objectonly if type is ab and test type is not sending_timeThe B version of the campaign. Not used when the test type is sending_time.
ab_settings[b_value][subject]stringonly if ab test type is subjectSubject line of the B version. Up to 255 characters. Used when the test type is subject.
ab_settings[b_value][from_name]stringonly if ab test type is senderSender name of the B version. Up to 255 characters. Used when the test type is sender.
ab_settings[b_value][from]stringonly if ab test type is senderSender email address of the B version. Must already be verified on MailerLite. Used when the test type is sender.
resend_settingsobjectonly if type is resendAuto-resend configuration. Required when the campaign type is resend, and all of its keys are then required.
resend_settings[test_type]stringonly if type is resendWhat the resend varies. Currently only subject.
resend_settings[select_winner_by]stringonly if type is resendWho receives the second email. o for recipients who did not open, c for recipients who did not click.
resend_settings[b_value]objectonly if type is resendThe content of the resent email.
resend_settings[b_value][subject]stringonly if type is resendSubject line of the resent email. Up to 255 characters.
multivariate_settingsobjectonly if type is multivariateMultivariate test configuration. Required when the campaign type is multivariate. Each email variant needs at least 10 recipients.
multivariate_settings[test_variants]objectonly if type is multivariateThe variants to test. Must keep the same number of variants the campaign was created with.
multivariate_settings[select_winner_by]stringnoMetric used to pick the winning combination. o for opens, c for clicks. Not used when sending time is tested.
multivariate_settings[after_time_amount]integernoHow long to wait before picking the winner. Between 1 and 10. Not used when sending time is tested.
multivariate_settings[after_time_unit]stringnoUnit for the wait time. h for hours or d for days. Not used when sending time is tested.
multivariate_settings[test_split]integernoPercentage of recipients who receive the test. Must be 100 when there are fewer than 1,000 recipients per variant, otherwise at most 50.

Response

Response code: 200 OK
{
  "data": {
      "id": "1",
      "account_id": "1",
      "name": "Dummy campaign",
      "type": "regular",
      "status": "draft",
      "missing_data": [],
      "settings": {
        "track_opens": true,
        "use_google_analytics": false,
        "ecommerce_tracking": false
      },
      "filter": [
        [
          {
            "operator": "in_any",
            "args": [
               "groups",
                  [
                    "42"
                  ]
            ]
          }
        ]
      ],
      "filter_for_humans": [
        [
          "In any group: dummy group"
        ]
      ],
      "delivery_schedule": "instant",
      "language_id": "4",
      "created_at": "2022-07-26 15:07:52",
      "updated_at": "2022-07-26 15:12:17",
      "scheduled_for": "2022-07-26 15:11:51",
      "queued_at": "2022-07-26 15:12:04",
      "started_at": "2022-07-26 15:12:04",
      "finished_at": "2022-07-26 15:12:17",
      "stopped_at": null,
      "default_email_id": "61706700654118223",
      "emails": [
          {
              "id": "1",
              "account_id": "1",
              "emailable_id": "12",
              "emailable_type": "campaigns",
              "type": "builder",
              "from": "dummy@mailerlite.io",
              "from_name": "Dummy Testerson",
              "name": null,
              "reply_to": "reply-to@mailerlite.io",
              "subject": "hello",
              "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
              "screenshot_url": null,
              "preview_url": null,
              "created_at": "2022-07-26 15:08:15",
              "updated_at": "2022-07-26 15:15:29",
              "is_designed": true,
              "language_id": null,
              "is_winner": false,
              "stats": {
                  "sent": 10,
                  "opens_count": 0,
                  "unique_opens_count": 0,
                  "open_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "clicks_count": 0,
                  "unique_clicks_count": 0,
                  "click_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "unsubscribes_count": 0,
                  "unsubscribe_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "spam_count": 0,
                  "spam_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "hard_bounces_count": 0,
                  "hard_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "soft_bounces_count": 0,
                  "soft_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "forwards_count": 0
              },
              "send_after": null,
              "track_opens": true
          }
      ],
      "used_in_automations": false,
      "type_for_humans": "Regular",
      "is_stopped": false,
      "has_winner": null,
      "winner_version_for_human": null,
      "winner_sending_time_for_humans": null,
      "winner_selected_manually_at": null,
      "uses_ecommerce": false,
      "uses_survey": true,
      "can_be_scheduled": false,
      "warnings": [],
      "initial_created_at": null,
      "is_currently_sending_out": false
  }
}

Error

When trying to update a campaign that is not with status draft

Response code: 422 Unprocessable entity
"Campaign is not with status draft"

When campaign request has missing parameters

Response code: 422 Unprocessable entity
{
  "message": "The given data was invalid.",
  "errors": {
    "name": ["The name may not be greater than 255 characters."]
  }
}

When providing an invalid campaign id

Response code: 404 Not Found

Schedule a campaign

If you want to schedule or send immediately a campaign, use this POST request

POST https://connect.mailerlite.com/api/campaigns/{campaign_id}/schedule

Schedules a campaign, or sends it immediately when delivery is instant. The campaign must be a draft that is ready to send: it needs recipients, a designed email and a valid unsubscribe link.

Which body parameters apply depends on the delivery type and the campaign type. Use schedule for scheduled, timezone_based and smart_sending deliveries, resend for auto-resend campaigns, and sending_time_test_schedule for campaigns testing sending time.

RSS campaigns take no body: their send time comes from the feed settings.

Request body

ParameterTypeRequiredLimitations
deliverystringyes unless campaign type is rssWhen to send the campaign. One of instant, scheduled, timezone_based or smart_sending. Required unless the campaign type is rss.
schedule[date]stringonly for scheduled, timezone_based and smart_sending delivery typesThe date to send on, in Y-m-d format. Must be in the future. Used by the scheduled, timezone_based and smart_sending deliveries. For timezone_based it must be after today.
schedule[hours]stringonly for scheduled and timezone_based delivery typesThe hour to send at, in HH format. Used by the scheduled and timezone_based deliveries.
schedule[minutes]stringonly for scheduled and timezone_based delivery typesThe minute to send at, in ii format. Used by the scheduled and timezone_based deliveries.
schedule[timezone_id]integernoThe timezone to interpret the send time in, by timezone ID. Defaults to the account's timezone.
resend[delivery]stringonly for campaign of type auto resendWhen to send the second email of an auto-resend campaign. Either day or scheduled.
resend[date]stringonly for campaign of type auto resendThe date to resend on, in Y-m-d format. Must be at least 24 hours after the first send.
resend[hours]stringonly for campaign of type auto resendThe hour to resend at, in HH format.
resend[minutes]stringonly for campaign of type auto resendThe minute to resend at, in ii format.
resend[timezone_id]integernoThe timezone to interpret the resend time in, by timezone ID. Defaults to the account's timezone.
sending_time_test_schedulearrayonly if the campaign tests sending timeThe send times to test, ordered from soonest to furthest in the future. Required when the campaign tests sending time. An A/B campaign takes exactly 2 entries, a multivariate campaign takes between 2 and 8.
sending_time_test_schedule.*.datestringonly if the campaign tests sending timeThe date of this send time, in Y-m-d format. Must be in the future.
sending_time_test_schedule.*.hoursstringonly if the campaign tests sending timeThe hour of this send time, in HH format.
sending_time_test_schedule.*.minutesstringonly if the campaign tests sending timeThe minute of this send time, in ii format.
sending_time_test_schedule.*.timezone_idintegernoThe timezone to interpret this send time in, by timezone ID. Defaults to the account's timezone.

Response

Response code: 200 OK
{
  "data": {
      "id": "1",
      "account_id": "1",
      "name": "Dummy campaign",
      "type": "regular",
      "status": "sent",
      "missing_data": [],
      "settings": {
        "track_opens": true,
        "use_google_analytics": false,
        "ecommerce_tracking": false
      },
      "filter": [
        [
          {
            "operator": "in_any",
            "args": [
               "groups",
                  [
                    "42"
                  ]
            ]
          }
        ]
      ],
      "filter_for_humans": [
        [
          "In any group: dummy group"
        ]
      ],
      "delivery_schedule": "instant",
      "language_id": "4",
      "created_at": "2022-07-26 15:07:52",
      "updated_at": "2022-07-26 15:12:17",
      "scheduled_for": "2022-07-26 15:11:51",
      "queued_at": "2022-07-26 15:12:04",
      "started_at": "2022-07-26 15:12:04",
      "finished_at": "2022-07-26 15:12:17",
      "stopped_at": null,
      "default_email_id": "61706700654118223",
      "emails": [
          {
              "id": "1",
              "account_id": "1",
              "emailable_id": "12",
              "emailable_type": "campaigns",
              "type": "builder",
              "from": "dummy@mailerlite.io",
              "from_name": "Dummy Testerson",
              "name": null,
              "reply_to": "reply-to@mailerlite.io",
              "subject": "hello",
              "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
              "screenshot_url": null,
              "preview_url": null,
              "created_at": "2022-07-26 15:08:15",
              "updated_at": "2022-07-26 15:15:29",
              "is_designed": true,
              "language_id": null,
              "is_winner": false,
              "stats": {
                  "sent": 10,
                  "opens_count": 0,
                  "unique_opens_count": 0,
                  "open_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "clicks_count": 0,
                  "unique_clicks_count": 0,
                  "click_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "unsubscribes_count": 0,
                  "unsubscribe_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "spam_count": 0,
                  "spam_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "hard_bounces_count": 0,
                  "hard_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "soft_bounces_count": 0,
                  "soft_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "forwards_count": 0
              },
              "send_after": null,
              "track_opens": true
          }
      ],
      "used_in_automations": false,
      "type_for_humans": "Regular",
      "is_stopped": false,
      "has_winner": null,
      "winner_version_for_human": null,
      "winner_sending_time_for_humans": null,
      "winner_selected_manually_at": null,
      "uses_ecommerce": false,
      "uses_survey": true,
      "can_be_scheduled": false,
      "warnings": [],
      "initial_created_at": null,
      "is_currently_sending_out": false
  }
}

Error

When campaign settings are not complete

Response code: 422 Unprocessable entity
"Campaign settings missing"

When campaign with given ID has not been found for the account

Response code: 404 Not found

Cancel a ready campaign

If you wish to cancel a campaign that is currently in a ready state, use this POST request

Request

POST https://connect.mailerlite.com/api/campaigns/{campaign_id}/cancel

Cancels a campaign that is scheduled but has not started sending, returning it to draft so you can edit and reschedule it. Campaigns that have already started or finished sending cannot be cancelled.

Response

Response code: 200 OK
{
  "data": {
      "id": "1",
      "account_id": "1",
      "name": "Dummy campaign",
      "type": "regular",
      "status": "draft",
      "missing_data": [],
      "settings": {
        "track_opens": true,
        "use_google_analytics": false,
        "ecommerce_tracking": false
      },
      "filter": [
        [
          {
            "operator": "in_any",
            "args": [
               "groups",
                  [
                    "42"
                  ]
            ]
          }
        ]
      ],
      "filter_for_humans": [
        [
          "In any group: dummy group"
        ]
      ],
      "delivery_schedule": "instant",
      "language_id": "4",
      "created_at": "2022-07-26 15:07:52",
      "updated_at": "2022-07-26 15:12:17",
      "scheduled_for": null,
      "queued_at": null,
      "started_at": null,
      "finished_at": null,
      "stopped_at": null,
      "default_email_id": "61706700654118223",
      "emails": [
          {
              "id": "1",
              "account_id": "1",
              "emailable_id": "12",
              "emailable_type": "campaigns",
              "type": "builder",
              "from": "dummy@mailerlite.io",
              "from_name": "Dummy Testerson",
              "name": null,
              "reply_to": "reply-to@mailerlite.io",
              "subject": "hello",
              "plain_text": "Hello,\n\nYou have received a newsletter from {$account}.\n\nHowever, your email software can't display HTML emails. You can view the newsletter by clicking here: {$url}\nYou're receiving this newsletter because you have shown interest in {$account}.\nNot interested anymore? Click here to unsubscribe:\n{$unsubscribe}",
              "screenshot_url": null,
              "preview_url": null,
              "created_at": "2022-07-26 15:08:15",
              "updated_at": "2022-07-26 15:15:29",
              "is_designed": true,
              "language_id": null,
              "is_winner": false,
              "stats": {
                  "sent": 10,
                  "opens_count": 0,
                  "unique_opens_count": 0,
                  "open_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "clicks_count": 0,
                  "unique_clicks_count": 0,
                  "click_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "unsubscribes_count": 0,
                  "unsubscribe_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "spam_count": 0,
                  "spam_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "hard_bounces_count": 0,
                  "hard_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "soft_bounces_count": 0,
                  "soft_bounce_rate": {
                      "float": 0,
                      "string": "0%"
                  },
                  "forwards_count": 0
              },
              "send_after": null,
              "track_opens": true
          }
      ],
      "used_in_automations": false,
      "type_for_humans": "Regular",
      "is_stopped": false,
      "has_winner": null,
      "winner_version_for_human": null,
      "winner_sending_time_for_humans": null,
      "winner_selected_manually_at": null,
      "uses_ecommerce": false,
      "uses_survey": true,
      "can_be_scheduled": false,
      "warnings": [],
      "initial_created_at": null,
      "is_currently_sending_out": false
  }
}

Error

When trying to cancel a campaign sending that is not in a ready state

Response code: 400 Bad request

When campaign with given ID has not been found for the account

Response code: 404 Not found

Delete a campaign

If you want to delete a campaign, use this DELETE request

DELETE https://connect.mailerlite.com/api/campaigns/{campaign_id}

Deletes a campaign. A campaign that is still sending is stopped first.

Response

Response Code: 204 No Content

Error

Response code: 404 Not found

Get subscribers' activity of a sent campaign

If you want to get the subscribers' activity of a campaign with status sent use this GET request

GET https://connect.mailerlite.com/api/campaigns/{campaign_id}/reports/subscriber-activity

Returns a paginated list of the recipients of a sent campaign, together with how each of them engaged with it.

Use filter[type] to narrow the list to a single kind of activity, such as everyone who clicked or everyone who bounced, and filter[search] to look up one subscriber by email.

Request parameters

ParameterTypeRequiredLimitations
filter[type]stringnoReturn only recipients with this kind of activity. One of opened, unopened, clicked, unsubscribed, forwarded, hardbounced, softbounced, junk, sent or social_interaction. Returns all recipients when omitted.
filter[search]stringnoReturn only the activity of the subscriber with this email address.
limitintegernoNumber of recipients to return per page. One of 10, 25, 50 or 100.
sortstringnoField to sort recipients by: id, clicks_count or opens_count. Prefix with - for descending order, e.g. -opens_count.
pageintegernoPage number to return. Counting starts from 1.
includestringnoAdditional relations to embed in the response. subscriber and subscriber.groups are supported.

Response

Response code: 200 OK
{
    "data": [
        {
          "id":"66201001018787256",
          "opens_count":1,
          "clicks_count":0,
          "subscriber": {
            "id":"56152210168350162",
            "email":"dummy@mailerlite.com",
            "status":"active",
            "source":"import",
            "sent":13,
            "opens_count":1,
            "clicks_count":0,
            "open_rate":7.69,
            "click_rate":0,
            "ip_address":null,
            "subscribed_at":"2022-05-26 07:42:00",
            "unsubscribed_at":null,
            "created_at":"2022-05-26 07:42:00",
            "updated_at":"2022-09-14 05:44:16",
            "fields": {
              "name":null,
              "last_name":null,
              "company":null,
              "country":null,
              "city":null,
              "phone":null,
              "state":null,
              "zip":null
            },
            "opted_in_at":null,
            "optin_ip":null
          }
        }
      ],
    "links": {
      "first":"https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/subscriber-activity?page=1",
      "last":"https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/subscriber-activity?page=1",
      "prev":null,
      "next":null
    },
    "meta": {
      "current_page":1,
      "from":1,
      "last_page":1,
      "links": [
        {
          "url":null,
          "label":"« Previous",
          "active":false
        },
        {
          "url":"https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/subscriber-activity?page=1",
          "label":"1",
          "active":true
        },
        {
          "url":null,
          "label":"Next »",
          "active":false
        }
      ],
      "path":"https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/subscriber-activity",
      "per_page":50,
      "to":1,
      "total":1,
      "aggregations": {
        "sum":11,
        "opened":1,
        "unopened":10,
        "clicked":0,
        "unsubscribed":0,
        "forwarded":0,
        "hardbounced":0,
        "softbounced":0,
        "junk":0
      }
    }
}

Error

When providing an invalid campaign id

Response code: 404 Not Found
{
  "message": "The given data was invalid.",
  "errors": {
    "limit": ["The limit must be one of following: 10, 25, 50, 100"]
  }
}

Get campaign e-commerce stats

If you want to get the orders and revenue a campaign earned in a shop, use this GET request

GET https://connect.mailerlite.com/api/campaigns/{campaign_id}/reports/ecommerce

Returns the orders and revenue attributed to a campaign's emails for one shop: the order count, revenue, average order value and conversion rate under ecommerce, plus the best performing email.

Request parameters

ParameterTypeRequiredLimitations
shop_idintegeryesReport on orders from this shop, by e-commerce shop ID.

Response

Response code: 200 OK
{
  "data": {
    "ecommerce": {
      "orders_count": 2,
      "revenue": 40,
      "average_order_value": 20,
      "conversion_rate": "2%"
    },
    "best_performing_email": null
  }
}

best_performing_email is only set when the campaign has more than one email, for example an A/B test.

Error

When providing an invalid campaign or shop id

Response code: 404 Not Found

Get campaign e-commerce orders

If you want to list the orders a campaign earned in a shop, use this GET request

GET https://connect.mailerlite.com/api/campaigns/{campaign_id}/reports/ecommerce/orders

Returns a paginated list of the individual orders from one shop attributed to a campaign's emails, with the subscriber, the order total and the products ordered.

Request parameters

ParameterTypeRequiredLimitations
shop_idintegeryesList orders from this shop, by e-commerce shop ID.
limitintegernoNumber of orders to return per page. Defaults to 10.
pageintegernoPage number to return. Counting starts from 1.

Response

Response code: 200 OK
{
  "data": [
    {
      "subscriber": {
        "email": "dummy@mailerlite.com",
        "id": "56152210168350162"
      },
      "total": 20,
      "updated_at": "2026-09-14 05:44:16",
      "order": "2 X T-shirt, 1 X Mug"
    }
  ],
  "links": {
    "first": "https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/ecommerce/orders?page=1",
    "last": "https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/ecommerce/orders?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "https://connect.mailerlite.com/api/campaigns/66200823885989563/reports/ecommerce/orders",
    "per_page": 10,
    "to": 1,
    "total": 1
  }
}

Error

When providing an invalid campaign or shop id

Response code: 404 Not Found

On this page