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

# Create a campaign

`POST /campaigns`

Create and send or schedule a campaign. One of 'body' or 'template_id' is required. One of 'list_id' or 'segment_id' is required.

## Request body

- CampaignCreateRequest
  - `sender_name` string, required — Sender's name
  - `sender_email` string, required — Sender's email address
  - `subject` string, required — Email subject
  - `body` string — HTML code of the template, encoded in Base64. Required if template_id is not provided.
  - `template_id` union — Template ID uploaded or created in the service. Required if body is not provided.
    - integer
    - string
  - `list_id` union — Mailing list ID or array of mailing list IDs. Required if segment_id is not provided. Max 10 IDs.
    - integer
    - integer[]
  - `segment_id` integer — Segment ID created in your account.
  - `is_test` boolean — Send a test email to the sender's address specified in sender_email.
  - `send_date` string — Scheduled date and time (Y-m-d H:i:s). Must not be in the past.
  - `name` string — Campaign name.
  - `use_dynamic_list` boolean — Send to contacts added after campaign creation but before sending.
  - `attachments` object — Attached files (max 5). Key is filename, value is content.
  - `attachments_binary` object — Attached files (max 5). Key is filename, value is Base64 content.
  - `type` 'draft' — Create campaign as a draft.
  - `body_amp` string — AMP version of the email, encoded in base64.
  - `stats` object — Enable collection of statistics on opens and clicks.
    - `clicks` boolean — Track link clicks.
    - `opens` boolean — Track email opens.
    - `utm_campaign` string — Custom UTM tags for Google Analytics.

## Response `200`

Campaign created

- CampaignCreateResponse
  - `id` integer — Email campaign ID
  - `status` integer — Task status for sending (13 - copying addresses, 26 - draft)
  - `count` integer — Number of recipients
  - `tariff_email_qty` integer — Number of emails written off from balance
  - `overdraft_price` string — Price for one email at an increase
  - `ovedraft_currency` string — Currency

## Other responses

- `401` — Unauthorized
- `403` — Forbidden

---

[API](https://skmtc.net/sendpulse/apis/sendpulse-bulk-email-api.md) · [All operations](https://skmtc.net/sendpulse/apis/sendpulse-bulk-email-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sendpulse/sendpulse-bulk-email-api/revisions/cd38f8c6a425/schema)
