Xurel Docs

Templates

Store reusable HTML templates and reference them from sends with templateId + variables.

Create template

POST /v1/templates
Field Type Required Description
name string Required Template name.
subject string Required Default subject (supports variables).
html string Required HTML body with {{variable}} placeholders.
text string Optional Plain-text variant.
201
{
  "id": "tpl_welcome",
  "name": "Welcome",
  "subject": "Welcome, {{firstName}}",
  "createdAt": "2026-07-01T00:00:00Z"
}

List, get, update, delete

GET /v1/templates
GET /v1/templates/{id}
PATCH /v1/templates/{id}
DELETE /v1/templates/{id}

Using templates

POST /emails
{
  "from": "hello@yourdomain.com",
  "to": ["user@example.com"],
  "templateId": "tpl_welcome",
  "variables": { "firstName": "Ayu" },
  "type": "transactional"
}

Also see React Email for component-driven templates.