Unsubscribe contacts
Mark contacts as unsubscribed in bulk, by segment, tag or email addresses.
POST https://cotlet.dev/api/v1/emailoctopus/lists/{list_id}/contacts/unsubscribe
Does what Actions, then Mark as unsubscribed, does on the contacts page. Give exactly one of segment, tag or emails. Unsubscribed contacts stay in the list and stop counting towards your plan's subscriber limit; the tool never deletes a contact. An unsubscribed contact cannot be re-subscribed through an import. It returns how many contacts changed. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| list_id string required | string | List ID from list_lists. |
| segment string | string | Segment name from list_segments. |
| tag string | string | Unsubscribe the contacts with this tag. |
| emails array | array | Email addresses to unsubscribe. |
Request
curl -X POST https://cotlet.dev/api/v1/emailoctopus/lists/4d1c8e5a-7f2b-4c1e-9a63-0b5d2e8f1a37/contacts/unsubscribe \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"segment":"Inactive for 90 days"}' result = client.call("emailoctopus", "unsubscribe_contacts", {"list_id":"4d1c8e5a-7f2b-4c1e-9a63-0b5d2e8f1a37","segment":"Inactive for 90 days"}) const result = await cotlet.call('emailoctopus', 'unsubscribe_contacts', {"list_id":"4d1c8e5a-7f2b-4c1e-9a63-0b5d2e8f1a37","segment":"Inactive for 90 days"}); cotlet call emailoctopus unsubscribe_contacts --data '{"list_id":"4d1c8e5a-7f2b-4c1e-9a63-0b5d2e8f1a37","segment":"Inactive for 90 days"}' Example response
{
"list_id": "4d1c8e5a-7f2b-4c1e-9a63-0b5d2e8f1a37",
"segment": "Inactive for 90 days",
"unsubscribed": 212
}