Add segment members to a group
POST /audiences/{audienceUuid}/list_segments/{uuid}/actions/add_to_group
/audiences/{audienceUuid}/list_segments/{uuid}/actions/add_to_groupStarts a background job that adds to a group every member who currently matches the segment. Members already in the group are skipped. 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 turn the people a segment selects into a fixed group, for example to keep a snapshot or to start an automation that triggers when someone joins the group.
When not to use: It only accepts old audience segments (list_audience_segments), never contact segments. For one member, use member_add_from_group. For a rule you do not want to save as a segment, use async_task_group_add_from_conditions. To remove them instead, use async_task_segment_remove_from_group.
Side effects: Starts an async task. For each member added, an entry is recorded in the member's activity and the automations triggered by joining a group fire; the group's member count is refreshed. It does not fire the member_added_to_group webhook. result_meta.added holds the number of members added.
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 segment belongs to. Get it from list_audiences.
UUID of the segment. Get it from list_audience_segments.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/list_segments/b2d1c9a4-6e7f-4a35-8d10-5c9e3f7a1b62/actions/add_to_group" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "group_uuid": "0f0cbec3-10f0-4b21-b1da-6d6437d7f648" }'{ "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"}