Skip to main content
POST
Create a marketing campaign template.

Authorizations

X-API-Key
string
header
required

Company API key - scoped to a specific company. Generate from the Integrations page in your dashboard.

Body

application/json

Template fields. Only name is required up front.

Request body for creating a marketing campaign template. Only name is required; everything else can be filled in later via PATCH. The email body is authored as bodyDocument (visual-builder JSON); bodyHtml is rendered from it on the server and cannot be supplied directly.

name
string
required

Template name

description
string

Optional note describing when to use this template

subject
string

Default email subject line applied to campaigns created from this template

replyTo
string

Optional default Reply-To email address. Must be a valid email if provided.

bodyDocument
string

Visual-builder JSON document for the email body. This is the single source of truth: the server renders bodyHtml from it (any bodyHtml you send is ignored). Envelope: {"subject": string, "subTitle": string, "content": }. Every node is {"type": string, "attributes": {MJML attributes as string values, e.g. "padding": "10px 25px 10px 25px", "background-color": "#ffffff", "color": "#333333", "font-size": "16px", "align": "center", "width": "600px", "href", "src"}, "data": {"value": {...}}, "children": [...]}; attribute values must be strings (numbers are dropped). Tree: page -> (wrapper | section) -> section -> column -> content blocks. Content block types: "text" (data.value.content = inline HTML string), "image" (attributes.src, alt, href, width), "button" (data.value.content = label, attributes.href), "divider", "spacer" (attributes.height), "social" (data.value.elements = [{src, href, content, target}]), "navbar" (data.value.links = [{href, content}]), "raw" (data.value.content = raw MJML/HTML), plus "hero", "group", "accordion", "carousel" and "table". Each also has an "advanced_" variant (e.g. "advanced_text"), which is what the builder palette inserts; advanced content blocks placed directly under the page or a wrapper are auto-wrapped in a section/column. Page node: {"type": "page", "attributes": {"background-color": "#efeeea", "width": "600px"}, "data": {"value": {"breakpoint": "480px", "font-family": string, "font-size": "14px", "line-height": "1.7", "font-weight": "400", "text-color": "#000000", "content-background-color": string (optional), "headStyles": [{"content": css, "inline": bool}], "fonts": [{"name", "href"}], "headAttributes": "", "responsive": true}}}. Always set "responsive": true — a missing flag renders a fixed-width layout. Merge tokens pass through rendering untouched: {{content}} inside a text block marks where content-engine output is inserted when content is published as a campaign from this template; {{variableName}} tokens (e.g. {{First Name}}) are replaced per recipient from the smart-list row; {{unsubscribe}} becomes the per-recipient unsubscribe link.

senderProfileId
string

Default sender profile ID for campaigns created from this template

listId
string

Default smart list ID whose rows become recipients

fieldMappings
object

Field mapping for resolving recipient email from a list row, e.g. {"email": ["Email", "Work Email"]}

scheduleSettings
string

Optional sending-window settings copied onto campaigns created from this template

companyId
string

Company ID (falls back to the authenticated user's current company)

Response

The created template

A reusable marketing campaign template

id
string

Template ID

companyId
string

Company this template belongs to

uid
string

User ID that created the template

name
string

Template name

description
string

Optional note describing when to use this template

subject
string

Default email subject line

replyTo
string

Default Reply-To email address

bodyHtml
string

Email HTML rendered by the server from bodyDocument (read-only)

bodyDocument
string

Visual-builder JSON document for the email body (source of truth)

senderProfileId
string

Default sender profile ID

listId
string

Default smart list ID

fieldMappings
object

Field mapping for resolving recipient email from a list row

scheduleSettings
string

Optional sending-window settings

chatHistory
string[]

Saved AI chat history for this template (reserved for a future AI edit mode)

created_date
string

ISO timestamp when the template was created

updated_date
string

ISO timestamp when the template was last updated

smartList
object

Summary of the default smart list

senderProfile
object

Summary of the default sender profile