Send a test of a template
POST/api/v1/email/templates/{id}/test-send
POST /email/templates/{id}/test-send
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 '{ }'Response · 200
{
"object": "template_test_send",
"email_id": "email_123",
"status": "queued",
"dispatched": false,
"unresolved_variables": [
"string"
]
}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.
Parameters1 field
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Request body3 fields
| Field | Type | Description |
|---|---|---|
torequired | string | — |
subject | string | — |
variables | object | — |
Response · 200 fields5 fields
| Field | Type | Description |
|---|---|---|
objectrequired | enumtemplate_test_send | — |
email_idrequired | string | The test email (`email_…`); retrieve it like any email. |
statusrequired | string | The test email's status, usually `queued`. |
dispatchedrequired | boolean | False when this environment records sends without delivering them. |
unresolved_variablesrequired | string[] | Variables with no sample value, sent as a literal `{{name}}`. |
200401403404422429502