Draft Email Campaign
draft_email_campaignSave an email campaign for the business to review: a subject, a plain-text body, the customers to email (lead_ids, each with recorded email permission) and who it comes from: a verified sending domain (sender_id) or one of the business's own connected email accounts (email_account_id, listed under emailAccounts by get_email_campaign; sends at most 100 a day and 20 an hour, spaced out). Each customer gets their own email, addressed to them alone. Returns the campaign id and the fingerprint of this exact revision. Sends nothing; an owner or admin approves it with approve_email_campaign and it only goes out after launch_email_campaign. subject and text may use {{ first_name }}, {{ last_order_date }} and {{ last_order_items }} (filled per customer from the connected booking system; order_window picks which booking) or any key in lead_variables. Needs an admin of the business. Campaign email only goes from the business’s own verified sending domain or its own connected email account, to customers with recorded email permission who are not on the do-not-email list, within the daily amount allowed (the Kai level for a sending domain; 100 a day and 20 an hour for a connected account).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"business_id": "<business_id>",
"subject": "<subject>",
"text": "<text>",
"lead_ids": "<lead_ids>"
},
"name": "draft_email_campaign"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The plain-text email body. | |
| design | No | Optional structured email design. text must equal its rendered text version; no raw HTML. The owner approves the exact HTML and text. | |
| subject | Yes | The email subject. | |
| lead_ids | Yes | The customers (lead ids) to email; each needs recorded email permission. | |
| sender_id | No | The verified sending domain to send from. Pass this or email_account_id. | |
| business_id | Yes | The business that sends the email. | |
| daily_limit | No | Optional: most emails sent per day (default: the most the sender and the Kai level allow). | |
| order_window | No | Optional: which booking fills {{ last_order_date }} and {{ last_order_items }}. A holiday week ({"holiday": "thanksgiving", "year": 2025}; year defaults to last year) or dates ({"start": "2025-11-24", "end": "2025-11-30"}). Without it, each customer's most recent past booking is used. | |
| lead_variables | No | Optional per-customer values for placeholders in subject/text, keyed by lead id: {"<lead_id>": {"last_order_date": "Nov 22, 2025"}}. {{ first_name }} is filled from the contact name unless given here; {{ key | default: "there" }} sets a fallback. Each customer gets their own email. | |
| email_account_id | No | One of the business's own connected email accounts to send from (its id from get_email_campaign emailAccounts). Pass this or sender_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| code | No | ||
| error | No | Present when success is false | |
| action | No | ||
| status | No | ||
| success | Yes | Whether the tool completed successfully | |
| senderId | No | ||
| fingerprint | No |