API Reference · Templates

Create template

Create a reusable template. Templates are versioned — every send records the exact version used.

POST/v1/templates

Headers

Authorizationstringrequired
Your API key as a bearer token: Bearer rk_your_api_key. You can also use the X-Api-Key header.

Body parameters

namestringrequired
A name to identify the template.
subjectstringrequired
Subject line. Supports {{ variables }}.
htmlstringoptional
HTML body with variable placeholders.
textstringoptional
Plain-text body.

Request

curl -X POST https://api.raanse.com/v1/templates \
  -H "Authorization: Bearer rk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "welcome",
        "subject": "Welcome, {{ name }}",
        "html": "<h1>Hi {{ name }} 👋</h1>"
      }'

Response

201
{
  "success": true,
  "message": "Resource created",
  "statusCode": 201,
  "data": { "id": "01JABCDXYZ0000000000000000", "name": "welcome", "currentVersionId": "01JVER...", "createdAt": "2026-07-02T12:00:00Z" }
}