---
title: "Create a new email campaign"
method: POST
path: "/v2/email/campaigns"
tags: ["email-campaigns-v2"]
---

# Create a new email campaign

`POST /v2/email/campaigns`

## Request

- Base URL: `https://api.tracklysms.com/api`
- URL: `https://api.tracklysms.com/api/v2/email/campaigns`
- Auth: API key in header `X-Api-Key`

Campaign starts in 'draft' status. Use the send endpoint to trigger.

## Request body

- EmailCampaignCreateRequest
  - `abTest` EmailABTest
    - `enabled` boolean: Whether A/B testing is enabled
    - `variants` object[]: A/B test variant configs
  - `fromEmail` string, required: Sender email address
  - `fromName` string, required: Sender display name
  - `listIds` string[]: Target list IDs
  - `name` string, required: Campaign name
  - `replyTo` string: Reply-To address
  - `scheduledAt` string, date-time: Scheduled send time (ISO 8601)
  - `segmentIds` string[]: Target segment IDs
  - `sendType` string: Send type: immediate, scheduled
  - `subject` string, required: Email subject line
  - `templateId` string: Email template ID

## Response `201`

Campaign created

- EmailCampaignResponse
  - `abTest` object: A/B test config
  - `complianceStatus` string: Compliance check status
  - `createdAt` string, date-time: Creation timestamp
  - `fromEmail` string: Sender email
  - `fromName` string: Sender name
  - `id` string: Campaign ID
  - `listIds` string[]: Target list IDs
  - `name` string: Campaign name
  - `replyTo` string: Reply-To address
  - `scheduledAt` string, date-time: Scheduled send time
  - `segmentIds` string[]: Target segment IDs
  - `sendType` string: Send type
  - `stats` object: Campaign statistics
  - `status` string: Campaign status
  - `subject` string: Subject line
  - `templateId` string: Template ID
  - `updatedAt` string, date-time: Last update timestamp

## Other responses

- `400`: Validation error
- `401`: Authentication error

---

[API](https://skmtc.dev/tracklysms/apis/trackly-sms-api.md) · [All operations](https://skmtc.dev/tracklysms/apis/trackly-sms-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tracklysms/apis/trackly-sms-api/revisions/ac1ad22cb2a9?raw)
