Create template
Save a reusable template. Reference it on /send-template or
/send-bulk by its template_name.
POST /api/v1/partner/email/templatesRequest body
{
"template_name": "welcome",
"subject": "Welcome to {{company_name}}, {{first_name}}",
"html": "<h1>Hi {{first_name}} 👋</h1><p>Thanks for joining {{company_name}}.</p>",
"text": "Hi {{first_name}}. Thanks for joining {{company_name}}.",
"declared_vars": ["first_name", "company_name"]
}| Field | Type | Required | Notes |
|---|---|---|---|
template_name | string | yes | Unique per partner. Lowercase letters / numbers / _ -, max 64 chars |
subject | string | yes | Variables can be used here too |
html | string | conditional | One of html or react_email_json is required |
text | string | no | Plaintext fallback. Auto-derived from HTML if omitted |
react_email_json | string | conditional | Visual-editor JSON. Renders to html + text server-side |
declared_vars | string[] | no | Variable names the template uses. Surfaced on the panel + helps catch typos |
Variable syntax
Both {{var_name}} and {{ var_name }} (with spaces) work.
Missing variables at send time stay as the literal {{name}} in
the rendered output rather than raising an error — this keeps
hot-path sends forgiving. To enforce required variables, declare
them in declared_vars and validate yourself before calling
/send-template.
Response
{
"success": true,
"template": {
"template_id": "tpl_550e8400-...",
"template_name": "welcome",
"subject": "Welcome to {{company_name}}, {{first_name}}",
"html": "<h1>Hi {{first_name}}...",
"text": "Hi {{first_name}}...",
"declared_vars": ["first_name", "company_name"],
"created_at": "...",
"updated_at": "..."
}
}cURL
curl https://apis.splashifypro.com/api/v1/partner/email/templates \
-H "Authorization: Bearer $SPLASHIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template_name": "welcome",
"subject": "Hi {{first_name}}",
"html": "<p>Hi {{first_name}}</p>"
}'Common errors
| Status | Code | Meaning |
|---|---|---|
| 409 | TEMPLATE_NAME_TAKEN | Another template with that name exists |
| 400 | INVALID_REQUEST | Bad name format or missing both html and react_email_json |
| 400 | TEMPLATE_LIMIT_REACHED | 500-template cap per account |