---
title: "Create an SMS campaign"
method: POST
path: "/sms/campaigns"
tags: ["SMS campaigns"]
---

# Create an SMS campaign

`POST /sms/campaigns`

## Request

- Base URL: `https://www.unitpost.com/api/v1`
- URL: `https://www.unitpost.com/api/v1/sms/campaigns`
- Auth: HTTP bearer

Create an SMS campaign as a `draft`: a published SMS template sent to a segment. Omit `sender_id` for automatic routing (the best live sender per recipient), or pass an `snum_…` number to send from it. A draft always saves, even if it isn't ready yet; only an id that doesn't exist in this workspace returns `422`. `scheduled_at` saves a send time ("Send at") that a send with no `scheduled_at` uses. Check readiness with [Validate an SMS campaign](#get-sms-campaigns-id-validate), then send it with [Send an SMS campaign](#post-sms-campaigns-id-send). Requires the `campaigns:write` capability.

## Request body

- SmsCampaignCreate
  - `name` string, required
  - `template_id` string, required
  - `segment_id` string, required
  - `sender_id` string, nullable
  - `topic_id` string, nullable
  - `excluded_contact_ids` string[]
  - `variable_fallbacks` object
  - `scheduled_at` string, date-time, nullable

## Response `201`

Created.

- SmsCampaign
  - `object` 'sms_campaign', required
  - `id` string, required
  - `name` string, required
  - `status` 'draft' | 'scheduled' | 'sending' | 'paused' | 'sent' | 'canceled' | 'failed', required
  - `type` 'marketing' | 'transactional', required
  - `template_id` string, required
  - `segment_id` string, required
  - `sender_id` string, nullable, required
  - `topic_id` string, nullable, required
  - `routing` 'automatic' | 'fixed' | 'pool', required
  - `scheduled_at` string, nullable, required
  - `hold` object, nullable, required
    - `reason` 'scheduled' | 'quiet_hours', required
    - `until` string, nullable, required
  - `projected_recipients` object, nullable, required
    - `total` number, required
    - `reachable` number, required
    - `skipped` number, required
  - `recipient_count` number, required
  - `variable_fallbacks` object, required
  - `excluded_contact_ids` string[], required
  - `started_at` string, nullable, required
  - `completed_at` string, nullable, required
  - `canceled_at` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: Missing or invalid API key.
- `403`: Insufficient scope, or SMS is not on this plan.
- `404`: SMS campaign not found, or SMS is not enabled.
- `422`: Validation error, or a referenced resource was not found.

---

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