v97

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-04231129815.9 KB
Campaigns

Create campaign

Creates a campaign and linked email from at most one of prompt, HTML, Sequenzy blocks, or an existing template. Omit all content sources to create an empty draft. Optional From/Reply-To inputs create or select profiles; From addresses require a verified sending domain. Defaults to draft. Use status sent only to archive an imported/already-sent campaign.

post/campaigns

Request body

namestring required
subjectstring

Required with HTML, blocks, or templateId; optional with prompt, where it overrides the generated subject.

previewTextstring nullable

Optional inbox preview text saved on the linked email.

preheaderTextstring nullable

Compatibility alias for previewText.

trackingCodestring nullable

Optional campaign tracking code available to UTM templates as {{campaign.trackingCode}}. Empty strings are stored as null.

status'draft' | 'sent'

Initial status. Defaults to draft. Use sent only for imported/already-sent campaigns.

sentAtstring date-time nullable

ISO date-time for an imported/already-sent campaign. Only valid with status sent; defaults to now when omitted.

htmlstring

Raw HTML body. Mutually exclusive with blocks.

blocksobject[]

Sequenzy email blocks. Mutually exclusive with html. Put visual styling under styles; top-level style keys such as backgroundColor, backgroundOpacity, borderColor, borderWidth, and borderRadius are normalized into styles.

promptstring

Natural-language request for branded native campaign blocks.

stylestring

Generation style; valid only with prompt.

tonestring

Generation tone; valid only with prompt.

campaignDataobject nullable
computedListsobject[]
labelsstring[]

Label names to assign. Missing labels are created automatically.

labelstring[]

Compatibility alias for labels.

templateIdstring

Company-owned email template to copy into the campaign. Mutually exclusive with prompt, HTML, and blocks.

segmentIdstring

Shorthand for targeting one saved segment. Equivalent to targetLists {"type":"segment","segmentId":"seg_123"}. Mutually exclusive with targetLists.

targetListsobject

Campaign audience saved on the draft. Omit to leave targeting unset and choose it when scheduling. Examples: {"type":"all"}, {"type":"lists","listIds":["list_123"]}, {"type":"segment","segmentId":"seg_123"}, {"type":"filtered","filters":[],"filterJoinOperator":"and"}, {"type":"rules","include":[],"exclude":[]}. Mutually exclusive with segmentId.

fromEmailstring email

Campaign From address. Its domain must be configured and verified.

fromNamestring

Display name for a newly created sender profile. Requires fromEmail; omit it when using senderProfileId, which already carries its own display name.

senderProfileIdstring

Existing sender profile ID. It already supplies both the From address and display name, so send it on its own and omit fromEmail and fromName.

replyTostring email

Campaign Reply-To address. A reply profile is created when needed.

replyToNamestring

Display name for a newly created reply profile. Requires replyTo; omit it when using replyProfileId, which already carries its own display name.

replyProfileIdstring

Existing reply profile ID. It already supplies both the Reply-To address and display name, so send it on its own and omit replyTo and replyToName.

Response

Campaign created

successboolean
warningsstring[]

Non-blocking advisories about the blocks that were written. The write succeeded. Present when a field was not part of the block schema and was discarded, or when a supported field does not control what its name suggests for that block type - for example styles.backgroundColor on a button colors the band behind the button while the fill comes from buttonColor. Each message names the offending path and the fields that block does accept. A sequence email step update also reports the blocks the step's existing Style > Format added back on top of the submitted blocks, because the response echoes node config rather than the stored blocks. Absent when there is nothing to report.

Example response

{
  "success": true,
  "campaign": {
    "status": "draft",
    "labels": [
      "edm",
      "api"
    ],
    "url": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123",
    "previewUrl": "https://sequenzy.com/dashboard/company/comp_abc123/campaign/camp_abc123?step=review"
  },
  "warnings": [
    "blocks[0].styles.color is not a supported field and was ignored. Button label color comes from the block-level `buttonTextColor` field. Supported styles fields: backgroundColor, backgroundOpacity, bleed, borderColor, borderRadius, borderWidth, paddingBottom, paddingLeft, paddingRight, paddingTop, textAlign, textColor."
  ]
}