Groups

You can see your existing groups or get the list of subscribers belonging to a given group

List all groups

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

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

Request parameters

ParameterTypeRequiredLimitations
limitintegernoAn account can have at most a 250 groups
pageintegernoCount starts from 1
filter[name]stringnoReturns partial matches
sortstringnoCan be one of: name, total, open_rate, click_rate, created_at. Defaults to ascending order; prepend -, e.g. -total for descending order.

Response

Response Code: 200 OK
1
{
  "data": [
    {
      "id": "1",
      "name": "dummy group",
      "active_count": 0,
      "sent_count": 0,
      "opens_count": 0,
      "open_rate": {
        "float": 0,
        "string": "0%"
      },
      "clicks_count": 0,
      "click_rate": {
        "float": 0,
        "string": "0%"
      },
      "unsubscribed_count": 0,
      "unconfirmed_count": 0,
      "bounced_count": 0,
      "junk_count": 0,
      "created_at": "2022-05-24 11:52:55"
    }
  ],
  "links": {
    "first": "https://connect.mailerlite.com/api/groups?page=1",
    "last": "https://connect.mailerlite.com/api/groups?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/groups?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "https://connect.mailerlite.com/api/groups",
    "per_page": 100,
    "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

Create a group

If you want to create a group, you can send this POST request

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

Request

ParameterTypeRequiredLimitations
namestringyesMaximum length of 255 characters

Response

Response Code: 201 Created
1
{
  "data": {
    "id": "1",
    "name": "dummy group",
    "active_count": 0,
    "sent_count": 0,
    "opens_count": 0,
    "open_rate": {
      "float": 0,
      "string": "0%"
    },
    "clicks_count": 0,
    "click_rate": {
      "float": 0,
      "string": "0%"
    },
    "unsubscribed_count": 0,
    "unconfirmed_count": 0,
    "bounced_count": 0,
    "junk_count": 0,
    "created_at": "2022-05-25 14:22:44"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Error

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

Update a group

If you want to update a group you can send this PUT request

PUT https://connect.mailerlite.com/api/groups/{group_id}
1

Request

ParameterTypeRequiredLimitations
namestringyesMaximum length of 255 characters

Response

Response Code: 200 OK
1
{
  "data": {
    "id": "1",
    "name": "dummy group",
    "active_count": 0,
    "sent_count": 0,
    "opens_count": 0,
    "open_rate": {
      "float": 0,
      "string": "0%"
    },
    "clicks_count": 0,
    "click_rate": {
      "float": 0,
      "string": "0%"
    },
    "unsubscribed_count": 0,
    "unconfirmed_count": 0,
    "bounced_count": 0,
    "junk_count": 0,
    "created_at": "2022-05-25 14:22:44"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Error

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

Delete group

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

DELETE https://connect.mailerlite.com/api/groups/{group_id}
1

Response

Response code: 204 No Content
1

Error

Response Code: 404 Not found
1

Get subscribers belonging to a group

If you want to get all subscribers belonging to a group, send this GET request

GET https://connect.mailerlite.com/api/groups/{group_id}/subscribers
1

Request

ParameterTypeRequiredLimitations
filter[status]stringnoMust be one of the possible statuses: active, unsubscribed, unconfirmed, bounced or junk. Defaults to active.
limitintegernoAn account can have at most a 100 groups
cursorstringnoDefaults to first page. Cursor value available in response body

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": null,
    "last": null,
    "prev": "https://connect.mailerlite.com/api/groups/1234567890/subscribers?cursor=eyJpZCI6NzI1ODIxNjQ2NDU5Mzg1NTksIl9wb2ludHNUb05leHRJdGVtcyI6ZmFsc2V9",
    "next": "https://connect.mailerlite.com/api/groups/1234567890/subscribers?cursor=eyJpZCI6NzI1ODIxNjQ2NDY5ODcxMzYsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
  },
  "meta": {
    "path": "https://connect.mailerlite.com/api/groups/1234567890/subscribers",
    "per_page": 25,
    "next_cursor": "eyJpZCI6NzI1ODIxNjQ2NDY5ODcxMzYsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
    "prev_cursor": "eyJpZCI6NzI1ODIxNjQ2NDU5Mzg1NTksIl9wb2ludHNUb05leHRJdGVtcyI6ZmFsc2V9"
  }
}
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

Error

Response Code: 404 Not found
1

Assign subscriber to a group

If you want to assign an existing subscriber to a group, send this POST request

POST https://connect.mailerlite.com/api/subscribers/{subscriber_id}/groups/{group_id}
1

Request

ParameterTypeRequiredLimitations
subscriber_idintegeryesMust be an existing subscriber id
group_idintegeryesMust be an existing group id

Response

Response Code: 200 OK / 201 Created
1
{
  "data": {
    "id": "1",
    "name": "dummy group",
    "active_count": 0,
    "sent_count": 0,
    "opens_count": 0,
    "open_rate": {
      "float": 0,
      "string": "0%"
    },
    "clicks_count": 0,
    "click_rate": {
      "float": 0,
      "string": "0%"
    },
    "unsubscribed_count": 0,
    "unconfirmed_count": 0,
    "bounced_count": 0,
    "junk_count": 0,
    "created_at": "2022-05-25 14:22:44"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Error

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

Unassign subscriber from a group

If you want to unassign an existing subscriber from a group, send this DELETE request

DELETE https://connect.mailerlite.com/api/subscribers/{subscriber_id}/groups/{group_id}
1

Request

ParameterTypeRequiredLimitations
subscriber_idintegeryesMust be an existing subscriber id
group_idintegeryesMust be an existing group id on the account

Response

Response Code: 204 No Content
1

Error

Response Code: 404 Not Found
1
{
  "message": ""
}
1
2
3
Last Updated: