---
title: "Send a test of an SMS template"
description: "Fill the template's {{variables}} and send ONE test text to to: the simulator or a number your workspace verified (403 for any other number). `POST /api/v1/sms/templates/{id}/test-send`"
url: https://www.unitpost.com/docs/sms/post-sms-templates-id-test-send
section: "SMS API reference"
updated: 2026-10-13
---
# Send a test of an SMS template

`POST /api/v1/sms/templates/{id}/test-send`

Fill the template's `{{variables}}` and send ONE test text to `to`: the simulator or a number your workspace verified (`403` for any other number). A real text, billed like any; from `sender_id` or routed by the destination's country. Every variable needs a value (`422`). Pass an `Idempotency-Key` so a retry never texts twice. Rate limited per workspace. Requires the `sms:send` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |
| `Idempotency-Key` | header | string | no | Any unique string (1–256 characters, e.g. a UUID). Retrying with the same key and the same body within 24 hours returns the first result instead of sending again; the same key with a different body is `409 invalid_idempotent_request`, and one still in flight is `409 concurrent_idempotent_requests`. |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | string | yes | A simulator number (`+14254147755` delivers, `+14254147167` fails) or one of GET /sms/test-destinations' verified numbers (E.164). |
| `variables` | object | no | Values for the template's `{{variables}}`; every one must be filled. |
| `sender_id` | string | no | Send from this live sender (`snum_…`); default: routed like any text. |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | string | yes | — |
| `sms_id` | string | yes | The test text (`sms_…`); read it with GET /sms/{id}. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The test was sent. |
| 400 | The body isn't JSON, or the `Idempotency-Key` header is not 1–256 characters. |
| 401 | Missing or invalid API key. |
| 402 | The SMS wallet can't cover the text. |
| 403 | Insufficient scope, SMS is not on this plan, or `to` isn't the simulator or a verified test number. |
| 404 | SMS template not found, or SMS is not enabled. |
| 409 | No live sender to send from, or the `Idempotency-Key` is in use by a request still running, or with another body. |
| 422 | An empty message, an unfilled variable, a sender that isn't live, or an unknown key. |
| 429 | Too many test texts; honor Retry-After. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/sms/templates/tmpl_123/test-send' \
  -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_test_send",
  "sms_id": "sms_123"
}
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/sms/post-sms-templates-id-test-send
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
