Create Email Campaign
Creates a campaign together with its first message (subject, body, sender) in one transaction. New campaigns always start as a DRAFT. Creating one never sends anything. Define the audience with contactListId, contactsFilterGroups, or both; set type to AB_TEST and supply abTestConfig for a split test.
Authorization
Authorization In: header
Path Parameters
Project that owns the campaign.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Campaign name shown in the dashboard and reports.
STANDARD is a broadcast. AB_TEST needs Version B from emailMarketing_createCampaignVariation; creating the campaign only stores the first variation, and type cannot be changed later. A workflow sendCampaign step requires AUTOMATION. The step write fails when that campaign is STANDARD or AB_TEST. workflows_verifyWorkflowConfig reports the same error when a step already has one.
Workflow this automation campaign belongs to. Omit this on create. workflows_createWorkflowStep and workflows_insertWorkflowStep set it when the step campaignId is this campaign.
Workflow step this automation campaign belongs to. Omit this on create. The sendCampaign step write sets it together with workflowId.
Limit the audience to members of this contact list. Combine with contactsFilterGroups, or omit to use filters only.
Audience filter groups. An empty group matches everyone. The server seeds one empty AND group when this is omitted.
Attribute conditions, combined with oneDayEventFilters by groupType.
Contact attribute distinct id to filter on.
Attribute type. Defaults to string when omitted.
Comparison operator for the attribute value.
Value to compare the attribute against.
Event conditions over a rolling 24 hour window (not configurable). Each one is a condition in the group alongside filters, so AND, OR, and NOT apply to both. Used the same way by CRM lists, campaign audiences, workflow entry filters, and Audience Filter steps.
Analytics event name from analytics_queryEvents with groupBy action, or Sent email, Delivered email, Opened email, Clicked email, Bounced email, Complained email, or Suppressed email. Those seven read email activity for the same 24 hour window, not analytics.
performed: the contact has at least one event with this name in the last 24 hours. notPerformed: a contact in the project with no such event in the last 24 hours, including contacts with no events at all.
How the conditions in filters and oneDayEventFilters combine: AND all true, OR any true, NOT none true.
When true, the group is ANDed with $subscribed == true. Set by email sending, not the filter UI.
When true, the group is ANDed with $emailValidated != true. Set by email validation, not the filter UI. The user's AND, OR, and NOT are unchanged.
Sunset rules by mailbox provider. A contact at a listed provider who has been sent that many campaign emails since they last opened or clicked is excluded. Set by email sending, not the filter UI.
Contact property and direction used to order the send. Omit to use the project default.
A/B test settings. Only used when type is AB_TEST; omit for a standard campaign.
UTM tags appended to links in the email. Omit to use source=saasco, medium=email, and campaign=.
Send-pacing hint. Omit for the default reputation-based pace. 0 skips pacing on qualifying domains.
BCC address applied to every send from this campaign's first message.
CC address applied to every send from this campaign's first message.
Sending-ready domain name from domains_listDomains with readyToSend: true. Omit to use a ready project default or the first ready domain. Set explicitly for workflow emails.
Local part of the From address (the part before @). Omit to use the project default, which may be empty. Set explicitly for workflow emails; edit later with emailMarketing_updateCampaignMessage.
Display name in the From header. Omit to use the project default, which may be empty. Set explicitly for workflow emails; edit later with emailMarketing_updateCampaignMessage.
Reply-To address for this campaign's first message.
When to send, as an ISO 8601 timestamp with a timezone offset. On a STANDARD campaign this is the send time: Send Email Campaign (emailMarketing_sendCampaign) schedules the campaign for it if it is still in the future, and sends now if it has passed. Nothing is scheduled until Send Email Campaign is called. On an A/B test it is the first variation's send time and only applies when the tested variable is SEND_TIME.
Plain-text body fallback. The HTML body is used when both are set.
Editor theme for the first message. Omit to use the default light theme.
Subject line as HTML. Omit to create an empty draft subject.
Subject as email-editor JSON (TipTap/Novel document), written by the dashboard. Omit it and send subjectHTML: the dashboard editor then opens that HTML. Only send it together with the matching subjectHTML.
Inbox preview / preheader text as HTML.
Inbox preview as email-editor JSON, written by the dashboard. Omit it and send previewTextHTML: the dashboard editor then opens that HTML. Only send it together with the matching previewTextHTML.
Email body as an HTML fragment only — no , , , or tags. Those nest a second document and break open tracking, link rewriting, and the unsubscribe footer. The dashboard editor opens this HTML as headings, paragraphs, lists, links, images and buttons (an ); it has no tables or custom layout, so a later edit in the dashboard saves the body without them.
Email body as email-editor JSON (TipTap/Novel { type: "doc", content: [...] }), written by the dashboard. Send time uses bodyHTML. Omit it and send bodyHTML: the dashboard editor then opens that HTML. Only send it together with the matching bodyHTML.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/projects/string/email-campaigns" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{ "id": "string", "createdAt": "string", "updatedAt": "string", "projectId": "string", "name": "string", "status": "DRAFT", "type": "STANDARD", "workflowId": "string", "workflowStepId": "string", "sentAt": "string", "contactListId": "string", "contactsFilterGroups": [], "lastSuccessContactId": "string", "lastSuccessContactCreatedAt": "string", "sendCursor": { "distinctId": "string", "sortValue": "string" }, "sendOrderByProperty": { "direction": "asc", "propertyKey": "string" }, "providerSendState": { "checkedAt": "string", "lanes": { "property1": { "deferred": true, "passed": 0, "slowed": { "at": "string", "finding": "string" } }, "property2": { "deferred": true, "passed": 0, "slowed": { "at": "string", "finding": "string" } } }, "pausedForProviders": true, "rescanFrom": { "cursor": { "distinctId": "string", "sortValue": "string" } }, "slowPass": true }, "abTestConfig": { "variable": "SUBJECT", "samplePercent": 20, "winnerMetric": "OPEN_RATE", "winnerWaitHours": 4, "winnerWaitUnit": "HOURS", "sendTimeDelayHours": 2, "sendTimeDelayUnit": "HOURS", "winnerMessageId": "string", "winnerSelectedAt": "string", "winnerRolloutAt": "string", "winnerWaitStartedAt": "string", "status": "AWAITING_SAMPLE", "samplePaginationEnd": 0 }, "utmConfig": { "enabled": true, "params": { "campaign": "", "content": "", "medium": "", "source": "", "term": "" } }, "sendCount": 0, "sendingTargetDurationMs": 0, "sendPaginationCount": 0, "messages": [], "bcc": "string", "bodyHTML": "string", "bodyJSON": { "property1": null, "property2": null }, "cc": "string", "fromDomain": "string", "fromEmailUsername": "string", "fromName": "string", "previewTextHTML": "string", "previewTextJSON": { "property1": null, "property2": null }, "replyTo": "string", "scheduledAt": "string", "subjectHTML": "string", "subjectJSON": { "property1": null, "property2": null }, "text": "string", "theme": { "body": { "align": "left", "background": "string", "container": "string" }, "button": { "background": "string", "borderColor": "string", "borderSize": 0, "color": "string", "radius": 0 }, "link": { "color": "string" }, "template": "string", "typography": { "h1": { "color": "string", "fontSize": 0, "lineHeight": 0 }, "h2": { "color": "string", "fontSize": 0, "lineHeight": 0 }, "h3": { "color": "string", "fontSize": 0, "lineHeight": 0 }, "p": { "color": "string", "fontSize": 0, "lineHeight": 0 } } }}Get Email Campaign
Fetches a single campaign with its messages, audience definition, status, and send progress. Returns 404 if the campaign does not exist in this project.
Update Email Campaign
Updates a campaign's settings. Despite the PUT, only the fields present in `changes` are written. Anything omitted keeps its current value. Editing a campaign that has already sent changes future behaviour only; it does not alter or resend emails already delivered.