With these endpoints, you can manage all aspects of the groups in your account.
View the official documentation here.
- group.list([params], callback)
- group.create([params], callback)
- group.withID(id).details(callback)
- group.withID(id).delete(callback)
- group.withID(id).members([params], callback)
- group.withID(id).addMembers([params], callback)
- group.withID(id).removeMembers([params], callback)
- group.withID(id).emptySync([params], callback)
- group.withID(id).empty(details, callback)
- group.withID(id).copyAllMembersTo(groupID, callback)
- group.withID(id).addMembersByStatus(details, callback)
- group.withID(id).update([params], callback)
Get a basic listing of all active member groups for a single account.
params
<Object> Can have the following fields:group_types
<String> Accepts a comma-separated string with one or more of the following group types: 'g' (group), 't' (test), 'h' (hidden), 'all' (all). Defaults to 'g'.
- returns: An array of groups.
Create one or more new member groups.
params
<Object> Can have the following fields:groups
<Array> An array of group objects. Each object must contain a group_name parameter.
- returns: An array of the new group ids and group names.
Get the detailed information for a single member group.
- returns: A group.
- raises: Http404 if the group does not exist.
Delete a single member group.
- returns:
True
if the group is deleted. - raises: Http404 if the group does not exist.
Get the members in a single active member group.
params
<Object> Can have the following fields:deleted
<Boolean> Optional. Include deleted members. Defaults toFalse
.
- returns: An array of members.
- raises: Http404 if the group does not exist.
params
<Object> Can have the following fields:member_ids
<Array> An array of member ids.
- returns: An array of references to the members added to the group. If a member already exists in the group or is not a valid member, that reference will not be returned.
- raises: Http404 if the group does not exist.
Remove members from a single active member group.
params
<Object> Can have the following fields:member_ids
<Array> An array of member ids.
- returns: An array of references to the removed members.
- raises: Http404 if the group does not exist.
Remove members from a single active member group.
params
<Object> Can have the following fields:member_status_id
<String> Optional. This is ‘a’ (active), ‘o’ (optout), or ‘e’ (error).
- returns: An array of references to the removed members.
- raises: Http404 if the group does not exist.
Delete all members in this group with the specified status. Remove those members from all groups as a background job. The member_status_id parameter must be set.
params
<Object> Can have the following fields:member_status_id
<String> This is ‘a’ (active), ‘o’ (optout), or ‘e’ (error).
- returns: An array of references to the removed members.
- raises: Http404 if the group does not exist.
Copy all the users of one group into another group.
params
<Object> Can have the following fields:member_status_id
<Array> This is ‘a’ (active), ‘o’ (optout), or ‘e’ (error).
- returns:
True
- raises: Http404 if the group does not exist.
Copy all account members of one or more statuses into a group.
params
<Object> Can have the following fields:- returns:
True
if the update was successful. - raises: Http404 if the group does not exist.
Update information for a single member group.