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
| Name | Type | Description |
|---|---|---|
| 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 -X PUT https://cotlet.dev/api/v1/mailjet/lists/1/campaigns/1/recipients \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("mailjet", "set_campaign_recipients", {"campaign_id":1,"list_id":1}) const result = await cotlet.call('mailjet', 'set_campaign_recipients', {"campaign_id":1,"list_id":1}); cotlet call mailjet set_campaign_recipients --data '{"campaign_id":1,"list_id":1}' Example response
{
"campaign_id": 7182934615,
"list": "Newsletter",
"segment": "Did not open: Autumn offer",
"status": "draft"
}