For the complete documentation index, see llms.txt. This page is also available as Markdown.

Automated Message Replies

Learn how to automatically respond to inbound messages with Automated Replies, Smart Replies and Chatbots.

Mobile Text Alerts has multiple built-in features for responding to subscribers automatically:

  • Automated Replies — these can be configured for two use cases:

    • A default reply that acts as an auto-responder.

    • A new subscriber reply that greets the first message sent from a new subscriber.

  • Smart Replies — this is an open-ended keyword system. Define any number of trigger words, each with its own automated response.

  • Chatbots — this is an LLM-powered responder configured with text and document context.

All three can be configured from the platform dashboard or the API. This tutorial covers each feature configuration through the API.

Automated Reply Types

Choose the automatic response type

Each feature fits a different kind of response. Anything that depends on data only your system has belongs in your own webhook handler.

If the response depends on…
Use
Example use case

A fixed lifecycle moment: first contact, after hours

A greeting message when a new subscriber enrolls, for example: "Welcome to Acme Outdoor alerts! You'll get order updates and occasional offers. Reply HELP for help, STOP to opt out."

A known keyword with a fixed answer

Use the keyword HOURS to automatically reply with business hours. For example, a customer texts "HOURS" and receives "We're open Mon-Fri 9am-5pm ET and Sat 10am-2pm ET."

An open-ended question answerable from your documents

An LLM-powered responder is used to answer questions about orders, shipping, and returns.

These automated responses can function in combination with replies sent via the message-reply webhook and POST /send. An example automated response layer could include:

  1. A new subscriber reply welcomes new subscribers.

  2. Smart Replies answer a handful of self-service keywords.

  3. The default reply acknowledges messages outside business hours.

  4. Your webhook handler routes everything else to an agent queue, or answers from your own data.

For an example of handling replies against your own data, see Appointment Reminders with Confirmation Replies.

Automated Replies

Automated Replies cover two specific, fixed moments in a subscriber's lifecycle. Each has one setting on your account, retrieved with a GET and changed with a PATCH.

Configure default reply

The default reply is an auto-responder. When enabled, inbound messages get an automatic response, such as an acknowledgment or an after-hours notice.

There are two types of replies that can be configured: autoReply and initialReply. The autoReply is the default message that is automatically sent when enabled, while initialReply is an auto-reply message only sends to individual subscribers the first time that they message you within a 24-hour time period.

This is configured with the PATCH /automated-replies/default-reply endpoint with the following fields:

Field
Type
Description

autoReply

boolean required

true enables the auto-reply, false disables it.

If you only want to configure an initialReply, set this field to false.

autoReplyMessage

string

The text of the auto reply messages.

initialReply

boolean

When enabled an initial auto-reply message sends to individual subscribers the first time that they message you within a 24-hour time period.

initialReplyMessage

string

The text for initial reply messages.

autoReplyTimes

object

Your business hours, with a startTime and endTime for each day of the week (monday to sunday).

If set, this will override the configured times.

If excluded, the configured times will be removed.

templateId

number

The id of the message template to used instead of inline text.

Code example:

The following example sets an evening-only reply and an after-hours message:

Use the GET /automated-replies/default-reply endpoint to return the current configuration. The response also includes autoReplyDuringHours and autoReplyAfterHours fields which indicate whether the default reply is sent inside or outside the hours in autoReplyTimes.

Configure new subscriber reply

The new subscriber reply is sent when a subscriber texts in for the first time. It is typically used for a welcome message and opt-in confirmation. Configure it with the PATCH /automated-replies/new-subscriber-reply endpoint and the following fields:

Field
Type
Description

newSubscriberMessage

string required

The text sent to a first-time message.

templateId

number

A message template to use instead of inline text.

Code Example:

Use the GET /automated-replies/new-subscriber-reply endpoint to return the current configuration.

Smart Replies

Smart Replies are an assigned keyword system. Unlike Automated Replies, which are limited to two fixed behaviors, you can define any number of Smart Replies. Each one maps a trigger word to the response sent when a subscriber texts it.

Smart Replies are deterministic: the same trigger word always produces the same response. This makes them a good fit for self-service answers such as hours, addresses and links.

Configure a Smart Reply

Manage Smart Replies with the full set of endpoints: POST /smart-replies to create one, GET /smart-replies to list them, and GET, PATCH, or DELETE /smart-replies/{id} to read, change, or remove one.

Relevant Fields:

Field
Type
Description

word

string required

The trigger word, for example HOURS.

message

string required

The response sent when a subscriber texts the trigger word.

templateId

number

A message template to use instead of inline text.

includeContactCard

boolean

Attach contact card to the response.

includeSignupLink

boolean

Include signup link in the response.

Code Example:

The following example configures three trigger words: HOURS, RETURNS and CONTACT.

Chatbots

Chatbots are LLM-powered response engines. Rather than matching a fixed word, a chatbot reads what the subscriber wrote and generates a response from the given context. Each chatbot is attached to one of your numbers and responds directly to subscribers who text that number.

Create a Chatbot

Create a chatbot with the POST /chatbots endpoint and the following fields:

Field
Type
Description

name

string required

Required. A name for the chatbot.

description

string

An internal description.

instructions

string required

Text context: how the chatbot should behave, what it should and shouldn't answer, and what to say when it can't help.

longcodeId

number required

The number the chatbot is attached to. Find your numbers' IDs with GET /dedicated-numbers.

files

string[]

This field contains the URL strings that point to hosted files that provide the LLMs context for responding.

isEnabled

boolean required

Whether the chatbot is turned on to respond to subscribers.

Code Example:

Edit a Chatbot

To change a chatbot's instructions or files, or to turn it off, use PATCH /chatbots/{chatbotId}. Use the GET /chatbots/{chatbotId} endpoint to return the chatbot's configuration, attached files, and conversationCount.

Message Length

Chatbot responses are sent as text messages, so length can affect cost: messages over 160 characters cost more than one credit. Instruct the chatbot to keep answers short.

Webhook events with automated responses

Automated responses affect which webhook events you receive:

  • A message-reply event is triggered on inbound messages only. This is a notification that a subscriber sent a reply but does not indicate whether an automation answered this reply.

  • A message-send event is triggered for all outbound messages. This includes automated responses, just like messages sent through POST /send.

To learn more about the message-send payload and a handler that stores outbound messages, see Track outbound messages with message-send webhook in the Two-way conversational inbox guide.

Distinguish automated from human messages

When viewing message history, you may need to distinguish agent-sent messages from automated messages. The Sent Messages API provides three ways to do this:

autoTriggered field

Each row returned by GET /sent-messages includes autoTriggered, which is set when the message was triggered automatically rather than sent directly, for example by an Automated Reply or Smart Reply.

source field and filter

Each sent message also includes a source, which identifies what originated the send. Filter on it with filters[source]. Values include:

Value
Message was sent by

chatbot

A Chatbot

hooks

An automated hook, this includes Automated and Smart Replies

node-api

A call via the /send API endpoint

See the List Sent Messages API reference for the full list of source values.

The hideAutomatedReplies parameter

The GET /sent-messages endpoint uses the hideAutomatedReplies=true parameter to exclude automated replies from the results.

Examples

The first query returns only what a Chatbot sent to a subscriber. The second returns the subscriber's outbound history without automated replies.

Classify message source

The message-send webhook payload does not include autoTriggered or source. If storing messages from webhooks, you can classify message source by looking them up with GET /sent-messages.

Learn more

API References

Last updated

Was this helpful?