---
title: "Create campaign"
method: POST
path: "/campaigns"
tags: ["Campaigns"]
---

# Create campaign

`POST /campaigns`

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.

## Request body

- object
  - `name` string, required
  - `subject` string — Required with HTML, blocks, or templateId; optional with prompt, where it overrides the generated subject.
  - `previewText` string, nullable — Optional inbox preview text saved on the linked email.
  - `preheaderText` string, nullable — Compatibility alias for previewText.
  - `trackingCode` string, 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.
  - `sentAt` string, date-time, nullable — ISO date-time for an imported/already-sent campaign. Only valid with status sent; defaults to now when omitted.
  - `html` string — Raw HTML body. Mutually exclusive with blocks.
  - `blocks` object[] — 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.
  - `prompt` string — Natural-language request for branded native campaign blocks.
  - `style` string — Generation style; valid only with prompt.
  - `tone` string — Generation tone; valid only with prompt.
  - `campaignData` object, nullable
  - `computedLists` object[]
  - `labels` string[] — Label names to assign. Missing labels are created automatically.
  - `label` string[] — Compatibility alias for labels.
  - `templateId` string — Company-owned email template to copy into the campaign. Mutually exclusive with prompt, HTML, and blocks.
  - `segmentId` string — Reserved for client compatibility.
  - `fromEmail` string, email — Campaign From address. Its domain must be configured and verified.
  - `fromName` string — Display name for a newly created sender profile. Requires fromEmail.
  - `senderProfileId` string — Existing sender profile ID. Mutually exclusive with fromEmail.
  - `replyTo` string, email — Campaign Reply-To address. A reply profile is created when needed.
  - `replyToName` string — Display name for a newly created reply profile. Requires replyTo.
  - `replyProfileId` string — Existing reply profile ID. Mutually exclusive with replyTo.

## Response `200`

Campaign created

- object
  - `success` boolean
  - `campaign` object
    - `id` string
    - `name` string
    - `subject` string
    - `status` string
    - `sentAt` string, date-time, nullable — Present when the campaign is created as an imported/already-sent campaign.
    - `trackingCode` string, nullable — Campaign tracking code available to UTM templates as `{{campaign.trackingCode}}`.
    - `labels` string[]
    - `senderProfileId` string
    - `fromName` string
    - `fromEmail` string, email
    - `replyProfileId` string, nullable
    - `replyToName` string, nullable
    - `replyToEmail` string, email, nullable
    - `url` string, uri
    - `previewUrl` string, uri

## Other responses

- `400` — Validation error or missing sender profile
- `401` — Unauthorized
- `500` — Campaign could not be created

## Changes

- **2026-07-12** `d103f2b71fca` — 1 breaking, 16 info
  - the `templateId` request property's minLength was increased from `0` to `1`
  - added the new optional request property `fromEmail`
  - added the new optional request property `fromName`
  - added the new optional request property `prompt`
  - …13 more
- **2026-07-02** `f4df432f0a85` — 2 info
  - added the new optional request property `preheaderText`
  - added the new optional request property `previewText`
- **2026-06-18** `7510100bfe08` — 3 info
  - added the new optional request property `sentAt`
  - added the new optional request property `status`
  - added the optional property `campaign/sentAt` to the response with the `200` status
- **2026-05-19** `1a51a400be50` — 2 info
  - added the new optional request property `trackingCode`
  - added the optional property `campaign/trackingCode` to the response with the `200` status
- **2026-05-15** `b040bb8c6608` — 2 info
  - added the optional property `campaign/previewUrl` to the response with the `200` status
  - added the optional property `campaign/url` to the response with the `200` status

[Full history](https://skmtc.dev/sequenzy/apis/sequenzy-api/changes/campaigns/post.md)

---

[API](https://skmtc.dev/sequenzy/apis/sequenzy-api.md) · [All operations](https://skmtc.dev/sequenzy/apis/sequenzy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sequenzy/sequenzy-api/revisions/84596f27c7bf/schema)
