create_campaign
Create a new email campaign in draft status, with support for segment targeting and A/B variate testing.
Instructions
Create a new email campaign in draft status, with optional segment targeting or A/B variate testing.
Typical workflow: create_campaign -> set_campaign_content (add HTML body) -> send_test_email (preview) -> send_campaign or schedule_campaign (deliver). The campaign is created in 'save' (draft) status and cannot be sent until content is set. Use replicate_campaign instead to clone an existing campaign.
For A/B testing, set campaign_type='variate' and pass variate_settings_json describing the test. Mailchimp will send variants to a sample of recipients, then auto-pick a winner based on winner_criteria and send it to the remaining audience after wait_time.
Authenticated via API key. Subject to Mailchimp API rate limits (max 10 concurrent requests). Respects read-only and dry-run modes.
Args: list_id: The audience/list ID to send to (e.g. 'abc123def4'). Obtain from list_audiences. subject_line: Subject line recipients see in their inbox. Keep under 150 chars. For variate campaigns testing subject lines, this is the default/fallback. title: Internal title for organizing in Mailchimp dashboard. Defaults to subject_line if omitted. preview_text: Preheader text shown after the subject line in inbox. Keep under 200 chars. from_name: Sender name on the email. Falls back to audience default if omitted. reply_to: Reply-to email address. Must be a verified domain. Falls back to audience default. segment_id: Saved segment ID to restrict recipients. Only members matching this segment receive the email. Obtain from list_segments. Omit to send to the full audience. campaign_type: 'regular' (default) for a standard campaign, or 'variate' for an A/B test. 'plaintext', 'rss', and 'absplit' (legacy A/B) are also accepted but rarely used. variate_settings_json: Required when campaign_type='variate'. JSON string with keys: winner_criteria ('opens' | 'clicks' | 'manual' | 'total_revenue'), test_size (10-100, percent of audience sampled), wait_time (minutes before picking winner), and one of subject_lines (list of 2-8 strings), from_names (list of 2-8), reply_to_addresses (list of 2-8), send_times (list of 2-8 ISO datetimes), or contents (list of 2-8 HTML strings). Example: '{"winner_criteria": "opens", "test_size": 20, "wait_time": 1440, "subject_lines": ["Spring Sale 20% off", "Last chance: 20% off Spring"]}'
Returns: JSON with fields: id (string, the new campaign ID for use with set_campaign_content, send_campaign, etc.), status ('save'), title, subject_line, web_id (int, for Mailchimp web UI link), type. Returns error if list_id is invalid, variate_settings_json is malformed, or variate settings violate Mailchimp constraints.
Example: create_campaign(list_id="abc123", subject_line="Spring Sale", preview_text="20% off") -> {"id": "def456", "status": "save", "type": "regular", ...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| subject_line | Yes | ||
| title | No | ||
| preview_text | No | ||
| from_name | No | ||
| reply_to | No | ||
| segment_id | No | ||
| campaign_type | No | regular | |
| variate_settings_json | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |