Send a test email from a template
POST/v1/templates/{id}/test
Sends the template to one address so you can see it in a real inbox. It goes through the normal sending path, so it needs a verified from domain, counts toward your plan, and the key also needs emails:send. Test sends are left out of the template’s stats.
Required scope: templates:manage
Parameters
| Name | In | Description |
|---|---|---|
idrequired | path | The template id. |
Request body
| Field | Type |
|---|---|
fromrequired | string |
torequired | string |
versionoptional | integer |
languageoptional | string |
variablesoptional | object |
Unknown fields are rejected, so a typo never silently does nothing.
Example
curl -X POST 'https://api.sendsend.email/v1/templates/ID/test' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"from": "Acme <hello@mail.acme.com>",
"to": "me@acme.com",
"variables": {
"first_name": "Maria"
}
}'Response 202
{
"id": "msg_8Xk2pQwLr0aVn3Zt",
"object": "email",
"status": "queued"
}Errors
| Status | Code | When |
|---|---|---|
| 400 | validation_error | The request body or parameters are invalid. The message says which field. |
| 404 | not_found | No such resource in this project. |
| 401 | unauthorized | The API key is missing, invalid or revoked. |
| 403 | forbidden | The key does not have the scope this endpoint needs. |
| 429 | rate_limited | Too many requests. Wait for the number of seconds in the Retry-After header. |
Every error has the same shape. See Errors.