Clear all members from a group
POST /audiences/{audienceUuid}/groups/{uuid}/actions/clear
/audiences/{audienceUuid}/groups/{uuid}/actions/clearStarts a background job that removes every member from the group. The group itself and the members stay. It runs in the background and returns an async task straight away, not the final result: read it with get_async_task using the task uuid and repeat until status is completed or failed.
When to use: To empty a group before refilling it, or when the group is no longer needed but should stay defined.
When not to use: To delete the group, use delete_audience_group. To remove only some members, use async_task_group_remove_from_conditions, async_task_group_remove_from_segment or member_remove_from_group.
Side effects: Starts an async task. Every member is taken out of the group: Members stay in the audience; only their link to the group is removed. For each member removed it records an entry in the member's activity and the group's member count is refreshed. It does not fire the member_removed_from_group webhook or the automations triggered by leaving a group. When it finishes, result_meta.removed holds the number of members taken out.
Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the audience the group belongs to. Get it from list_audiences.
UUID of the group. Get it from list_audience_groups.
Response Body
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/groups/419eb38e-62fd-454e-98a7-c8dd5e9752dd/actions/clear" \ -H "X-Auth-Token: YOUR_API_KEY"{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "type": "string", "status": "pending", "total": 0, "processed": 0, "errored": 0, "progress": 0.1, "error_message": "string", "result_meta": {}, "result_file": "string", "result_file_url": "http://example.com", "started_at": "string", "finished_at": "string", "created_at": "string"}