Easymailing
Audience segments

Unsubscribe segment members

POST /audiences/{audienceUuid}/list_segments/{uuid}/actions/unsubscribe

POST/audiences/{audienceUuid}/list_segments/{uuid}/actions/unsubscribe

Starts a background job that unsubscribes the email and the SMS channel of the members of the segment that are confirmed. 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. It is NOT the bulk version of member_unsubscribe: it writes the new status directly.

When to use: To stop sending to a whole slice of an audience at once, for example inactive contacts.

When not to use: It only accepts old audience segments (list_audience_segments), never contact segments. For a single member, use member_unsubscribe, which also fires the unsubscription webhook and cancels the member's automations. To delete the people instead of unsubscribing them, use async_task_segment_delete_contacts.

Side effects: Starts an async task. The affected members change to suscriber.status.unsuscribed.admin (email) and their SMS status to the same value, they stop receiving campaigns, and the unsubscription is recorded in the activity of each email-unsubscribed member. Unlike member_unsubscribe it does NOT fire the member_unsubscribed / member_sms_unsubscribed webhooks and does NOT cancel the automations the members are in. The audience statistics are refreshed afterwards. result_meta.unsubscribed counts only the members whose email status was confirmed. Channels that are not confirmed are left as they are. If no member of the segment has a confirmed email, the job ends without changing anyone, even if some have a confirmed SMS.

Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

audienceUuid*string

UUID of the audience the segment belongs to. Get it from list_audiences.

uuid*string

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/unsubscribe" \  -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"}