Create Campaign

Create a draft campaign.

MethodPOST
/api/v2/campaigns

Creates a draft campaign. Permission: campaigns.

Omitted MAILY content gets a default template with an unsubscribe link. Omitted HTML content gets an HTML starter that already includes {{unsubscribeUrl}}. Omitted senderId uses the default sender, then last used, then any available sender. Rendering does not add a footer.

{
  "subject": "Product update",
  "contentType": "HTML",
  "content": "<html><body><table role=\"presentation\"><tr><td>Hello {{name}}</td></tr></table><p><a href=\"{{unsubscribeUrl}}\">Unsubscribe</a></p></body></html>"
}

Body Parameters

NameTypeDescription
subjectstringRequired. Email subject line.
namestringCampaign name. Default Untitled. Max 100.
previewstring or nullPreview / preheader text.
contentunknownMAILY: TipTap JSON. HTML: a raw HTML string that already includes <a href="{{unsubscribeUrl}}">Unsubscribe</a>. Rendering does not add a footer.
contentType"MAILY" | "HTML"Content format. Default MAILY.
senderIdstringEmail sender id. Defaults to the org default sender.
replyTostring or nullReply-To address.

Response Fields

FieldTypeDescription
idstringCampaign id.
namestringCampaign name.
subjectstringSubject line.
previewstring or nullPreview text.
statusstringAlways DRAFT on create.
contentTypestringMAILY or HTML.
senderIdstringAssigned sender id.
replyTostring or nullReply-To address.
createdAtstringISO 8601 created timestamp.

Errors

StatusnameWhen
401missing_api_keyMissing or invalid bearer token
403missing_permissionToken lacks the campaigns permission
422validation_errorMissing subject or invalid payload