Create campaign
Create a new email campaign. Campaigns are created as DRAFT; use POST /campaigns/{id}/send to send or schedule one.
The sender domain must already be verified for this project.
Audience: audienceType decides which companion field is required — SEGMENT requires segmentId, FILTERED requires audienceCondition, and ALL requires neither.
ApiKeyAuthAuthorizationBearer <API Key>API Key authentication. The project is automatically derived from the key.
/v1/track requires a public key (pk_*) — it is the one endpoint intended for client-side use, and a secret key is rejected there with 401.
Every other endpoint requires a secret key (sk_*) and rejects public keys with 401.
So the two key types are not interchangeable in either direction: pick the key that matches the endpoint you are calling.
application/json- body
name*stringCampaign name
description?stringCampaign description
subject*stringEmail subject line
body*stringHTML email body
from*stringSender email address (must be from verified domain)
emailfromName?stringSender name
replyTo?stringReply-to email address
emailtype?stringContent type of the campaign email. Defaults to MARKETING.
"MARKETING""TRANSACTIONAL""MARKETING""HEADLESS"audienceType*stringTarget audience type
"ALL""SEGMENT""FILTERED"segmentId?stringSegment ID. Required when audienceType is SEGMENT.
uuidaudienceCondition?Audience filter tree. Required when audienceType is FILTERED. Same structure as a segment's condition.
Campaign created
application/json- response
success?booleandata?curl -X POST 'https://api.send.47signals.com/campaigns' \ -H 'Content-Type: application/json' \ -d '{ "name": "March newsletter", "subject": "What shipped in March", "body": "<h1>Hello {{firstName}}</h1>", "from": "news@example.com", "fromName": "Example", "audienceType": "ALL"}'{ "success": true, "data": { "id": "string", "name": "string", "description": "string", "subject": "string", "body": "string", "from": "user@example.com", "fromName": "string", "replyTo": "user@example.com", "type": "TRANSACTIONAL", "status": "DRAFT", "audienceType": "ALL", "audienceCondition": { "logic": "AND", "groups": [ { "filters": [ { "field": "string", "operator": "equals", "value": null, "unit": "days" } ], "conditions": {} } ] }, "segmentId": "string", "scheduledFor": "2019-08-24T14:15:22Z", "totalRecipients": 0, "sentCount": 0, "deliveredCount": 0, "openedCount": 0, "clickedCount": 0, "bouncedCount": 0, "projectId": "string", "sentAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}