Draft a campaign
draft_campaignSave a DRAFT email or SMS campaign to a segment or a contact filter. This NEVER sends and never schedules: the site owner reviews the draft and sends it themselves from Inbox → Broadcasts. Choose channel explicitly; email uses subject and HTML, SMS uses body_text. Audience: segment_id, OR filter facets, OR target_all_contacts: true to deliberately reach everyone. A draft nobody could receive after consent checks is refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Internal name, shown in the broadcasts list | |
| tags | No | Tags the contact must carry — ALL of them. Values exactly as list_contact_filter_vocabulary returns them, capitals and spaces included | |
| fields | No | Custom field filters: field_key → exact value, e.g. {"budget":"high"}. Keys from list_contact_filter_vocabulary; a select field's value must be one of its options | |
| search | No | Free text matched against email, first name, last name and company | |
| status | No | Pipeline status the contact must have | |
| channel | No | Delivery channel | |
| purpose | No | Owner-declared message purpose | marketing |
| site_id | Yes | The site, from list_sites | |
| subject | No | Email subject; omit for SMS | |
| reply_to | No | Reply-to address; defaults to the site's notification address | |
| body_html | No | The email body as HTML, written by you | |
| body_text | No | Plain-text alternative | |
| from_name | No | Sender display name; defaults to the site's sender | |
| preheader | No | Preview text shown after the subject in most inboxes | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| segment_id | No | Target this segment; cannot be combined with facets | |
| appointment | No | Appointment state: upcoming (booked, still to come), pending (upcoming, waiting for the owner to confirm), needs_time (asked for an appointment, waiting for the owner to pick a time), had (has had one before) | |
| field_rules | No | Typed custom-field rules, all must match. op "in"/"not_in" take values (e.g. countries ["BR","IN"]); "gt"/"lt" take a numeric value (numeric fields only); "before"/"on_or_after" take value "YYYY-MM-DD"; "is_set"/"is_not_set" take nothing. Prefer this over `fields` for anything but one exact value | |
| acquisition_source | No | Lead source, exactly as list_contact_filter_vocabulary returns it | |
| target_all_contacts | No | true to deliberately target every contact; required when no segment_id and no facets are given | |
| acquisition_campaign | No | Acquisition campaign, exactly as list_contact_filter_vocabulary returns it |