Add contacts to a list
Add up to 500 contacts, or a whole segment, to a list.
POST https://cotlet.dev/api/v1/constant-contact/lists/{list_id}/contacts-to-lists
write Confirm
Adds contacts to a list in one call. Give contact_ids (up to 500) or segment_id, not both. The contacts then receive any email scheduled to that list, and a large add can move your account into a higher contact tier. 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 or create_list. |
| contact_ids array | array | Up to 500 contact IDs. Use this or segment_id. |
| segment_id integer | integer | Add every contact of this segment. Use this or contact_ids. |
Request
curl -X POST https://cotlet.dev/api/v1/constant-contact/lists/9d2e4b7a-1c3f-4a58-b6e0-7f8a2c5d1e90/contacts-to-lists \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_ids":["c1a2b3d4-0001-4e5f-8a9b-1c2d3e4f5a01","c1a2b3d4-0002-4e5f-8a9b-1c2d3e4f5a02","c1a2b3d4-0003-4e5f-8a9b-1c2d3e4f5a03"]}' result = client.call("constant-contact", "add_contacts_to_list", {"list_id":"9d2e4b7a-1c3f-4a58-b6e0-7f8a2c5d1e90","contact_ids":["c1a2b3d4-0001-4e5f-8a9b-1c2d3e4f5a01","c1a2b3d4-0002-4e5f-8a9b-1c2d3e4f5a02","c1a2b3d4-0003-4e5f-8a9b-1c2d3e4f5a03"]}) const result = await cotlet.call('constant-contact', 'add_contacts_to_list', {"list_id":"9d2e4b7a-1c3f-4a58-b6e0-7f8a2c5d1e90","contact_ids":["c1a2b3d4-0001-4e5f-8a9b-1c2d3e4f5a01","c1a2b3d4-0002-4e5f-8a9b-1c2d3e4f5a02","c1a2b3d4-0003-4e5f-8a9b-1c2d3e4f5a03"]}); cotlet call constant-contact add_contacts_to_list --data '{"list_id":"9d2e4b7a-1c3f-4a58-b6e0-7f8a2c5d1e90","contact_ids":["c1a2b3d4-0001-4e5f-8a9b-1c2d3e4f5a01","c1a2b3d4-0002-4e5f-8a9b-1c2d3e4f5a02","c1a2b3d4-0003-4e5f-8a9b-1c2d3e4f5a03"]}' Example response
{
"list_id": "9d2e4b7a-1c3f-4a58-b6e0-7f8a2c5d1e90",
"requested": 3,
"added": 3
}