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

# Update an SMS template

`PATCH /sms/templates/{id}`

## Request

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

Update an SMS template's `name`, `body` or `status`. A `published` template must have a message: publishing a blank `body`, or clearing the `body` of a published template, is refused with `422`. While an active SMS campaign uses a published template, editing its `body` or moving it back to `draft` is refused with `409`; unpublishing is also refused while a live automation sends it. Requires the `templates:write` capability.

## Request body

- SmsTemplateUpdate
  - `name` string
  - `body` string
  - `status` 'draft' | 'published'

## Response `200`

The updated SMS template.

- SmsTemplate
  - `object` 'sms_template', required
  - `id` string, required
  - `name` string, required
  - `body` string, required
  - `status` 'draft' | 'published', required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: Missing or invalid API key.
- `403`: Insufficient scope.
- `404`: SMS template not found, or SMS is not enabled.
- `409`: The template is in use by an active campaign or live automation.
- `422`: Validation error, or a published template with a blank `body`.

---

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