---
title: "Create an SMS campaign"
description: "Create an SMS campaign as a draft: a published SMS template sent to a segment. `POST /api/v1/sms/campaigns`"
url: https://www.unitpost.com/docs/sms/post-sms-campaigns
section: "SMS API reference"
updated: 2026-10-13
---
# Create an SMS campaign

`POST /api/v1/sms/campaigns`

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](https://www.unitpost.com/docs/sms/get-sms-campaigns-id-validate), then send it with [Send an SMS campaign](https://www.unitpost.com/docs/sms/post-sms-campaigns-id-send). Requires the `campaigns:write` capability.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | — |
| `template_id` | string | yes | — |
| `segment_id` | string | yes | — |
| `sender_id` | string \| null | no | — |
| `topic_id` | string \| null | no | — |
| `excluded_contact_ids` | string[] | no | — |
| `variable_fallbacks` | object | no | — |
| `scheduled_at` | string \| null | no | — |

## Response fields (201)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | — |
| `name` | string | yes | — |
| `status` | enum | yes | One of: `draft`, `scheduled`, `sending`, `paused`, `sent`, `canceled`, `failed`. |
| `type` | enum | yes | One of: `marketing`, `transactional`. |
| `template_id` | string | yes | — |
| `segment_id` | string | yes | — |
| `sender_id` | string \| null | yes | — |
| `topic_id` | string \| null | yes | — |
| `routing` | enum | yes | One of: `automatic`, `fixed`, `pool`. |
| `scheduled_at` | string \| null | yes | — |
| `hold` | object \| null | yes | — |
| `projected_recipients` | object \| null | yes | — |
| `recipient_count` | number | yes | — |
| `variable_fallbacks` | object | yes | — |
| `excluded_contact_ids` | string[] | yes | — |
| `started_at` | string \| null | yes | — |
| `completed_at` | string \| null | yes | — |
| `canceled_at` | string \| null | yes | — |
| `created_at` | string | yes | — |
| `updated_at` | string | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 201 | Created. |
| 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. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/sms/campaigns' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{ }'
```

## Example response (201)

```json
{
  "object": "sms_campaign",
  "id": "id_123",
  "name": "Example",
  "status": "draft",
  "type": "marketing",
  "template_id": "template_123",
  "segment_id": "segment_123",
  "sender_id": "sender_123",
  "topic_id": "topic_123",
  "routing": "automatic",
  "scheduled_at": "2026-01-01T00:00:00.000Z",
  "hold": {
    "reason": "scheduled",
    "until": "string"
  },
  "projected_recipients": {
    "total": 1,
    "reachable": 0,
    "skipped": 0
  },
  "recipient_count": 1,
  "variable_fallbacks": {},
  "excluded_contact_ids": [
    "string"
  ],
  "started_at": "2026-01-01T00:00:00.000Z",
  "completed_at": "2026-01-01T00:00:00.000Z",
  "canceled_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/sms/post-sms-campaigns
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
