Create a campaign
POST /campaigns
Create a draft campaign. The campaign is not sent until you call /launch.
Body parameters
Section titled “Body parameters”| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Internal name. |
description | string | no | |
list_id | uuid | yes | Target contact list. |
domain_id | uuid | yes | Sending domain — must be verified. |
subject_template | string | yes | Supports {{first_name}}, {{custom_fields.state}}, etc. |
preheader_template | string | no | Hidden preheader text. |
html_template | string | yes | HTML body. |
text_template | string | no | Plain text body. |
from_address | string | yes | Must be on domain_id. |
reply_to | string | no | |
daily_cap | int | no | Default 500. |
per_minute_cap | int | no | Default 120. |
send_window_start_hour | int | no | 0–23. Default 10. |
send_window_end_hour | int | no | 0–23. Default 18. |
scheduled_start_at | ISO 8601 | no | Delay launch. |
Example
Section titled “Example”curl -X POST https://mail.3ava.com/api/campaigns \ -H "Authorization: Bearer am_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "April newsletter", "list_id": "list_a1b2...", "domain_id": "dom_c3d4...", "subject_template": "{{first_name}}, your April update", "html_template": "<p>Hi {{first_name}},</p>...", "from_address": "[email protected]", "daily_cap": 5000, "per_minute_cap": 100 }'Response
Section titled “Response”{ "id": "camp_a1b2...", "name": "April newsletter", "status": "draft", "total_recipients": 0, "sent_count": 0, "created_at": "2026-04-22T22:30:00Z"}total_recipients is 0 until you launch. At launch, it’s set to the count of valid recipients on the list at that moment.