Create a campaign draft
Creates a single campaign in Drafts with subject, sender, recipients and HTML.
POST https://cotlet.dev/api/v1/campaign-monitor/campaign-drafts
write
Walks the campaign checklist: Add subject, Add sender, Select recipients and Design. Returns the campaign ID and which checklist items are still open. It needs the create campaigns permission. A draft reaches no one and is deleted in Drafts, so it does not wait for your OK.
Parameters
| Name | Type | Description |
|---|---|---|
| name string required | string | Campaign name. |
| subject string | string | Subject line. |
| preview_text string | string | Preview text next to the subject. |
| from_name string | string | Sender name. |
| from_email string | string | Sender email. |
| reply_to string | string | Optional reply-to address. |
| list_ids array | array | List IDs from list_lists to send to. |
| segment_ids array | array | Segment IDs from list_segments to send to. |
| html string | string | Email HTML, added through Import HTML. Leave out to design it in the app. |
Request
curl -X POST https://cotlet.dev/api/v1/campaign-monitor/campaign-drafts \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"November newsletter","subject":"What is new in November","from_name":"Harbor Coffee","from_email":"hello@harborcoffee.example","list_ids":["f2a9b7c1d3e44f08a6b5c4d3e2f10987"],"html":"<html><body><h1>November at Harbor Coffee</h1><p>New seasonal menu, from 3 November.</p><p><unsubscribe>Unsubscribe</unsubscribe></p></body></html>"}' result = client.call("campaign-monitor", "create_campaign_draft", {"name":"November newsletter","subject":"What is new in November","from_name":"Harbor Coffee","from_email":"hello@harborcoffee.example","list_ids":["f2a9b7c1d3e44f08a6b5c4d3e2f10987"],"html":"<html><body><h1>November at Harbor Coffee</h1><p>New seasonal menu, from 3 November.</p><p><unsubscribe>Unsubscribe</unsubscribe></p></body></html>"}) const result = await cotlet.call('campaign-monitor', 'create_campaign_draft', {"name":"November newsletter","subject":"What is new in November","from_name":"Harbor Coffee","from_email":"hello@harborcoffee.example","list_ids":["f2a9b7c1d3e44f08a6b5c4d3e2f10987"],"html":"<html><body><h1>November at Harbor Coffee</h1><p>New seasonal menu, from 3 November.</p><p><unsubscribe>Unsubscribe</unsubscribe></p></body></html>"}); cotlet call campaign-monitor create_campaign_draft --data '{"name":"November newsletter","subject":"What is new in November","from_name":"Harbor Coffee","from_email":"hello@harborcoffee.example","list_ids":["f2a9b7c1d3e44f08a6b5c4d3e2f10987"],"html":"<html><body><h1>November at Harbor Coffee</h1><p>New seasonal menu, from 3 November.</p><p><unsubscribe>Unsubscribe</unsubscribe></p></body></html>"}' Example response
{
"campaign_id": "d5b8e1a4c7f94026a3d6b9e2c5f80173",
"name": "November newsletter",
"status": "draft",
"checklist": {
"subject": "done",
"sender": "done",
"recipients": "done",
"design": "done"
}
}