Add contacts to campaign
Adds a list of contacts to a campaign, like Bulk Actions > Add to Campaign.
POST https://cotlet.dev/api/v1/agile-crm/campaigns/{campaign_id}/contacts-to-campaigns
write Confirm
Selects the contacts on the Contacts page and runs the Add to Campaign bulk action with your campaign. Agile CRM runs the campaign on those contacts at once, so its emails go out to real people. Returns how many contacts were added. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| campaign_id string required | string | Campaign id from list_campaigns |
| contact_ids array required | array | Contact ids from list_contacts |
Request
curl -X POST https://cotlet.dev/api/v1/agile-crm/campaigns/5731834621411328/contacts-to-campaigns \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contact_ids":["5698320417841152","5701182246576128","5709775523012608"]}' result = client.call("agile-crm", "add_contacts_to_campaign", {"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]}) const result = await cotlet.call('agile-crm', 'add_contacts_to_campaign', {"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]}); cotlet call agile-crm add_contacts_to_campaign --data '{"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]}' Example response
{
"campaign_id": "5731834621411328",
"campaign": "Onboarding series",
"added": 3,
"contact_ids": [
"5698320417841152",
"5701182246576128",
"5709775523012608"
]
}