---
title: "Cancel an SMS campaign"
method: POST
path: "/sms/campaigns/{id}/cancel"
tags: ["SMS campaigns"]
---

# Cancel an SMS campaign

`POST /sms/campaigns/{id}/cancel`

## Request

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

Cancel a `scheduled`, `sending` or `paused` SMS campaign. Messages already handed to the carrier are not recalled. Requires the `campaigns:send` capability.

## Response `200`

The SMS campaign, now `canceled`; its queued texts are canceled and refunded.

- 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

- `202`: Accepted: the campaign is already `canceled` and sends nothing more, and more than 500 queued texts are still being canceled and refunded in the background. The body is the SMS campaign; `GET /sms/campaigns/{id}` shows the same, and the refunds appear on your balance as they finish.
- `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 can't do that in its current state.
- `422`: Validation error.

---

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