Remove opted-out contacts
Remove everyone on the Opt-Out List from one contact list.
DELETE https://cotlet.dev/api/v1/clicksend/lists/{list_id}/opted-out-contacts
write Confirm
Runs Clean Up > Remove Opted-out on one list against the list that holds your opt-outs, by default the Opt-Out List. ClickSend cleans one list at a time, so call it once per list. removed is how many contacts the list lost. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| list_id integer required | integer | Contact list ID from list_contact_lists. |
| opt_out_list string | string | Name of the list that holds the opt-outs. Default: Opt-Out List. |
Request
curl -X DELETE "https://cotlet.dev/api/v1/clicksend/lists/128734/opted-out-contacts?opt_out_list=Opt-Out+List" \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("clicksend", "remove_opted_out_contacts", {"list_id":128734,"opt_out_list":"Opt-Out List"}) const result = await cotlet.call('clicksend', 'remove_opted_out_contacts', {"list_id":128734,"opt_out_list":"Opt-Out List"}); cotlet call clicksend remove_opted_out_contacts --data '{"list_id":128734,"opt_out_list":"Opt-Out List"}' Example response
{
"list_id": 128734,
"list": "Newsletter subscribers",
"opt_out_list": "Opt-Out List",
"removed": 37
}