List groups


https://dash.stannp.com/api/v1/groups/list

You can use the offset and limit parameters for pagination as seen in the example request.

Request
$ curl https://dash.stannp.com/api/v1/groups/list?api_key={API_KEY}&offset=0&limit=100
Toggle Response
{
   "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"
    }
   ]
}

Create a new group


https://dash.stannp.com/api/v1/groups/new

Parameters

name string [required] Name of the new group to be created.
Request
$ curl https://dash.stannp.com/api/v1/groups/new?api_key={API_KEY} \
-d "name=My Group"
Response
{
    "success":true,
    "data":"39"
}

Add recipients to a group


https://dash.stannp.com/api/v1/groups/add/:group_id

Parameters

recipients string [required] Comma separated recipient id's.
Request
$ curl https://dash.stannp.com/api/v1/groups/add/1234?api_key={API_KEY} \
-d "recipients=45112,45113"
Response
{
    "success":true,
    "data":true
}

Remove recipients from a group

Note this only removes the recipient from the group and will not completely delete the recipient. You must use the recipients endpoint to delete the record completely.
https://dash.stannp.com/api/v1/groups/remove/:group_id

Parameters

recipients string [required] Comma separated recipient id's.
Request
$ curl https://dash.stannp.com/api/v1/groups/remove/1234?api_key={API_KEY} \
-d "recipients=45112,45113"
Response
{
    "success":true,
    "data":true
}

Purge a group


https://dash.stannp.com/api/v1/groups/purge

Parameters

id int [required] The id of the group to delete
delete_recipients bool [optional] True or false. Delete all recipients in this group if true.

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.

Defaults to false. Which will not delete recipients.
Request
$ curl https://dash.stannp.com/api/v1/groups/purge?api_key={API_KEY} \
-d "id=123"
Response
{
   "success": true,
   "data": true
}

Delete a group


https://dash.stannp.com/api/v1/groups/delete

Parameters

id int [required] The id of the group to delete
delete_recipients bool [optional] True or false. Delete all recipients in this group if true.

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.

Defaults to false. Which will not delete recipients.
Request
$ curl https://dash.stannp.com/api/v1/groups/delete?api_key={API_KEY} \
-d "id=123"
Response
{
   "success":true,
   "data":{}
}