---
title: "Update an SMS campaign"
description: "Edit a draft SMS campaign: name, template, segment, sender (null returns to automatic routing), topic, excluded_contact_ids, variable_fallbacks and the saved send time scheduled_at (null clears it). `PATCH /api/v1/sms/campaigns/{id}`"
url: https://www.unitpost.com/docs/sms/patch-sms-campaigns-id
section: "SMS API reference"
updated: 2026-10-13
---
# Update an SMS campaign

`PATCH /api/v1/sms/campaigns/{id}`

Edit a `draft` SMS campaign: name, template, segment, sender (`null` returns to automatic routing), topic, `excluded_contact_ids`, `variable_fallbacks` and the saved send time `scheduled_at` (`null` clears it). Once the campaign has been sent or scheduled, or while it is archived, edits return `409`. Pass `{ "archived": true | false }` to archive or restore it (this takes precedence over other fields). Requires the `campaigns:write` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `archived` | boolean | no | — |
| `name` | string | no | — |
| `template_id` | string | no | — |
| `segment_id` | string | no | — |
| `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 (200)

| 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 |
| --- | --- |
| 200 | The updated SMS campaign. |
| 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. |
| 409 | The campaign is no longer a draft, or it is archived (restore it first). |
| 422 | Validation error, a referenced resource was not found, or `scheduled_at` is outside your plan's window. |

## Example request

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

## Example response (200)

```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/patch-sms-campaigns-id
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
