Reusable subjects and bodies with merge variables. The API merges your template_vars with sensible defaults; any placeholder without a value becomes an empty string.
Use double braces, e.g. {{user_name}} or {{otp_code}}. Only letters, numbers, and underscores are matched inside the braces. If you omit a variable in template_vars, it is replaced with nothing—so lines like "Hi {{user_name}}" become "Hi " unless you pass user_name or use {{email_local_part}} instead (derived from the recipient email in platform mail).
When you send with template_id, the server always starts from these defaults, then applies your template_vars on top (your keys override defaults).
year — current UTC year (e.g. 2026)app_name — product name from the API environmentlogo_url — defaults to {{FRONTEND_BASE_URL}}/piisend-logo.svg; override with BRAND_LOGO_URLsupport_url — defaults to {{FRONTEND_BASE_URL}}/faq; override with SUPPORT_URLuser_name, user_email, email_local_part, dashboard_url, unsubscribe_url — empty until you set them in template_varscurl -sS -X POST "https://api.piisend.com/api/v1/emails" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["user@example.com"],
"template_id": "YOUR_TEMPLATE_OBJECT_ID",
"template_vars": {
"user_name": "Alex",
"otp_code": "482193",
"user_email": "user@example.com"
}
}'Do not send subject, html, or text in the same request as template_id.
User-facing system templates (seeded in the database, usable by all projects) are marked is_system. Piisend-hosted signup and verification emails use separate admin-configured templates and merge fields such as verification_url, logo_url, and support_url. Your application emails always use template_id + template_vars on POST /api/v1/emails as shown above.
In the dashboard, create a template with subject, HTML body, and optional plain text. Save to obtain a template ID. List IDs via the API or the Templates screen.
Full REST details: API reference.
Documentation
Quickstart, API reference, and webhooks—everything you need to send from your app.