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

# Create a draft campaign

`POST /campaigns`

## Request

- Base URL: `https://sending.dev/api/v1`
- URL: `https://sending.dev/api/v1/campaigns`
- Auth: HTTP bearer

Audience via list XOR segment. Required scope: `campaigns:write`.

## Request body

- CreateCampaignInput
  - `name` string, required
  - `fromAddress` string, required
  - `listId` string, uuid
  - `segmentId` string, uuid
  - `templateId` string, uuid
  - `subject` string
  - `html` string
  - `attachments` object[]: Email attachments (max 20, 10 MB each, 25 MB in total). For each item provide exactly one source: `id`, `content` (base64) or `url`.
    - `id` string, uuid: Id of an attachment already uploaded with POST /v1/attachments.
    - `filename` string: File name shown to the recipient. Required with `content` or `url`.
    - `content` string: File content in base64, without the `data:` prefix.
    - `url` string, uri: Public https URL to download the file from (private hosts are blocked).
    - `contentType` string: Content-Type override; when absent, it is inferred from the file name.
    - `contentId` string: Content-ID for inline images referenced in the HTML as `cid:<value>`: the attachment becomes `inline` instead of appearing at the end of the message.
  - `disableTracking` boolean
  - `disableClickTracking` boolean
  - `disableUtm` boolean

## Response `201`

Campaign created.

- object
  - `id` string, uuid, required
  - `status` string, required
  - `warnings` string[]: Non-blocking warnings: present only when there is something to report, e.g. {{...}} variables that match no contact field.

## Other responses

- `401`: Missing or invalid token.
- `403`: Insufficient scope.
- `422`: Invalid input.

---

[API](https://skmtc.dev/sending/apis/sending-dev-api.md) · [All operations](https://skmtc.dev/sending/apis/sending-dev-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sending/apis/sending-dev-api/revisions/9fe78d2918a1?raw)
