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

Parameters: remove_opted_out_contacts
NameTypeDescription
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
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"
Python
result = client.call("clicksend", "remove_opted_out_contacts", {"list_id":128734,"opt_out_list":"Opt-Out List"})
Node.js
const result = await cotlet.call('clicksend', 'remove_opted_out_contacts', {"list_id":128734,"opt_out_list":"Opt-Out List"});
CLI
cotlet call clicksend remove_opted_out_contacts --data '{"list_id":128734,"opt_out_list":"Opt-Out List"}'

Example response

JSON

{
  "list_id": 128734,
  "list": "Newsletter subscribers",
  "opt_out_list": "Opt-Out List",
  "removed": 37
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.