---
title: "Create an SMS template"
description: "Create an SMS template as a draft. `POST /api/v1/sms/templates`"
url: https://www.unitpost.com/docs/sms/post-sms-templates
section: "SMS API reference"
updated: 2026-10-13
---
# Create an SMS template

`POST /api/v1/sms/templates`

Create an SMS template as a `draft`. `body` may be empty for a draft (it must be filled before publishing) and is capped at 10 SMS segments (1,530 GSM-7 characters). Publish it with `{ "status": "published" }` on [Update an SMS template](https://www.unitpost.com/docs/sms/patch-sms-templates-id). Requires the `templates:write` capability.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | — |
| `body` | string | no | — |

## Response fields (201)

| 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 |
| --- | --- |
| 201 | Created. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | SMS is not enabled for this workspace. |
| 422 | Validation error. |

## Example request

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

## Example response (201)

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