---
title: "Update an SMS template"
description: "Update an SMS template's name, body or status. `PATCH /api/v1/sms/templates/{id}`"
url: https://www.unitpost.com/docs/sms/patch-sms-templates-id
section: "SMS API reference"
updated: 2026-10-13
---
# Update an SMS template

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

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.

## Parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | — |
| `body` | string | no | — |
| `status` | enum | no | One of: `draft`, `published`. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `id` | string | yes | — |
| `name` | string | yes | — |
| `body` | string | yes | — |
| `status` | enum | yes | One of: `draft`, `published`. |
| `created_at` | string | yes | — |
| `updated_at` | string | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 200 | The updated SMS template. |
| 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`. |

## Example request

```bash
curl -X PATCH 'https://www.unitpost.com/api/v1/sms/templates/tmpl_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_template",
  "id": "id_123",
  "name": "Example",
  "body": "string",
  "status": "draft",
  "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-templates-id
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
