Skip to main content

SMS templates define reusable text messages that the agent can send during a conversation, such as confirmations, links, or verification codes.

Enterprise featureSMS templates require an enterprise Agent Studio account.
Templates support dynamic content through variables stored in conversation state.

Location

SMS templates are defined in:
Templates are listed under the sms_templates key.

What an SMS template contains

Each template can include the following fields:

Environment-specific sender numbers

If needed, you can define different sender numbers for different environments:

Example

How SMS templates are used

In rules, topics, and flows

Use {{twilio_sms:template_name}} to tell the agent which SMS should be sent.

In code

Call a function that triggers the SMS through conv or the platform API.

With variables

Use {{vrbl:...}} placeholders to insert values from conversation state.

In prompts and instructions

SMS templates can be referenced in rules, topics, and related instructions using:
This lets you reference the correct template by name without embedding the full message body in prompt text.

Using variables and translations

Template text can include placeholders drawn from conv.state, for example:
It can also reference a translation key, for example:
Before the SMS is sent, the corresponding state variables should already be set in code. For example:

Validation

  • Only {{vrbl:...}} and {{tn:...}} references are valid inside text — using any other reference type fails validation.
  • Each template name must be unique.

Best practices

  • set required state variables before the SMS is triggered
  • use separate templates for different purposes such as confirmation, verification, and follow-up
  • keep templates short and clear
  • configure env_phone_numbers when sender numbers differ between environments
  • prefer template references over hard-coded SMS text in prompts
Treat templates as reusable resourcesSMS templates are easier to manage when each template has one clear purpose and a stable name.

Variables

Learn how values are stored in conv.state and referenced with {{vrbl:...}}.

Functions

See how deterministic code can set variables and trigger SMS sending.

Translations

Reference a localized string from template text with {{tn:...}}.

SMS setup (platform)

Configuring SMS channels, sender numbers, opt-out handling, and full template options.

Conversation object reference (platform)

Full reference for conv.send_sms_template, conv.send_sms, and all other conv methods.
Last modified on November 27, 2026