New APIs

Created by Mohammed Hasan, Modified on Thu, 16 Feb, 2023 at 11:30 AM by Mohammed Hasan

New APIs


The New APIs table lists the APIs available for the new management of groups. These APIs will be fully operational starting on October 27, 2020.


API DescriptionAPI VerbAPI URL
Get all groupsGET/audiences/v1/audience
Create a new groupPOST/audiences/v1/audiences
Delete a group based on its IDDELETE/audiences/v1/audience/{uuid}
Get a specific groupGET/audiences/v1/audience/{uuid}
Update a groupPUT/audiences/v1/audience/{uuid}
Get users from a groupGET/audiences/v1/audience/{uuid}/users
Remove users from a groupDELETE/audiences/v1/audience/{uuid}/users
Add users to a specific groupPOST/audiences/v1/audience/{uuid}/users
Export CSV containing all users in a groupGET/audiences/v1/audience/{uuid}/export-users
Retrieve the history of automatic groupsGET/audiences/v1/audience/{uuid}/conditions-history
Get an old group ID from a new group IDGET/audiences/v1/audience/{uuid}/audience_to_group
Get a new group ID from an old group IDGET/audiences/v1/audience/{id}/group_to_audience

For each new API, the list of parameters is detailed in the following sections.

Get all groups

GET /audiences/v1/audience @parameter sort_attr [string, optional] : Order the groups based on the property. Possible values: “name”, “description”, “slug” @parameter sort_dir [string, optional] : Sort direction. Possible values: “asc”, “desc” @parameter page [number, optional]  : Page to return. Default: 1 @parameter page_size  [number, optional] : Items to return. @parameter search_text [string, optional] : Search groups by a key on name and description

Get a specific group

GET /audiences/v1/audience/{uuid} @get uuid [string, required] : The id of the resource to be retrieved

Create a group

POST  /audiences/v1/audiences @parameter name [string, required] : The name of the group @parameter description [string, optional] : The description of the group @parameter type [string, required] : The type of the group. Possible values: “manual”, ”automatic” @parameter ruleset [object, optional] : The ruleset definition (required for automatic groups) @item operator [string, required] : The operator for the ruleset. Possible values: “AND”, ”OR” @item sets [array, required] : The sets of rules @item rules [array, required] : The rules of the set @item type [string, required] : The type of rule @item payload [object, required] : The payload of the rule @end @end @end

Update a group

PUT /audiences/v1/audience/{uuid} @parameter name [string, optional] : The name of the group @parameter description [string, optional] : The description of the group @parameter ruleset [object, optional] : The ruleset definition (required for automatic groups) @item operator [string, required] : The operator for the ruleset. Possible values: “AND”, ”OR” @item sets [array, required] : The sets of rules @item id [string, optional] : The identifier of the set @item rules [array, required] : The rules of the set @item id [string, optional] : The identifier of the rule @item type [string, required] : The type of rule @item payload [object, required] : The payload of the rule @end @end @end

Delete users from a specific group

DELETE  /audiences/v1/audience/{uuid}/users @parameter user_ids [array(integer), required] Users to remove from the group @parameter user_all [bool, optional] Remove all users from the group @parameter user_filters [array(string), optional] Remove the users that meet the passed criteria ( "search" = "test" ) from the group

Delete a group

DELETE  /audiences/v1/audience/{uuid} @get uuid [string, required] : The id of the resource to be deleted

Get users from a group

GET /audiences/v1/audience/{uuid}/users @get uuid [string, required] : The id of the group resource @parameter sort_attr [string, optional] : Sort by this field. Possible values: “idst”, “userid”, “firstname”, “lastname”, “email”. Default value: “idst” @parameter page [number, optional]  : Page to return. Default: 1 @parameter page_size  [number, optional] : Items to return. @parameter search_text [string, optional] : Search users on first name, last name, email and username

Add user to a specific group

PUT /audiences/v1/audience/{uuid}/users @parameter user_ids [array(integer), optional] : The users to add to the group (At least one of groups, branches or users must be defined) @parameter branch_ids [array(integer), optional] : The branches to add to the group (At least one of groups, branches or users must be defined) @parameter group_ids [array(integer), optional] : Copy current users in another group to this group (At least one of groups, branches or users must be defined)

Export users belonging to a specific group

GET /audiences/v1/audience/{uuid}/export-users @parameter userid [boolean, optional] : If user ID must be included in export - Default: false @parameter firstname [boolean, optional] : If user first name must be included in export - Default: false @parameter lastname [boolean, optional] : If user last name must be included in export - Default: false @parameter email [boolean, optional] : If user email must be included in export - Default: false @parameter include_header [boolean, optional] : Include or NOT naming of columns in csv file - Default: false @parameter delimiter [string, optional] : Delimiter for exported csv file - Default: ","

Get the conditions history of a specific group

GET /audiences/v1/audience/{uuid}/conditions-history @get uuid [string, required] : The id of the resource to be retrieved

Get a group id from an audience id

GET /audiences/v1/audience/{uuid}/audience_to_group @get id [string, required] The ID of the new group resource from which retrieve the old group ID

Get an audience id from the group id

GET /audiences/v1/audience/{id}/group_to_audience @get id [integer, required] The ID of the old group resource from which retrieve the new group ID

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article