Subscribers

You can add or update subscribers in your mailing list.

List all subscribers

If you want to list all of your subscribers, send this GET request

GET https://connect.mailerlite.com/api/subscribers
1

Request body

ParameterTypeRequiredLimitations
filter[status]stringnoMust be one of the possible statuses: active, unsubscribed, unconfirmed, bounced or junk.
limitintegernoDefaults to 25
pageintegernoDefaults to 1

Response

{
  "data": [
    {
      "id": "31986843064993537",
      "email": "dummy@example.com",
      "status": "active",
      "source": "api",
      "sent": 0,
      "opens_count": 0,
      "clicks_count": 0,
      "open_rate": 0,
      "click_rate": 0,
      "ip_address": null,
      "subscribed_at": "2021-09-01 14:03:50",
      "unsubscribed_at": null,
      "created_at": "2021-09-01 14:03:50",
      "updated_at": "2021-09-01 14:03:50",
      "fields": {
        "city": null,
        "company": null,
        "country": null,
        "last_name": "Testerson",
        "name": "Dummy",
        "phone": null,
        "state": null,
        "z_i_p": null
      },
      "groups": [],
      "opted_in_at": null,
      "optin_ip": null
    }
  ],
  "links": {
    "first": "https://connect.mailerlite.com/api/subscribers?page=1",
    "last": "https://connect.mailerlite.com/api/subscribers?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/subscribers?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "https://connect.mailerlite.com/api/subscribers",
    "per_page": 25,
    "to": 1,
    "total": 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

Create/update subscriber

If you want to create or update a subscriber, send this POST request

POST /api/subscribers
1

If a subscriber already exists, it will be updated.

Request

ParameterTypeRequiredLimitations
emailstringyesValid email address as per RFC 2821
fieldsobjectnoObject keys must correspond to default or custom fields
groupsarraynoarray must contain existing group ids. Subscriber can only be added to groups this way and will not be removed by omission
statusstringnoCan be one of the following: active, unsubscribed, unconfirmed, bounced, junk
subscribed_atstringnoMust be a valid date in the format yyyy-MM-dd HH:mm:ss
ip_addressstringnoMust be a valid ip address
opted_in_atstringnoMust be a valid date in the format yyyy-MM-dd HH:mm:ss
optin_ipstringnoMust be a valid ip address
unsubscribed_atstringnoMust be a valid date in the format yyyy-MM-dd HH:mm:ss
{
    "email": "dummy@example.com",
    "fields": {
      "name": "Dummy",
      "last_name": "Testerson"
    },
    "groups": [
        "4243829086487936",
        "14133878422767533",
        "31985378335392975"
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12

Response

If the subscriber was created:

Response Code: 201 Created
1

If the subscriber with specified email was already in the mailing list:

Response Code: 200 OK
1
{
  "data": {
    "id": "31897397363737859",
    "email": "dummy@example.com",
    "status": "active",
    "source": "api",
    "sent": 0,
    "opens_count": 0,
    "clicks_count": 0,
    "open_rate": 0,
    "click_rate": 0,
    "ip_address": null,
    "subscribed_at": "2021-08-31 14:22:08",
    "unsubscribed_at": null,
    "created_at": "2021-08-31 14:22:08",
    "updated_at": "2021-08-31 14:22:08",
    "fields": {
      "city": null,
      "company": null,
      "country": null,
      "last_name": "Testerson",
      "name": "Dummy",
      "phone": null,
      "state": null,
      "z_i_p": null
    },
    "groups": [],
    "opted_in_at": null,
    "optin_ip": null
  }
}
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

Error

Response Code: 422 Unprocessable Entity
1
{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email must be a valid email address."]
  }
}
1
2
3
4
5
6

Fetch a subscriber

If you want to fetch a subscriber, send this GET request

GET https://connect.mailerlite.com/api/subscribers/(:id or :email)
1

Request

ParameterTypeRequiredLimitations
emailstringnoMust provide either valid subscriber id or email
idstringnoMust provide either valid subscriber id or email
GET /api/subscribers/31986843064993537
GET /api/subscribers/dummy@example.com
1
2

Response

If subscriber exists:

Response Code: 200 OK
1
{
  "data": {
    "id": "31986843064993537",
    "email": "dummy@example.com",
    "status": "active",
    "source": "api",
    "sent": 0,
    "opens_count": 0,
    "clicks_count": 0,
    "open_rate": 0,
    "click_rate": 0,
    "ip_address": null,
    "subscribed_at": "2021-09-01 14:03:50",
    "unsubscribed_at": null,
    "created_at": "2021-09-01 14:03:50",
    "updated_at": "2021-09-01 14:03:50",
    "fields": {
      "city": null,
      "company": null,
      "country": null,
      "last_name": "Testerson",
      "name": "Dummy",
      "phone": null,
      "state": null,
      "z_i_p": null
    },
    "groups": [],
    "opted_in_at": null,
    "optin_ip": null
  }
}
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

Error

If the subscriber cannot be found:

Response Code: 404 Not Found
1

Fetch total subscribers count

GET /api/subscribers?limit=0
1

Request

ParameterTypeRequiredLimitations
limitintegeryesValue must be 0

Response

Response Code: 200 OK
1
{
  "total": 100
}
1
2
3

Delete a subscriber

If you want to delete a subscriber, send this DELETE request

   DELETE https://connect.mailerlite.com/api/subscribers/:id
1

Request

ParameterTypeRequiredLimitations
idstringyesValid subscriber id for the account

Response

Response code: 204 No Content
1

Error

Response code: 404 Not Found
1

Get single import

If you want to get a single import report, send this GET request

GET https://connect.mailerlite.com/api/subscribers/import/{import_id}
1

Response

Response Code: 200 OK
1
{
  "data": {
    "id": "47366063630845932",
    "total": 3,
    "processed": 3,
    "imported": 0,
    "updated": 0,
    "errored": 3,
    "percent": 100,
    "done": true,
    "file_path": "",
    "invalid": [],
    "invalidCount": 0,
    "mistyped": [],
    "mistypedCount": 0,
    "changed": [],
    "changedCount": 0,
    "unchanged": [
      {
        "id": "47366064023013357",
        "email": "dummy_one@import.com"
      },
      {
        "id": "47366064023013358",
        "email": "dummy_two+two@import.com"
      },
      {
        "id": "47366064023013359",
        "email": "dummy_three@new.com"
      }
    ],
    "unchangedCount": 3,
    "unsubscribed": [],
    "unsubscribedCount": 0,
    "role_based": [],
    "roleBasedCount": 0,
    "bannedImportEmailsCount": 0,
    "matchRoute": "",
    "source_label": "",
    "updated_at": "2022-02-18T08:09:58.000000Z",
    "undone_at": null,
    "stopped_at": null,
    "undo_started_at": null,
    "finished_at": "2022-02-18T08:09:58.000000Z"
  }
}
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
Last Updated: