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
Request parameters
Parameter | Type | Required | Limitations |
---|---|---|---|
filter[status] | string | no | Must be one of the following: sent, draft, ready. Defaults to ready |
filter[type] | string | no | Must be one of the following: regular, ab, resend, rss. Defaults to return all |
limit | integer | no | Defaults to 25 |
page | integer | no | Defaults to 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
}
}
}
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}
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
}
}
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
Create a campaign
You can create a campaign using this POST
request
POST https://connect.mailerlite.com/api/campaigns
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
name | string | yes | Maximum string length of 255 characters |
language_id | integer | no | Used to define the language in the unsubscribe template. Must be a valid language id. Defaults to english |
type | string | yes | Must be one of the following: regular , ab , resend . Type resend is only available for accounts on growing or advanced plans |
emails | array | yes | Must contain 1 email object item |
emails.*.subject | string | yes | Maximum string length of 255 characters |
emails.*.from_name | string | yes | Maximum string length of 255 characters |
emails.*.from | string | yes | Must be a valid email address that has been already verified on MailerLite |
emails.*.reply_to | string | no | Must be a valid reply_to email address that has been already verified on MailerLite |
emails.*.content | string | no | Must be a valid html content and account must be on advanced plan |
groups | array | no | Must contain valid group ids belonging to the account |
segments | array | no | Must contain valid segment ids belonging to the account. If both groups and segments are provided, only segments are used |
ab_settings | object | only if type is ab | All items of the array are required |
ab_settings[test_type] | string | only if type is ab | Must be one of the following: subject , sender , sending_time |
ab_settings[select_winner_by] | string | only if type is ab and test type is not sending_time | Must be one of the following: o (for opens), c (for clicks) |
ab_settings[after_time_amount] | integer | only if type is ab and test type is not sending_time | Defines the amount of wait time for the ab testing |
ab_settings[after_time_unit] | string | only if type is ab and test type is not sending_time | Defines the unit of the wait time. Must be one of the following: h (for hours) or d (for days) |
ab_settings[test_split] | integer | only if type is ab | Must be between 5 and 25 for test types subject and sender and 100 for sending_time test type |
ab_settings[b_value] | object | only if type is ab and test type is not sending_time | Must contain the items for the b version of the campaign |
ab_settings[b_value][subject] | string | only if ab test type is subject | Maximum string length of 255 characters |
ab_settings[b_value][from_name] | string | only if ab test type is sender | Maximum string length of 255 characters |
ab_settings[b_value][from] | string | only if ab test type is sender | Must be a valid email address that has been already verified on MailerLite |
resend_settings | object | only if type is resend | All items of the array are required |
resend_settings[test_type] | string | only if type is resend | Must be one of the following: subject |
resend_settings[select_winner_by] | string | only if type is resend | Defines 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] | object | only if type is resend | Must contain the items for the auto resend of the campaign |
resend_setings[b_value][subject] | string | only if type is resend | Maximum string length of 255 characters |
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
}
}
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
{
"message": "The given data was invalid.",
"errors": {
"type": ["The selected type is invalid."]
}
}
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}
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
name | string | yes | Maximum string length of 255 characters |
language_id | integer | no | Used to define the language in the unsubscribe template. Must be a valid language id. Defaults to english |
emails | array | yes | Must contain 1 email object item |
emails.*.subject | string | yes | Maximum string length of 255 characters |
emails.*.from_name | string | yes | Maximum string length of 255 characters |
emails.*. from | string | yes | Must be a valid email address that has been already verified on MailerLite |
emails.*.content | string | no | Must be a valid html content and account must be on advanced plan |
groups | array | no | Must contain valid group ids belonging to the account |
segments | array | no | Must contain valid segment ids belonging to the account. If both groups and segments are provided, only segments are used |
ab_settings | object | only if type is ab | All items of the array are required |
ab_settings[test_type] | string | only if type is ab | Must be one of the following: subject , sender , sending_time |
ab_settings[select_winner_by] | string | only if type is ab and test type is not sending_time | Must be one of the following: o (for opens), c (for clicks) |
ab_settings[after_time_amount] | integer | only if type is ab and test type is not sending_time | Defines the amount of wait time for the ab testing |
ab_settings[after_time_unit] | string | only if type is ab and test type is not sending_time | Defines the unit of the wait time. Must be one of the following: h (for hours) or d (for days) |
ab_settings[test_split] | integer | only if type is ab | Must be between 5 and 25 for test types subject and sender and 100 for sending_time test type |
ab_settings[b_value] | object | only if type is ab and test type is not sending_time | Must contain the items for the b version of the campaign |
ab_settings[b_value][subject] | string | only if ab test type is subject | Maximum string length of 255 characters |
ab_settings[b_value][from_name] | string | only if ab test type is sender | Maximum string length of 255 characters |
ab_settings[b_value][from] | string | only if ab test type is sender | Must be a valid email address that has been already verified on MailerLite |
resend_settings | object | only if type is resend | All items of the array are required |
resend_settings[test_type] | string | only if type is resend | Must be one of the following: subject |
resend_settings[select_winner_by] | string | only if type is resend | Defines 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] | object | only if type is resend | Must contain the items for the auto resend of the campaign |
resend_setings[b_value][subject] | string | only if type is resend | Maximum string length of 255 characters |
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
}
}
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
"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."]
}
}
2
3
4
5
6
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
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
delivery | string | yes unless campaign type is rss | Must be one of the following: instant, scheduled, timezone_based, smart_sending |
schedule[date] | string | only for scheduled and smart_sending delivery type | Must be a date in the future. Campaign must not be of type AB test with sending time test type |
schedule[hours] | string | only for scheduled or timezone based delivery types | Must be a valid hour in HH format. Campaign must not be of type AB test with sending time test type |
schedule[minutes] | string | only for scheduled or timezone based delivery types | Must be a valid minute in ii format. Campaign must not be of type AB test with sending time test type |
schedule[timezone_id] | integer | no | Must 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] | string | only for campaign of type auto resend | Must be Must be one of the following: day, scheduled |
resend[date] | string | only for campaign of type auto resend | Must be a date in the future |
resend[hours] | string | only for campaign of type auto resend | Must be a valid hour in HH format |
resend[minutes] | string | only for campaign of type auto resend | Must be a valid minute in ii format |
resend[timezone_id] | integer | no | Must be a valid timezone id, defaults to the account's timezone id |
sending_time_test_schedule | array | yes if campaign is of type AB test with sending time test type | Must constain 2 sending times |
sending_time_test_schedule.*.date | string | yes if campaign is of type AB test with sending time test type | Must be a date in the future |
sending_time_test_schedule.*.hours | string | yes if campaign is of type AB test with sending time test type | Must be a valid hour in HH format. |
sending_time_test_schedule.*.minutes | string | yes if campaign is of type AB test with sending time test type | Must be a valid minute in ii format. |
sending_time_test_schedule.*.timezone_id | string | yes if campaign is of type AB test with sending time test type | Must be a valid timezone id, defaults to the account's timezone id. |
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
}
}
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
"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
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
}
}
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
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}
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
Request body
Parameter | Type | Required | Limitations |
---|---|---|---|
filter[type] | string | no | Must be one of following: opened , unopened , clicked , unsubscribed , forwarded , hardbounced , softbounced , junk . Defaults to returning all recipients |
filter[search] | string | no | Must be a subscriber email |
limit | integer | no | Must be one of the following: 10, 25, 50, 100 . Defaults to 50 |
sort | string | no | Must be one of the following: id , updated_at , clicks_count , opens_count . Defaults to id |
page | integer | no | Defaults to 1 |
include | string | no | Additional resources to include in the response. Currently 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
}
}
}
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
{
"message": "The given data was invalid.",
"errors": {
"limit": ["The limit must be one of following: 10, 25, 50, 100"]
}
}
2
3
4
5
6