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.
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:
A new subscriber reply welcomes new subscribers.
Smart Replies answer a handful of self-service keywords.
The default reply acknowledges messages outside business hours.
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:
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:
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:
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:
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.
Webhook events with automated responses
Automated responses affect which webhook events you receive:
A
message-replyevent 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-sendevent is triggered for all outbound messages. This includes automated responses, just like messages sent throughPOST /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:
chatbot
A Chatbot
hooks
An automated hook, this includes Automated and Smart Replies
scheduled
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
Two-way conversational inbox — receive, store, and reply to conversations, including the
message-sendhandler.Receive and Reply to Messages — handling a single reply with your own webhook.
Webhooks — payload reference for
message-replyandmessage-send.
API References
Automated Replies, Smart Replies, and Chatbots — API references for each feature.
Sent Messages — full reference for
autoTriggered,source, andhideAutomatedReplies.
Last updated
Was this helpful?