Add contacts
Add contacts to a list with name, phone number and email.
POST https://cotlet.dev/api/v1/clicksend/lists/{list_id}/contacts
write Confirm
Adds the contacts to one list as Add on the list page does. Each contact needs a phone number with the country code. A campaign scheduled for this list also goes to contacts added before it sends, so the call waits for your OK. It does not check the Opt-Out List: run remove_opted_out_contacts after. 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. |
| contacts array required | array | Objects with phone_number (required), first_name, last_name and email. |
Request
curl -X POST https://cotlet.dev/api/v1/clicksend/lists/1/contacts \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contacts":"contacts"}' result = client.call("clicksend", "add_contacts", {"list_id":1,"contacts":"contacts"}) const result = await cotlet.call('clicksend', 'add_contacts', {"list_id":1,"contacts":"contacts"}); cotlet call clicksend add_contacts --data '{"list_id":1,"contacts":"contacts"}' Example response
{
"list_id": 128741,
"list": "Webinar leads",
"added": 2
}