Set campaign recipients

Choose the contact list and optional segment a draft campaign goes to.

PUT https://cotlet.dev/api/v1/mailjet/lists/{list_id}/campaigns/{campaign_id}/recipients

write

Does what the Contact list field and "Only send to a segment" do on the Create a new campaign page. A campaign goes to one list, and a segment narrows that list. Nothing is sent. The change reaches no one and is undone by calling the tool again, so it does not wait for your OK.

Parameters

Parameters: set_campaign_recipients
NameTypeDescription
campaign_id integer required integer Campaign ID from list_campaigns.
list_id integer required integer Contact list ID from list_contact_lists.
segment string string Name of a segment from list_segments. Default: the whole list.

Request

cURL
curl -X PUT https://cotlet.dev/api/v1/mailjet/lists/1/campaigns/1/recipients \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("mailjet", "set_campaign_recipients", {"campaign_id":1,"list_id":1})
Node.js
const result = await cotlet.call('mailjet', 'set_campaign_recipients', {"campaign_id":1,"list_id":1});
CLI
cotlet call mailjet set_campaign_recipients --data '{"campaign_id":1,"list_id":1}'

Example response

JSON

{
  "campaign_id": 7182934615,
  "list": "Newsletter",
  "segment": "Did not open: Autumn offer",
  "status": "draft"
}

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.