---
title: "Create a campaign draft"
method: POST
path: "/api/v1/campaigns"
---

# Create a campaign draft

`POST /api/v1/campaigns`

## Request

- Base URL: `http://127.0.0.1:4310`
- URL: `http://127.0.0.1:4310/api/v1/campaigns`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `sfb_session`

## Request body

- object
  - `name` string, required
  - `channel` 'email' | 'sms' | 'whatsapp'
  - `subject` string
  - `preview_text` string
  - `body` string: Plain text. Merge fields: {{first_name}}, {{client_name}}, {{business_name}}, {{booking_link}}, {{last_service}}
  - `audience` object
    - `tag_ids` string[]
    - `service_ids` string[]
    - `location_ids` string[]
    - `last_visit_before` string, date
    - `last_visit_after` string, date
    - `spend_min_minor` integer
    - `spend_max_minor` integer
  - `idempotency_key` string

## Response `201`

OK

- object

## Other responses

- `400`: Validation error
- `401`: Unauthenticated
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict or invalid state

---

[API](https://skmtc.dev/scalingfirm/apis/tsf-booking-api.md) · [All operations](https://skmtc.dev/scalingfirm/apis/tsf-booking-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalingfirm/apis/tsf-booking-api/revisions/81704199cd37?raw)
