Campaigns

You can create, update or send campaigns

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
1

Request parameters

ParameterTypeRequiredLimitations
filter[status]stringnoMust be one of the following: sent, draft, ready. Defaults to ready
filter[type]stringnoMust be one of the following: regular, ab, resend, rss. Defaults to return all
limitintegernoDefaults to 25
pageintegernoDefaults to 1

Response

Response Code: 200 OK
1
{
  "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
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

Get a campaign

You can fetch an existing campaign using this GET request

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

Response

Response code: 200 OK
1
{
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

Error

When providing an invalid campaign id

Response code: 404 Not Found
1

Create a campaign

You can create a campaign using this POST request

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

Request body

ParameterTypeRequiredLimitations
namestringyesMaximum string length of 255 characters
language_idintegernoUsed to define the language in the unsubscribe template. Must be a valid language id. Defaults to english
typestringyesMust be one of the following: regular, ab, resend. Type resend is only available for accounts on growing or advanced plans
emailsarrayyesMust contain 1 email object item
emails.*.subjectstringyesMaximum string length of 255 characters
emails.*.from_namestringyesMaximum string length of 255 characters
emails.*.fromstringyesMust be a valid email address that has been already verified on MailerLite
emails.*.reply_tostringnoMust be a valid reply_to email address that has been already verified on MailerLite
emails.*.contentstringnoMust be a valid html content and account must be on advanced plan
groupsarraynoMust contain valid group ids belonging to the account
segmentsarraynoMust contain valid segment ids belonging to the account. If both groups and segments are provided, only segments are used
ab_settingsobjectonly if type is abAll items of the array are required
ab_settings[test_type]stringonly if type is abMust be one of the following: subject, sender, sending_time
ab_settings[select_winner_by]stringonly if type is ab and test type is not sending_timeMust be one of the following: o (for opens), c (for clicks)
ab_settings[after_time_amount]integeronly if type is ab and test type is not sending_timeDefines the amount of wait time for the ab testing
ab_settings[after_time_unit]stringonly if type is ab and test type is not sending_timeDefines the unit of the wait time. Must be one of the following: h (for hours) or d (for days)
ab_settings[test_split]integeronly if type is abMust be between 5 and 25 for test types subject and sender and 100 for sending_time test type
ab_settings[b_value]objectonly if type is ab and test type is not sending_timeMust contain the items for the b version of the campaign
ab_settings[b_value][subject]stringonly if ab test type is subjectMaximum string length of 255 characters
ab_settings[b_value][from_name]stringonly if ab test type is senderMaximum string length of 255 characters
ab_settings[b_value][from]stringonly if ab test type is senderMust be a valid email address that has been already verified on MailerLite
resend_settingsobjectonly if type is resendAll items of the array are required
resend_settings[test_type]stringonly if type is resendMust be one of the following: subject
resend_settings[select_winner_by]stringonly if type is resendDefines the metric on which the recipients of the second email are selected. Must be one of the following: o (did not open the email), c (did not click the email)
resend_settings[b_value]objectonly if type is resendMust contain the items for the auto resend of the campaign
resend_setings[b_value][subject]stringonly if type is resendMaximum string length of 255 characters

Response

Response code: 200 OK
1
{
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

Error

When campaign request has missing parameters

Response code: 422 Unprocessable entity
1
{
  "message": "The given data was invalid.",
  "errors": {
    "type": ["The selected type is invalid."]
  }
}
1
2
3
4
5
6

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}
1

Request body

ParameterTypeRequiredLimitations
namestringyesMaximum string length of 255 characters
language_idintegernoUsed to define the language in the unsubscribe template. Must be a valid language id. Defaults to english
emailsarrayyesMust contain 1 email object item
emails.*.subjectstringyesMaximum string length of 255 characters
emails.*.from_namestringyesMaximum string length of 255 characters
emails.*. fromstringyesMust be a valid email address that has been already verified on MailerLite
emails.*.contentstringnoMust be a valid html content and account must be on advanced plan
groupsarraynoMust contain valid group ids belonging to the account
segmentsarraynoMust contain valid segment ids belonging to the account. If both groups and segments are provided, only segments are used
ab_settingsobjectonly if type is abAll items of the array are required
ab_settings[test_type]stringonly if type is abMust be one of the following: subject, sender, sending_time
ab_settings[select_winner_by]stringonly if type is ab and test type is not sending_timeMust be one of the following: o (for opens), c (for clicks)
ab_settings[after_time_amount]integeronly if type is ab and test type is not sending_timeDefines the amount of wait time for the ab testing
ab_settings[after_time_unit]stringonly if type is aband test type is not sending_timeDefines the unit of the wait time. Must be one of the following: h (for hours) or d (for days)
ab_settings[test_split]integeronly if type is abMust be between 5 and 25 for test types subject and sender and 100 for sending_time test type
ab_settings[b_value]objectonly if type is ab and test type is not sending_timeMust contain the items for the b version of the campaign
ab_settings[b_value][subject]stringonly if ab test type is subjectMaximum string length of 255 characters
ab_settings[b_value][from_name]stringonly if ab test type is senderMaximum string length of 255 characters
ab_settings[b_value][from]stringonly if ab test type is senderMust be a valid email address that has been already verified on MailerLite
resend_settingsobjectonly if type is resendAll items of the array are required
resend_settings[test_type]stringonly if type is resendMust be one of the following: subject
resend_settings[select_winner_by]stringonly if type is resendDefines the metric on which the recipients of the second email are selected. Must be one of the following: o (did not open the email), c (did not click the email)
resend_settings[b_value]objectonly if type is resendMust contain the items for the auto resend of the campaign
resend_setings[b_value][subject]stringonly if type is resendMaximum string length of 255 characters

Response

Response code: 200 OK
1
{
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

Error

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

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

When campaign request has missing parameters

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

When providing an invalid campaign id

Response code: 404 Not Found
1

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
1

Request body

ParameterTypeRequiredLimitations
deliverystringyes unless campaign type is rssMust be one of the following: instant, scheduled, timezone_based, smart_sending
schedule[date]stringonly for scheduled and smart_sending delivery typeMust be a date in the future. Campaign must not be of type AB test with sending time test type
schedule[hours]stringonly for scheduled or timezone based delivery typesMust be a valid hour in HH format. Campaign must not be of type AB test with sending time test type
schedule[minutes]stringonly for scheduled or timezone based delivery typesMust be a valid minute in ii format. Campaign must not be of type AB test with sending time test type
schedule[timezone_id]integernoMust be a valid timezone id, defaults to the account's timezone id. Campaign must not be of type AB test with sending time test type
resend[delivery]stringonly for campaign of type auto resendMust be Must be one of the following: day, scheduled
resend[date]stringonly for campaign of type auto resendMust be a date in the future
resend[hours]stringonly for campaign of type auto resendMust be a valid hour in HH format
resend[minutes]stringonly for campaign of type auto resendMust be a valid minute in ii format
resend[timezone_id]integernoMust be a valid timezone id, defaults to the account's timezone id
sending_time_test_schedulearrayyes if campaign is of type AB test with sending time test typeMust constain 2 sending times
sending_time_test_schedule.*.datestringyes if campaign is of type AB test with sending time test typeMust be a date in the future
sending_time_test_schedule.*.hoursstringyes if campaign is of type AB test with sending time test typeMust be a valid hour in HH format.
sending_time_test_schedule.*.minutesstringyes if campaign is of type AB test with sending time test typeMust be a valid minute in ii format.
sending_time_test_schedule.*.timezone_idstringyes if campaign is of type AB test with sending time test typeMust be a valid timezone id, defaults to the account's timezone id.

Response

Response code: 200 OK
1
{
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

Error

When campaign settings are not complete

Response code: 422 Unprocessable entity
1
"Campaign settings missing"
1

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

Response code: 404 Not found
1

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
1

Response

Response code: 200 OK
1
{
  "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
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

Error

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

Response code: 400 Bad request
1

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

Response code: 404 Not found
1

Delete a campaign

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

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

Response

Response Code: 204 No Content
1

Error

Response code: 404 Not found
1

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
1

Request body

ParameterTypeRequiredLimitations
filter[type]stringnoMust be one of following: opened, unopened, clicked, unsubscribed, forwarded, hardbounced, softbounced, junk. Defaults to returning all recipients
filter[search]stringnoMust be a subscriber email
limitintegernoMust be one of the following: 10, 25, 50, 100. Defaults to 50
sortstringnoMust be one of the following: id, updated_at, clicks_count, opens_count. Defaults to id
pageintegernoDefaults to 1
includestringnoAdditional resources to include in the response. Currently subscriber and subscriber.groups are supported.

Response

Response code: 200 OK
1
{
    "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
      }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

Error

When providing an invalid campaign id

Response code: 404 Not Found
1
{
  "message": "The given data was invalid.",
  "errors": {
    "limit": ["The limit must be one of following: 10, 25, 50, 100"]
  }
}
1
2
3
4
5
6
Last Updated: