---
title: "Update an SMS campaign"
method: PATCH
path: "/sms/campaigns/{id}"
tags: ["SMS campaigns"]
---

# Update an SMS campaign

`PATCH /sms/campaigns/{id}`

## Request

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

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.

## Request body

- SmsCampaignUpdate
  - `archived` boolean
  - `name` string
  - `template_id` string
  - `segment_id` string
  - `sender_id` string, nullable
  - `topic_id` string, nullable
  - `excluded_contact_ids` string[]
  - `variable_fallbacks` object
  - `scheduled_at` string, date-time, nullable

## Response `200`

The updated SMS campaign.

- 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.
- `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.

---

[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)
