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
| Type | Description |
|---|---|
regular | A single email to your chosen recipients. |
ab | An A/B test varying the subject, sender or sending time. |
resend | Sends a second time to recipients who did not open or click. Available on paid plans and during the free trial. |
multivariate | Tests several variables at once, in 2 to 8 combinations. Available on paid plans and during the free trial. |
rss | Sends 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:
| Delivery | Sends |
|---|---|
instant | Right away. |
scheduled | At a date and time you pick. |
timezone_based | At a local time in each recipient's own timezone. |
smart_sending | At 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/campaignsReturns 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| filter[status] | string | no | Return 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] | string | no | Return 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] | string | no | Only include campaigns from this date onwards, in Y-m-d format. |
| filter[date_to] | string | no | Only include campaigns up to this date, in Y-m-d format. |
| filter[folder] | integer | no | Return only campaigns in this folder, by folder ID. |
| filter[subject] | string | no | Return only campaigns whose subject line contains this value. |
| limit | integer | no | Number of campaigns to return per page. Defaults to 25, maximum 100. |
| page | integer | no | Page 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 FoundCreate a campaign
You can create a campaign using this POST request
POST https://connect.mailerlite.com/api/campaignsCreates a draft campaign. The campaign is not sent until you schedule it.
Request body
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| name | string | yes | The name of the campaign. Up to 255 characters. |
| type | string | yes | The 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_id | integer | no | Language used for the unsubscribe template, by language ID. Defaults to English. |
| emails | array | yes, unless type is multivariate | The 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.*.subject | string | yes, unless multivariate campaign | The subject line of the email. Up to 255 characters. Required unless this is a multivariate campaign. |
| emails.*.from_name | string | yes, unless multivariate campaign | The sender name shown to recipients. Up to 255 characters. Required unless this is a multivariate campaign. |
| emails.*.from | string | yes, unless multivariate campaign | The sender email address. Must already be verified on MailerLite. Required unless this is a multivariate campaign. |
| emails.*.reply_to | string | no | The reply-to email address. Must already be verified on MailerLite. |
| emails.*.content | string | no | The 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.*.editor | string | no | Set 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_id | integer | no | The 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. |
| groups | array | no | Group IDs to send the campaign to. Ignored when segments is also given. |
| segments | array | no | Segment IDs to send the campaign to. Takes precedence over groups when both are given. |
| ab_settings | object | only if type is ab | A/B test configuration. Required when type is ab, and all of its keys are then required. |
| ab_settings[test_type] | string | only if type is ab | What the A/B test varies. One of subject, sender or sending_time. |
| ab_settings[select_winner_by] | string | only if type is ab and test type is not sending_time | Metric 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] | integer | only if type is ab and test type is not sending_time | How long to wait before picking the winner. Not used when the test type is sending_time. |
| ab_settings[after_time_unit] | string | only if type is ab and test type is not sending_time | Unit for the wait time. h for hours or d for days. Not used when the test type is sending_time. |
| ab_settings[test_split] | integer | only if type is ab | Percentage 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] | object | only if type is ab and test type is not sending_time | The B version of the campaign. Not used when the test type is sending_time. |
| ab_settings[b_value][subject] | string | only if ab test type is subject | Subject line of the B version. Up to 255 characters. Used when the test type is subject. |
| ab_settings[b_value][from_name] | string | only if ab test type is sender | Sender name of the B version. Up to 255 characters. Used when the test type is sender. |
| ab_settings[b_value][from] | string | only if ab test type is sender | Sender email address of the B version. Must already be verified on MailerLite. Used when the test type is sender. |
| resend_settings | object | only if type is resend | Auto-resend configuration. Required when type is resend, and all of its keys are then required. |
| resend_settings[test_type] | string | only if type is resend | What the resend varies. Currently only subject. |
| resend_settings[select_winner_by] | string | only if type is resend | Who receives the second email. o for recipients who did not open, c for recipients who did not click. |
| resend_settings[b_value] | object | only if type is resend | The content of the resent email. |
| resend_settings[b_value][subject] | string | only if type is resend | Subject line of the resent email. Up to 255 characters. |
| multivariate_settings | object | only if type is multivariate | Multivariate test configuration. Required when type is multivariate. Each email variant needs at least 10 recipients. |
| multivariate_settings[test_variants] | object | only if type is multivariate | The 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] | array | only if type is multivariate | Subject line variants. At least one. |
| multivariate_settings[test_variants][subject.*] | string | only if type is multivariate | A subject line variant. Up to 998 characters. |
| multivariate_settings[test_variants][sender] | array | only if type is multivariate | Sender variants. At least one. |
| multivariate_settings[test_variants][sender.*.from] | string | only if type is multivariate | Sender email address for this variant. Must already be verified on MailerLite. |
| multivariate_settings[test_variants][sender.*.from_name] | string | only if type is multivariate | Sender name for this variant. Up to 255 characters. |
| multivariate_settings[test_variants][content] | integer | only if type is multivariate | How many content variants to test. Between 1 and 8. |
| multivariate_settings[test_variants][sending_time] | integer | only if type is multivariate | How many sending times to test. Between 1 and 8. |
| multivariate_settings[select_winner_by] | string | no | Metric used to pick the winning combination. o for opens, c for clicks. Not used when sending time is tested. |
| multivariate_settings[after_time_amount] | integer | no | How long to wait before picking the winner. Between 1 and 10. Not used when sending time is tested. |
| multivariate_settings[after_time_unit] | string | no | Unit for the wait time. h for hours or d for days. Not used when sending time is tested. |
| multivariate_settings[test_split] | integer | no | Percentage of recipients who receive the test. Must be 100 when there are fewer than 1,000 recipients per variant, otherwise at most 50. |
| settings | object | no | Campaign configuration options. |
| settings[ecommerce_tracking] | boolean | no | Enable 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| name | string | yes | The name of the campaign. Up to 255 characters. |
| language_id | integer | no | Language used for the unsubscribe template, by language ID. Unchanged when omitted. |
| emails | array | no | The 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.*.subject | string | no | The subject line of the email. Up to 255 characters. |
| emails.*.from_name | string | no | The sender name shown to recipients. Up to 255 characters. |
| emails.*.from | string | no | The sender email address. Must already be verified on MailerLite. |
| emails.*.reply_to | string | no | The reply-to email address. Must already be verified on MailerLite. |
| emails.*.content | string | no | The 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. |
| groups | array | no | Group IDs to send the campaign to. Ignored when segments is also given. |
| segments | array | no | Segment IDs to send the campaign to. Takes precedence over groups when both are given. |
| ab_settings | object | only if type is ab | A/B test configuration. Required when the campaign type is ab, and all of its keys are then required. |
| ab_settings[test_type] | string | only if type is ab | What the A/B test varies. One of subject, sender or sending_time. |
| ab_settings[select_winner_by] | string | only if type is ab and test type is not sending_time | Metric 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] | integer | only if type is ab and test type is not sending_time | How long to wait before picking the winner. Not used when the test type is sending_time. |
| ab_settings[after_time_unit] | string | only if type is ab and test type is not sending_time | Unit for the wait time. h for hours or d for days. Not used when the test type is sending_time. |
| ab_settings[test_split] | integer | only if type is ab | Percentage 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] | object | only if type is ab and test type is not sending_time | The B version of the campaign. Not used when the test type is sending_time. |
| ab_settings[b_value][subject] | string | only if ab test type is subject | Subject line of the B version. Up to 255 characters. Used when the test type is subject. |
| ab_settings[b_value][from_name] | string | only if ab test type is sender | Sender name of the B version. Up to 255 characters. Used when the test type is sender. |
| ab_settings[b_value][from] | string | only if ab test type is sender | Sender email address of the B version. Must already be verified on MailerLite. Used when the test type is sender. |
| resend_settings | object | only if type is resend | Auto-resend configuration. Required when the campaign type is resend, and all of its keys are then required. |
| resend_settings[test_type] | string | only if type is resend | What the resend varies. Currently only subject. |
| resend_settings[select_winner_by] | string | only if type is resend | Who receives the second email. o for recipients who did not open, c for recipients who did not click. |
| resend_settings[b_value] | object | only if type is resend | The content of the resent email. |
| resend_settings[b_value][subject] | string | only if type is resend | Subject line of the resent email. Up to 255 characters. |
| multivariate_settings | object | only if type is multivariate | Multivariate test configuration. Required when the campaign type is multivariate. Each email variant needs at least 10 recipients. |
| multivariate_settings[test_variants] | object | only if type is multivariate | The variants to test. Must keep the same number of variants the campaign was created with. |
| multivariate_settings[select_winner_by] | string | no | Metric used to pick the winning combination. o for opens, c for clicks. Not used when sending time is tested. |
| multivariate_settings[after_time_amount] | integer | no | How long to wait before picking the winner. Between 1 and 10. Not used when sending time is tested. |
| multivariate_settings[after_time_unit] | string | no | Unit for the wait time. h for hours or d for days. Not used when sending time is tested. |
| multivariate_settings[test_split] | integer | no | Percentage 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 FoundSchedule 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}/scheduleSchedules 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| delivery | string | yes unless campaign type is rss | When to send the campaign. One of instant, scheduled, timezone_based or smart_sending. Required unless the campaign type is rss. |
| schedule[date] | string | only for scheduled, timezone_based and smart_sending delivery types | The 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] | string | only for scheduled and timezone_based delivery types | The hour to send at, in HH format. Used by the scheduled and timezone_based deliveries. |
| schedule[minutes] | string | only for scheduled and timezone_based delivery types | The minute to send at, in ii format. Used by the scheduled and timezone_based deliveries. |
| schedule[timezone_id] | integer | no | The timezone to interpret the send time in, by timezone ID. Defaults to the account's timezone. |
| resend[delivery] | string | only for campaign of type auto resend | When to send the second email of an auto-resend campaign. Either day or scheduled. |
| resend[date] | string | only for campaign of type auto resend | The date to resend on, in Y-m-d format. Must be at least 24 hours after the first send. |
| resend[hours] | string | only for campaign of type auto resend | The hour to resend at, in HH format. |
| resend[minutes] | string | only for campaign of type auto resend | The minute to resend at, in ii format. |
| resend[timezone_id] | integer | no | The timezone to interpret the resend time in, by timezone ID. Defaults to the account's timezone. |
| sending_time_test_schedule | array | only if the campaign tests sending time | The 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.*.date | string | only if the campaign tests sending time | The date of this send time, in Y-m-d format. Must be in the future. |
| sending_time_test_schedule.*.hours | string | only if the campaign tests sending time | The hour of this send time, in HH format. |
| sending_time_test_schedule.*.minutes | string | only if the campaign tests sending time | The minute of this send time, in ii format. |
| sending_time_test_schedule.*.timezone_id | integer | no | The 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 foundCancel 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}/cancelCancels 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 requestWhen campaign with given ID has not been found for the account
Response code: 404 Not foundDelete 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 ContentError
Response code: 404 Not foundGet 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-activityReturns 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| filter[type] | string | no | Return 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] | string | no | Return only the activity of the subscriber with this email address. |
| limit | integer | no | Number of recipients to return per page. One of 10, 25, 50 or 100. |
| sort | string | no | Field to sort recipients by: id, clicks_count or opens_count. Prefix with - for descending order, e.g. -opens_count. |
| page | integer | no | Page number to return. Counting starts from 1. |
| include | string | no | Additional 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/ecommerceReturns 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| shop_id | integer | yes | Report 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 FoundGet 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/ordersReturns 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
| Parameter | Type | Required | Limitations |
|---|---|---|---|
| shop_id | integer | yes | List orders from this shop, by e-commerce shop ID. |
| limit | integer | no | Number of orders to return per page. Defaults to 10. |
| page | integer | no | Page 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