---
title: "Send a test of a template"
description: "Render the template with sample variables and send ONE test email to to, exactly as a recipient would get it (footer included). `POST /api/v1/email/templates/{id}/test-send`"
url: https://www.unitpost.com/docs/email/post-email-templates-id-test-send
section: "Email API reference"
updated: 2026-10-13
---
# Send a test of a template

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

Render the template with sample `variables` and send ONE test email to `to`, exactly as a recipient would get it (footer included). With a verified sending domain it comes from `test@<your domain>` and may go to anyone; with none it comes from Unitpost's shared test address and only to your workspace's members (`403 forbidden` otherwise). `unresolved_variables` lists the ones with no sample value. Rate limited per workspace. Requires the `emails:send` capability.

## Parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `to` | string | yes | — |
| `subject` | string | no | — |
| `variables` | object | no | — |

## Response fields (200)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | enum | yes | One of: `template_test_send`. |
| `email_id` | string | yes | The test email (`email_…`); retrieve it like any email. |
| `status` | string | yes | The test email's status, usually `queued`. |
| `dispatched` | boolean | yes | False when this environment records sends without delivering them. |
| `unresolved_variables` | string[] | yes | Variables with no sample value, sent as a literal `{{name}}`. |

## Responses

| Status | Description |
| --- | --- |
| 200 | The test was handed off. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope, the first-send identity gate, or a recipient outside your workspace without a verified domain. |
| 404 | Template not found. |
| 422 | Validation error, or the template has no content yet. |
| 429 | Too many test sends; honor Retry-After. |
| 502 | Couldn't reach the mailing engine. |

## Example request

```bash
curl -X POST 'https://www.unitpost.com/api/v1/email/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": "template_test_send",
  "email_id": "email_123",
  "status": "queued",
  "dispatched": false,
  "unresolved_variables": [
    "string"
  ]
}
```

## Links

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