Skip to Content
API ReferenceTemplatesCreate template

Create template

Save a reusable template. Reference it on /send-template or /send-bulk by its template_name.

POST /api/v1/partner/email/templates

Request 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"] }
FieldTypeRequiredNotes
template_namestringyesUnique per partner. Lowercase letters / numbers / _ -, max 64 chars
subjectstringyesVariables can be used here too
htmlstringconditionalOne of html or react_email_json is required
textstringnoPlaintext fallback. Auto-derived from HTML if omitted
react_email_jsonstringconditionalVisual-editor JSON. Renders to html + text server-side
declared_varsstring[]noVariable 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

StatusCodeMeaning
409TEMPLATE_NAME_TAKENAnother template with that name exists
400INVALID_REQUESTBad name format or missing both html and react_email_json
400TEMPLATE_LIMIT_REACHED500-template cap per account