Delete segment members
POST /audiences/{audienceUuid}/list_segments/{uuid}/actions/delete_contacts
/audiences/{audienceUuid}/list_segments/{uuid}/actions/delete_contactsStarts a background job that permanently deletes from the audience every member who matches the segment, with the ecommerce customer records linked to them. Each person stays as a contact in the account and in their other audiences. 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: Only when the user explicitly wants to clean the audience of everyone a segment selects.
When not to use: It only accepts old audience segments (list_audience_segments), never contact segments. To keep the people but stop emailing them, use async_task_segment_unsubscribe. To delete a single member, use delete_audience_member.
Side effects: Starts an async task that cannot be undone through the API. No webhook fires and no automation is notified; the audience statistics are refreshed afterwards. result_meta.deleted holds the number of members the segment matched when the job started.
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.
Response Body
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/delete_contacts" \ -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"}