Email Marketing
Campaigns
Creating a campaign saves a draft. Sending is a separate call, so a create request cannot mail the list by accident.
Create a draft
POST
/api/v1/email/campaignscampaigns:write| name | Required campaign name. |
|---|---|
| subject | Required subject line. |
| audienceId | Required audience to send to. |
| templateVersionId | Pins the content. Or pass templateId and we use the latest version. |
| fromName | Required sender name. |
| fromEmail | Required. Must already be an address on a verified sending domain. |
| previewText | Optional. |
| replyTo | Optional reply-to address. |
curl
curl -sS https://api.thealtermeai.com/api/v1/email/campaigns \
-H "Authorization: Bearer emk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "October launch",
"subject": "It is ready",
"audienceId": "YOUR_AUDIENCE_ID",
"templateId": "YOUR_TEMPLATE_ID",
"fromName": "Ada",
"fromEmail": "[email protected]"
}'Create returns 201 and does not send. The template version must already have compiled HTML — create one with the Templates API or in the app. Use sender identities to pick a verified fromEmail. An unverified from address returns 409 with code NOT_SENDABLE.
List and update
GET
/api/v1/email/campaignscampaigns:readNewest first. Filter with status. limit defaults to 25 and caps at 200.
GET
/api/v1/email/campaigns/{campaignId}campaigns:readPATCH
/api/v1/email/campaigns/{campaignId}campaigns:writeSend
POST
/api/v1/email/campaigns/{campaignId}/sendcampaigns:writecurl
curl -sS -X POST https://api.thealtermeai.com/api/v1/email/campaigns/CAMPAIGN_ID/send \
-H "Authorization: Bearer emk_YOUR_KEY"An accepted send returns 202. Work Funds are debited per recipient, at the same rates as the app. Insufficient funds return 402. The from address has to sit on a verified sending domain.