Message Templates
Message Templates are reusable SMS and email content records for Chimes. Use them when customer communication needs draft review, publishing, variable validation, and channel safety checks before delivery. Chime sends, schedules, and broadcasts render the published version; render previews can inspect the current draft before you publish it.
The Message Template object
A Message Template stores one channel of content. SMS templates use sms.message_template; email templates use email.subject and email.html. Do not mix SMS and email content in the same template.
Properties
Template expressions use {{variable_name}} for values, {{#if variable}}...{{else}}...{{/if}} for conditional text, and {{#each items as item}}...{{/each}} for arrays. Values are validated and escaped for the target channel during rendering. URL variables must render to HTTP or HTTPS URLs.
Create a message template
Create a reusable SMS or email template. The new template starts as draft; publish it before using it in Chime sends, schedules, or broadcasts.
Request body
Response
Returns a top-level message_template object. Store message_template.id; it is the value Chime requests use as message_template.template_id.
Request
curl https://api.zebo.dev/message_templates/create \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Idempotency-Key: mtpl-create-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"variables": [
{ "name": "customer_name", "type": "string", "required": true },
{ "name": "tracking_url", "type": "url", "required": true }
],
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}"
}
}'
Response
{
"message_template": {
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"locale": "en",
"status": "draft",
"version": 1,
"draft_version": 1,
"has_unpublished_changes": true,
"variables": [
{ "name": "customer_name", "type": "string", "required": true },
{ "name": "tracking_url", "type": "url", "required": true }
],
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track it: {{tracking_url}}"
},
"created_at": "2026-06-22T10:30:00Z",
"updated_at": "2026-06-22T10:30:00Z"
}
}
Update a message template
Update mutable fields by replacing the current draft. The first edit after publication advances the draft version; later edits keep that same draft version until it is published. The published version remains stable until you publish the draft.
Request body
Response
Returns the updated message_template with has_unpublished_changes: true.
Request
curl https://api.zebo.dev/message_templates/update \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Idempotency-Key: mtpl-update-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"sms": {
"message_template": "Hi {{customer_name}}, your order shipped. Track: {{tracking_url}}"
}
}'
Publish a message template
Publish the current draft version. Chime sends, schedules, and broadcasts render only the published version.
Request body
Response
Returns the published message_template with status: "published" and has_unpublished_changes: false.
Request
curl https://api.zebo.dev/message_templates/publish \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Idempotency-Key: mtpl-publish-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
Archive a message template
Archive a template so it cannot be updated, published, rendered, or used for new Chime sends. Archiving preserves the historical record and existing Chimes.
Request body
Response
Returns the archived message_template.
Request
curl https://api.zebo.dev/message_templates/archive \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Idempotency-Key: mtpl-archive-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
Look up a message template
Retrieve one template by ID. Use lookup before editing, publishing, or showing a template detail view in your dashboard.
Request body
Response
Returns the matching message_template.
Request
curl https://api.zebo.dev/message_templates/lookup \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
Page message templates
Retrieve a page of templates for the authenticated application. Filter by channel, locale, purpose, or status when you are building an operator dashboard.
Request body
Response
Returns a top-level page object. number is the page number, message_templates contains the returned records, and response size is the number of records actually returned rather than the requested capacity.
Request
curl https://api.zebo.dev/message_templates/page \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "page": 1, "size": 25, "channel": "sms", "status": "published" }'
Response
{
"page": {
"number": 1,
"size": 1,
"message_templates": [
{
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"purpose": "shipping_update",
"locale": "en",
"status": "published",
"version": 1,
"published_version": 1,
"draft_version": 1,
"has_unpublished_changes": false
}
]
}
}
Render a message template preview
Render a template with variables before sending. Preview rendering is draft-aware, so operators can check unpublished changes before publishing. Chime send, schedule, and broadcast requests still require a published version.
Request body
Response
Returns the template record plus rendered channel content. SMS previews return rendered.sms.full_message; email previews return rendered email fields.
Request
curl https://api.zebo.dev/message_templates/render_preview \
-H "Authorization: Bearer $COMMERCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message_template": {
"template_id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"variables": {
"customer_name": "Gloria",
"tracking_url": "https://track.example.com/OR-12345"
}
}
}'
Response
{
"message_template": {
"id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
"name": "Shipping update SMS",
"channel": "sms",
"status": "published",
"published_version": 1,
"draft_version": 1
},
"rendered": {
"channel": "sms",
"sms": {
"full_message": "Hi Gloria, your order shipped. Track it: https://track.example.com/OR-12345"
}
}
}
Related resources
- Send Chime - Send one notification with an inline or stored template.
- Schedule Chime - Schedule notifications with stored template rendering.
- Broadcast Chimes - Send one rendered template to a same-channel audience.