Use the API to obtain a list of the mailing groups on your account. You can use the offset and limit parameters for pagination.
| Parameter | Details | Description |
|---|---|---|
| offset | query int optional | Offset for pagination. |
| limit | query int optional | Limit for pagination. |
curl -X GET "https://api-eu1.stannp.com/v1/groups/list?offset=0&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": [
{
"id": "398",
"account_id": "1",
"name": "Test Group",
"created": "2015-09-25 11:57:35",
"recipients": "100",
"valid": "98",
"international": "0",
"skipped": "0",
"status": "ready",
"import_progress": "0",
"is_seeds": "0"
},
{
"id": "390",
"account_id": "1",
"name": "My Data",
"created": "2015-09-23 10:50:48",
"recipients": "6000",
"valid": "5872",
"international": "0",
"skipped": "0",
"status": "ready",
"import_progress": "0",
"is_seeds": "0"
}
]
}Use the API to create a new empty mailing list.
| Parameter | Details | Description |
|---|---|---|
| name | body str required | Name of the new group to be created. |
curl -X POST "https://api-eu1.stannp.com/v1/groups/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "My Group"}'
{
"success": true,
"data": "39"
}Use the API to add recipients from your account to an existing mailing list.
| Parameter | Details | Description |
|---|---|---|
| recipients | body str required | Comma-separated recipient IDs. |
curl -X POST "https://api-eu1.stannp.com/v1/groups/add/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipients": "45112,45113"}'
{
"success": true,
"data": 2
}Remove recipients from the group. Note that this only removes the recipient from the group and does not completely delete the recipient.
| Parameter | Details | Description |
|---|---|---|
| recipients | body str required | Comma-separated recipient IDs. |
curl -X DELETE "https://api-eu1.stannp.com/v1/groups/remove/123" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipients": "45112,45113"}'
{
"success": true,
"data": 2
}Use the API to remove all recipients from the mailing list. The recipients will remain on your account if delete_recipients is set to false.
| Parameter | Details | Description |
|---|---|---|
| id | body int required | ID of the group to purge. |
| delete_recipients | body bool optional | True or false. Delete all recipients in this group if true. Defaults to false. WARNING: If true this will completely delete the recipients so they will not exist in any other groups if the recipient was in multiple groups. |
curl -X POST "https://api-eu1.stannp.com/v1/groups/purge" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 123}'
{
"success": true,
"data": true
}Will recalculate a group to make sure stats are up to date.
curl -X POST "https://api-eu1.stannp.com/v1/groups/calculate/123" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"data": true
}Use the API to delete a mailing list. The recipients will remain on your account if delete_recipients is set to false.
| Parameter | Details | Description |
|---|---|---|
| id | body int required | ID of the group to delete. |
| delete_recipients | body bool optional | True or false. Defaults to false. WARNING: If true this will completely delete the recipients so they will not exist in any other groups if the recipient was in multiple groups. |
curl -X DELETE "https://api-eu1.stannp.com/v1/groups/delete" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 123}'
{
"success": true,
"data": true
}