A template is a reusable notification blueprint. It defines the message structure, links to one or more delivery channels, and declares variables for per-user personalization. Templates go through a status lifecycle before they can be used for sending.
What is the template status lifecycle?
Templates follow a three-stage lifecycle:
| Status | Description |
|---|
draft | Initial state. Can be edited freely. Cannot send. |
approved | Ready for delivery. Required before sending. |
archived | Retired. Cannot be used for new sends. |
draft → approved → archived
Only templates with approved status can be used in notifications and campaigns. Attempting to send with a draft or archived template returns an ERR_TEMPLATE_NOT_APPROVED error.
How are templates linked to channels?
When you create a template, you pass an array of channelIds. This creates a template-channel record for each linked channel. Each template-channel holds the per-channel content — the actual message body, subject line, or payload that gets delivered through that channel.
For example, a single “Order Confirmation” template might have:
- An in-app template-channel with a rich card layout
- A push template-channel with a short title and body
- An email template-channel with a subject line and HTML body
See Template Channels for managing per-channel content.
What is the variableSchema?
The variableSchema field declares the dynamic variables available in the template. Variables enable per-user personalization at send time. See Template Variables for the full guide.
What are category and config?
- category — An optional classification for organizing templates (e.g., “transactional”, “marketing”).
- config — A flexible JSON object for template-level settings.
Use the optional templateId field during creation to assign a custom identifier. If omitted, one is auto-generated.