Skip to main content

Message templates

Use this reference for exact request attributes, response envelopes, object shape, and examples. For customer-notification patterns and when to use templates with Chimes, start with the Chimes product guide.

Operations

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

  • Name
    about
    Type
    string
    Description

    Optional description of the template's purpose. Omitted when no description is set.

  • Name
    archived_at
    Type
    timestamp
    Description

    When the template was archived. Omitted for active templates. Archived templates cannot be updated, published, rendered, or used for new Chimes.

  • Name
    attachments
    Type
    array
    Description

    Up to 25 email attachment file IDs. Every entry must be nonempty and match file_ followed by alphanumeric characters. Attachments are accepted only for email templates. Previews return the attachment IDs, but Chime requests currently reject stored templates that contain attachments. Omitted when the template has no attachments.

  • Name
    channel
    Type
    enum
    Description

    Template channel: sms or email.

  • Name
    created_at
    Type
    timestamp
    Description

    When the template was created.

  • Name
    draft_version
    Type
    integer
    Description

    Current draft version. The first edit after publication advances this number; later edits replace that same draft until it is published.

  • emailobjectEmail template content. Present when channel is email.Click or tap to expand
    • Name
      from
      Type
      object
      View from detailsClick or tap to expand
      Optional sender mailbox template. Omitted when unset.
    • Name
      headers
      Type
      object
      View headers detailsClick or tap to expand
      Optional custom header templates. Delivery, routing, and authentication headers cannot be overridden.
    • Name
      html
      Type
      string
      Description
      HTML template body. Required for email templates.
    • Name
      reply_to
      Type
      object
      View reply_to detailsClick or tap to expand
      Optional reply-to mailbox template. Omitted when unset.
    • Name
      subject
      Type
      string
      Description
      Email subject template. Required for email templates.
  • Name
    has_unpublished_changes
    Type
    boolean
    Description

    true when the draft differs from the published version.

  • Name
    id
    Type
    string
    Description

    Generated template ID. The API assigns this value; clients must not provide id, template_id, or a custom key on create.

  • Name
    locale
    Type
    string
    Description

    Locale for the template. Defaults to en when omitted.

  • Name
    name
    Type
    string
    Description

    Human-readable template name.

  • Name
    published_at
    Type
    timestamp
    Description

    When the current published version was published. Omitted until the first publication.

  • Name
    published_version
    Type
    integer
    Description

    Version number currently used by Chime sends. Omitted until the template is published.

  • Name
    purpose
    Type
    string
    Description

    Template category, such as receipt, shipping_update, marketing, or reminder. The API trims and stores this value in lowercase.

  • smsobjectSMS template content. Present when channel is sms.Click or tap to expand
    • Name
      message_template
      Type
      string
      Description
      SMS body template. Required for SMS templates.
  • Name
    status
    Type
    enum
    Description

    Current lifecycle state: draft, published, or archived.

  • Name
    updated_at
    Type
    timestamp
    Description

    When the template was last changed.

  • variablesobjectVariable declarations available inside template content. Omitted when none are declared.Click or tap to expand
    • Name
      about
      Type
      string
      Description
      Optional description shown to operators.
    • Name
      default
      Type
      any
      Description
      Default value used when an optional variable is omitted.
    • Name
      items
      Type
      array
      Description
      Nested item fields for array variables. Nested arrays are not supported.
    • Name
      name
      Type
      string
      Description
      Variable name. Must start with a lowercase letter and contain lowercase letters, numbers, or underscores.
    • Name
      required
      Type
      boolean
      Description
      Whether callers must provide this variable when rendering.
    • Name
      type
      Type
      enum
      Description
      array, boolean, date, datetime, email, integer, number, phone, string, or url.
  • Name
    version
    Type
    integer
    Description

    Current template version number.

Template expressions use {{variable_name}} for values, {{#if variable}}...{{else}}...{{/if}} for conditional text, and {{#each items as item}}...{{/each}} for arrays.

Design templates that render safely

Every reference must match a declared variable. Rendering rejects unknown input fields, missing required values, invalid value types, and arrays with undeclared item fields. date values use YYYY-MM-DD; datetime values use RFC 3339; URL variables must be absolute HTTP or HTTPS URLs without embedded user credentials.

SMS output can contain at most 120 Unicode characters after variables are substituted. Email variables are escaped when inserted into HTML, while subjects, mailboxes, and custom header values reject line breaks and unsafe control characters. Email HTML accepts common message-layout elements but rejects scripts, event handlers, and unsafe link or image schemes. A preview succeeds only when the rendered email contains readable text and passes content safety checks.

Non-success responses return a top-level error object. Use its stable code and fix_code fields to decide whether to change the template, refresh its state, or wait before acting again; keep message and detail for humans.

POST/message_templates/create

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

  • Name
    about
    Type
    string
    Description

    Optional description shown alongside the template.

  • Name
    attachments
    Type
    array
    Description

    Up to 25 email attachment file IDs. Only allowed when channel is email. Every entry must be nonempty and match file_ followed by alphanumeric characters, such as file_ABC123.

  • Name
    channel
    Type
    enum
    Required
    required
    Description

    sms or email.

  • emailobjectClick or tap to expand

    Required when channel is email. Must include subject and html; may include from, reply_to, and headers.

  • Name
    locale
    Type
    string
    Description

    Optional locale. Defaults to en.

  • Name
    name
    Type
    string
    Required
    required
    Description

    Human-readable template name.

  • Name
    purpose
    Type
    string
    Required
    required
    Description

    Template category for filtering. The API trims and stores it in lowercase.

  • smsobjectClick or tap to expand

    Required when channel is sms. Must include message_template.

  • Name
    variables
    Type
    array
    Description

    Variable declarations used by the SMS body, email subject, HTML, sender, reply-to, and headers.

Response

Returns a top-level message_template object. Store message_template.id; it is the value Chime requests use as message_template.template_id.

Returns 200 when created, 400 for an invalid request or template, 401 when authorization fails, and 503 when the template could not be saved.

Request

POST/message_templates/create
curl https://api.inttegro.com/message_templates/create \
-H "Authorization: Bearer $INTTEGRO_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"
}
}
POST/message_templates/update

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

  • Name
    about
    Type
    string
    Description

    Optional replacement description.

  • Name
    attachments
    Type
    array
    Description

    Up to 25 replacement email attachment file IDs. Only allowed for email templates. Every entry must be nonempty and match file_ followed by alphanumeric characters, such as file_ABC123. Send an empty array to clear the attachments.

  • Name
    channel
    Type
    enum
    Description

    Optional channel assertion. Existing templates cannot move between sms and email; create a new template for a different channel.

  • emailobjectClick or tap to expand

    Complete replacement email content. When supplied, it must include both subject and html; nested email fields are not patched individually.

  • Name
    id
    Type
    string
    Required
    required
    Description

    Template ID to update.

  • Name
    locale
    Type
    string
    Description

    Replacement locale.

  • Name
    name
    Type
    string
    Description

    Replacement name.

  • Name
    purpose
    Type
    string
    Description

    Replacement purpose.

  • smsobjectClick or tap to expand

    Complete replacement SMS content. When supplied, it must include message_template.

  • Name
    variables
    Type
    array
    Description

    Replacement variable declarations. Send an empty array to remove every declaration.

Response

Returns the updated message_template with has_unpublished_changes: true. An empty about clears that field. Returns 200 when updated, 400 for an invalid request or template, 401 when authorization fails, 404 when the template does not exist, 409 when it is archived, and 503 when the changes could not be saved.

Request

POST/message_templates/update
curl https://api.inttegro.com/message_templates/update \
-H "Authorization: Bearer $INTTEGRO_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}}"
}
}'
POST/message_templates/publish

Publish a message template

Publish the current draft version. Chime sends, schedules, and broadcasts render only the published version.

Request body

  • Name
    id
    Type
    string
    Required
    required
    Description

    Template ID to publish.

Response

Returns the published message_template with status: "published" and has_unpublished_changes: false. Returns 200 when published, 400 for an invalid request, 401 when authorization fails, 404 when the template or draft version does not exist, 409 when it is archived, and 503 when publication could not be saved.

Request

POST/message_templates/publish
curl https://api.inttegro.com/message_templates/publish \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-publish-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
POST/message_templates/archive

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. Lookup and page requests continue to return the archived record; there is no unarchive operation.

Request body

  • Name
    id
    Type
    string
    Required
    required
    Description

    Template ID to archive.

Response

Returns the archived message_template. Returns 200 when archived, 400 for an invalid request, 401 when authorization fails, 404 when the template does not exist, and 503 when the archived state could not be saved.

Request

POST/message_templates/archive
curl https://api.inttegro.com/message_templates/archive \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Idempotency-Key: mtpl-archive-shipping-sms-001" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
POST/message_templates/lookup

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

  • Name
    id
    Type
    string
    Required
    required
    Description

    Template ID to retrieve.

Response

Returns the matching message_template. Returns 200 when found, 400 for an invalid request, 401 when authorization fails, and 404 when no template matches that ID.

Request

POST/message_templates/lookup
curl https://api.inttegro.com/message_templates/lookup \
-H "Authorization: Bearer $INTTEGRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU" }'
POST/message_templates/page

Page message templates

Retrieve a page of your templates, ordered by most recent update. Filter by channel, locale, purpose, or status when building an operator dashboard.

Request body

  • Name
    channel
    Type
    enum
    Description

    Filter by sms or email.

  • Name
    locale
    Type
    string
    Description

    Filter by locale.

  • Name
    page
    Type
    integer
    Description

    1-based page number. Defaults to 1 when omitted or nonpositive.

  • Name
    purpose
    Type
    string
    Description

    Filter by purpose.

  • Name
    size
    Type
    integer
    Description

    Requested page capacity. Defaults to 25 when omitted or nonpositive.

  • Name
    status
    Type
    enum
    Description

    Filter by draft, published, or archived.

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. Locale and purpose filters are applied to the selected page, so a response can contain fewer records than the requested capacity even when later records exist. Returns 200 for a page, 400 for an invalid request, 401 when authorization fails, and 404 when the page could not be loaded.

Request

POST/message_templates/page
curl https://api.inttegro.com/message_templates/page \
-H "Authorization: Bearer $INTTEGRO_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
}
]
}
}
POST/message_templates/render_preview

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

  • message_templateobjectRequired. Template reference and render variables.Click or tap to expand
    • Name
      template_id
      Type
      string
      Description
      Required. Template ID to render.
    • Name
      variables
      Type
      object
      View variables detailsClick or tap to expand
      Values for the declared template variables.

Response

Returns the template record plus rendered channel content. SMS previews return rendered.sms.full_message. Email previews return attachments, channel, and an email object containing the rendered from, headers, html, reply_to, safety, subject, and text fields when applicable. Optional fields are omitted rather than returned as null.

Returns 200 when rendered, 400 when the request, variables, rendered length, or rendered content is invalid, 401 when authorization fails, 404 when the template or selected version does not exist, and 409 when the template is archived.

Request

POST/message_templates/render_preview
curl https://api.inttegro.com/message_templates/render_preview \
-H "Authorization: Bearer $INTTEGRO_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"
}
}
}
  • 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.