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

Parameters: add_contacts_to_campaign
NameTypeDescription
campaign_id string required string Campaign id from list_campaigns
contact_ids array required array Contact ids from list_contacts

Request

cURL
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"]}'
Python
result = client.call("agile-crm", "add_contacts_to_campaign", {"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]})
Node.js
const result = await cotlet.call('agile-crm', 'add_contacts_to_campaign', {"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]});
CLI
cotlet call agile-crm add_contacts_to_campaign --data '{"campaign_id":"5731834621411328","contact_ids":["5698320417841152","5701182246576128","5709775523012608"]}'

Example response

JSON

{
  "campaign_id": "5731834621411328",
  "campaign": "Onboarding series",
  "added": 3,
  "contact_ids": [
    "5698320417841152",
    "5701182246576128",
    "5709775523012608"
  ]
}

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.