Skip to content
Splashify Pro
Email docsEmail

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

json
{
  "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"]
}

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

json
{
  "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

bash
curl https://api.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