> For the complete documentation index, see [llms.txt](https://developers.mobile-text-alerts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.mobile-text-alerts.com/tutorials/message-sending/automated-message-replies.md).

# 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.

<table><thead><tr><th width="223">If the response depends on…</th><th width="127.5">Use</th><th>Example use case</th></tr></thead><tbody><tr><td>A fixed lifecycle moment: first contact, after hours</td><td><a href="#automated-replies">Automated Replies</a></td><td>A greeting message when a new subscriber enrolls, for example: <code>"Welcome to Acme Outdoor alerts! You'll get order updates and occasional offers. Reply HELP for help, STOP to opt out."</code></td></tr><tr><td>A known keyword with a fixed answer</td><td><a href="#smart-replies">Smart Replies</a></td><td>Use the keyword <code>HOURS</code> to automatically reply with business hours. For example, a customer texts <code>"HOURS"</code> and receives <code>"We're open Mon-Fri 9am-5pm ET and Sat 10am-2pm ET."</code></td></tr><tr><td>An open-ended question answerable from your documents</td><td><a href="#chatbots">Chatbots</a></td><td>An LLM-powered responder is used to answer questions about orders, shipping, and returns.</td></tr></tbody></table>

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](https://developers.mobile-text-alerts.com/use-cases/appointment-reminders-with-confirmation-replies.md).

{% hint style="warning" %}
**Avoid double replies**

Platform automations are not aware of webhook handler configurations. For example, if a chatbot is attached to a number and your handler also auto-responds on that number, the subscriber will receive two replies.

For each number decide which layer owns automated responses, and keep your handler's automatic replies off when platform automation is active.
{% endhint %}

### 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.&#x20;

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 [<mark style="color:violet;">`PATCH`</mark> /automated-replies/default-reply](https://developers.mobile-text-alerts.com/api-reference/automated-replies.md#patch-automated-replies-default-reply) endpoint with the following fields:

<table><thead><tr><th width="190">Field</th><th width="171">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>autoReply</code></td><td><code>boolean</code> <em>required</em></td><td><p><code>true</code> enables the auto-reply, <code>false</code> disables it. </p><p></p><p>If you only want to configure an <code>initialReply</code>, set this field to false.</p></td></tr><tr><td><code>autoReplyMessage</code></td><td><code>string</code></td><td>The text of the auto reply messages.</td></tr><tr><td><code>initialReply</code></td><td><code>boolean</code></td><td>When enabled an initial auto-reply message sends to individual subscribers the first time that they message you within a 24-hour time period.</td></tr><tr><td><code>initialReplyMessage</code></td><td><code>string</code></td><td>The text for initial reply messages.</td></tr><tr><td><code>autoReplyTimes</code></td><td><code>object</code></td><td><p>Your business hours, with a <code>startTime</code> and <code>endTime</code> for each day of the week (<code>monday</code> to <code>sunday</code>). </p><p></p><p>If set, this will override the configured times. </p><p></p><p>If excluded, the configured times will be removed.</p></td></tr><tr><td><code>templateId</code></td><td><code>number</code></td><td>The id of the message template to used instead of inline text.</td></tr></tbody></table>

**Code example:**

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

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X PATCH "https://api.mobile-text-alerts.com/v3/automated-replies/default-reply" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{
  "autoReply": true,
  "autoReplyMessage": "Thanks for texting Acme Outdoor! Our team is offline right now. We're available Mon-Fri 9am-5pm ET and will reply as soon as we're back.",
  "autoReplyTimes": {
    "monday":    { "startTime": "17:00", "endTime": "23:59" },
    "tuesday":   { "startTime": "17:00", "endTime": "23:59" },
    "wednesday": { "startTime": "17:00", "endTime": "23:59" },
    "thursday":  { "startTime": "17:00", "endTime": "23:59" },
    "friday":    { "startTime": "17:00", "endTime": "23:59" },
    "saturday":  { "startTime": "00:00", "endTime": "23:59" },
    "sunday":    { "startTime": "00:00", "endTime": "23:59" }
  }
}
EOF
```

{% endtab %}

{% tab title="Node" %}

```javascript
// The default reply is sent during weekday evenings and all day on weekends.
const weekdayEvening = { startTime: "17:00", endTime: "23:59" };
const allDay = { startTime: "00:00", endTime: "23:59" };

const response = await fetch(
  "https://api.mobile-text-alerts.com/v3/automated-replies/default-reply",
  {
    method: "PATCH",
    headers: {
      Authorization: `Bearer ${process.env.MTA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      autoReply: true,
      autoReplyMessage:
        "Thanks for texting Acme Outdoor! Our team is offline right now. " +
        "We're available Mon-Fri 9am-5pm ET and will reply as soon as we're back.",
      autoReplyTimes: {
        monday: weekdayEvening,
        tuesday: weekdayEvening,
        wednesday: weekdayEvening,
        thursday: weekdayEvening,
        friday: weekdayEvening,
        saturday: allDay,
        sunday: allDay,
      },
    }),
  }
);

const result = await response.json();
// result.success === true when the default reply was updated
```

{% endtab %}

{% tab title="Python" %}

```python
import os
import requests

# The default reply is sent during weekday evenings and all day on weekends.
weekday_evening = {"startTime": "17:00", "endTime": "23:59"}
all_day = {"startTime": "00:00", "endTime": "23:59"}

response = requests.patch(
    "https://api.mobile-text-alerts.com/v3/automated-replies/default-reply",
    headers={
        "Authorization": f"Bearer {os.environ['MTA_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "autoReply": True,
        "autoReplyMessage": (
            "Thanks for texting Acme Outdoor! Our team is offline right now. "
            "We're available Mon-Fri 9am-5pm ET and will reply as soon as we're back."
        ),
        "autoReplyTimes": {
            "monday": weekday_evening,
            "tuesday": weekday_evening,
            "wednesday": weekday_evening,
            "thursday": weekday_evening,
            "friday": weekday_evening,
            "saturday": all_day,
            "sunday": all_day,
        },
    },
)

result = response.json()
# result["success"] is True when the default reply was updated
```

{% endtab %}
{% endtabs %}

Use the [`GET /automated-replies/default-reply`](https://developers.mobile-text-alerts.com/api-reference/automated-replies.md#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`](https://developers.mobile-text-alerts.com/api-reference/automated-replies.md#patch-automated-replies-new-subscriber-reply) endpoint and the following fields:

<table><thead><tr><th width="223">Field</th><th width="159">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>newSubscriberMessage</code></td><td><code>string</code> <em>required</em></td><td>The text sent to a first-time message.</td></tr><tr><td><code>templateId</code></td><td><code>number</code></td><td>A message template to use instead of inline text.</td></tr></tbody></table>

**Code Example:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X PATCH "https://api.mobile-text-alerts.com/v3/automated-replies/new-subscriber-reply" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{
  "newSubscriberMessage": "Welcome to Acme Outdoor alerts! You'll get order updates and occasional offers. Reply HELP for help, STOP to opt out."
}
EOF
```

{% endtab %}

{% tab title="Node" %}

```javascript
await fetch("https://api.mobile-text-alerts.com/v3/automated-replies/new-subscriber-reply", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.MTA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    newSubscriberMessage:
      "Welcome to Acme Outdoor alerts! You'll get order updates and occasional offers. " +
      "Reply HELP for help, STOP to opt out.",
  }),
});
```

{% endtab %}

{% tab title="Python" %}

```python
requests.patch(
    "https://api.mobile-text-alerts.com/v3/automated-replies/new-subscriber-reply",
    headers={
        "Authorization": f"Bearer {os.environ['MTA_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "newSubscriberMessage": (
            "Welcome to Acme Outdoor alerts! You'll get order updates and occasional offers. "
            "Reply HELP for help, STOP to opt out."
        ),
    },
)
```

{% endtab %}
{% endtabs %}

Use the [`GET /automated-replies/new-subscriber-reply`](https://developers.mobile-text-alerts.com/api-reference/automated-replies.md#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`](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md#post-smart-replies) to create one, [`GET /smart-replies`](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md#get-smart-replies) to list them, and [`GET`](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md#get-smart-replies-id), [`PATCH`](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md#patch-smart-replies-id), or [`DELETE`](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md#delete-smart-replies-id) `/smart-replies/{id}` to read, change, or remove one.

**Relevant Fields:**

<table><thead><tr><th width="190">Field</th><th width="157.5">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>word</code></td><td><code>string</code> <em>required</em></td><td>The trigger word, for example <code>HOURS</code>.</td></tr><tr><td><code>message</code></td><td><code>string</code> <em>required</em></td><td>The response sent when a subscriber texts the trigger word.</td></tr><tr><td><code>templateId</code></td><td><code>number</code></td><td>A message template to use instead of inline text.</td></tr><tr><td><code>includeContactCard</code></td><td><code>boolean</code></td><td>Attach contact card to the response.</td></tr><tr><td><code>includeSignupLink</code></td><td><code>boolean</code></td><td>Include signup link in the response.</td></tr></tbody></table>

**Code Example:**

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

{% tabs %}
{% tab title="cURL" %}

```bash
# One request per Smart Reply
curl -X POST "https://api.mobile-text-alerts.com/v3/smart-replies" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{ "word": "HOURS", "message": "We're open Mon-Fri 9am-5pm ET and Sat 10am-2pm ET." }
EOF

curl -X POST "https://api.mobile-text-alerts.com/v3/smart-replies" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{ "word": "RETURNS", "message": "Start a return any time at https://example.com/returns." }
EOF

curl -X POST "https://api.mobile-text-alerts.com/v3/smart-replies" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{ "word": "CONTACT", "message": "Here's how to reach us.", "includeContactCard": true }
EOF
```

{% endtab %}

{% tab title="Node" %}

```javascript
const smartReplies = [
  { word: "HOURS", message: "We're open Mon-Fri 9am-5pm ET and Sat 10am-2pm ET." },
  { word: "RETURNS", message: "Start a return any time at https://example.com/returns." },
  { word: "CONTACT", message: "Here's how to reach us.", includeContactCard: true },
];

for (const smartReply of smartReplies) {
  await fetch("https://api.mobile-text-alerts.com/v3/smart-replies", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MTA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(smartReply),
  });
}
```

{% endtab %}

{% tab title="Python" %}

```python
smart_replies = [
    {"word": "HOURS", "message": "We're open Mon-Fri 9am-5pm ET and Sat 10am-2pm ET."},
    {"word": "RETURNS", "message": "Start a return any time at https://example.com/returns."},
    {"word": "CONTACT", "message": "Here's how to reach us.", "includeContactCard": True},
]

for smart_reply in smart_replies:
    requests.post(
        "https://api.mobile-text-alerts.com/v3/smart-replies",
        headers={
            "Authorization": f"Bearer {os.environ['MTA_API_KEY']}",
            "Content-Type": "application/json",
        },
        json=smart_reply,
    )
```

{% endtab %}
{% endtabs %}

### Chatbots

[Chatbots](https://developers.mobile-text-alerts.com/api-reference/chatbots.md) 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`](https://developers.mobile-text-alerts.com/api-reference/chatbots.md#post-chatbots) endpoint and the following fields:

<table><thead><tr><th width="160">Field</th><th width="162.5">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>string</code> <em>required</em></td><td>Required. A name for the chatbot.</td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>An internal description.</td></tr><tr><td><code>instructions</code></td><td><code>string</code> <em>required</em></td><td>Text context: how the chatbot should behave, what it should and shouldn't answer, and what to say when it can't help.</td></tr><tr><td><code>longcodeId</code></td><td><code>number</code> <em>required</em></td><td>The number the chatbot is attached to. Find your numbers' IDs with <a href="https://developers.mobile-text-alerts.com/api-reference/dedicated-numbers.md#get-dedicated-numbers"><code>GET /dedicated-numbers</code></a>.</td></tr><tr><td><code>files</code></td><td><code>string[]</code></td><td>This field contains the URL strings that point to hosted files that provide the LLMs context for responding. </td></tr><tr><td><code>isEnabled</code></td><td><code>boolean</code> <em>required</em></td><td>Whether the chatbot is turned on to respond to subscribers.</td></tr></tbody></table>

**Code Example:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "https://api.mobile-text-alerts.com/v3/chatbots" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'EOF'
{
  "name": "Support Assistant",
  "description": "First-line support for order and shipping questions",
  "instructions": "You are a friendly support assistant for Acme Outdoor. Answer questions about orders, shipping, and returns using the attached policies. Keep answers under 300 characters. If you cannot answer, tell the customer a team member will follow up.",
  "longcodeId": 1234,
  "isEnabled": true
}
EOF
```

{% endtab %}

{% tab title="Node" %}

```javascript
const response = await fetch("https://api.mobile-text-alerts.com/v3/chatbots", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MTA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Support Assistant",
    description: "First-line support for order and shipping questions",
    instructions:
      "You are a friendly support assistant for Acme Outdoor. Answer questions about " +
      "orders, shipping, and returns using the attached policies. Keep answers under " +
      "300 characters. If you cannot answer, tell the customer a team member will follow up.",
    longcodeId: 1234,
    isEnabled: true,
  }),
});

const { data } = await response.json();
// Store data.id to update or disable the chatbot later
```

{% endtab %}

{% tab title="Python" %}

```python
response = requests.post(
    "https://api.mobile-text-alerts.com/v3/chatbots",
    headers={
        "Authorization": f"Bearer {os.environ['MTA_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "name": "Support Assistant",
        "description": "First-line support for order and shipping questions",
        "instructions": (
            "You are a friendly support assistant for Acme Outdoor. Answer questions about "
            "orders, shipping, and returns using the attached policies. Keep answers under "
            "300 characters. If you cannot answer, tell the customer a team member will follow up."
        ),
        "longcodeId": 1234,
        "isEnabled": True,
    },
)

data = response.json()["data"]
# Store data["id"] to update or disable the chatbot later
```

{% endtab %}
{% endtabs %}

#### Edit a Chatbot

To change a chatbot's instructions or files, or to turn it off, use [`PATCH /chatbots/{chatbotId}`](https://developers.mobile-text-alerts.com/api-reference/chatbots.md#patch-chatbots-chatbotid). Use the [`GET /chatbots/{chatbotId}`](https://developers.mobile-text-alerts.com/api-reference/chatbots.md#get-chatbots-chatbotid) endpoint to return the chatbot's configuration, attached files, and `conversationCount`.

{% hint style="info" %}
**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.
{% endhint %}

## 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`.

```mermaid
sequenceDiagram
    participant Sub as Subscriber
    participant MTA as Mobile Text Alerts
    participant App as Your webhook

    Sub->>MTA: "HOURS"
    MTA->>App: message-reply (inbound)
    Note over MTA: Smart Reply matches "HOURS"
    MTA->>Sub: "We're open Mon-Fri 9am-5pm ET..."
    MTA->>App: message-send (automated outbound)
```

To learn more about the `message-send` payload and a handler that stores outbound messages, see [Track outbound messages with `message-send` webhook](https://developers.mobile-text-alerts.com/use-cases/two-way-conversational-inbox.md#track-outbound-messages-with-message-send-webhook) in the [Two-way conversational inbox](https://developers.mobile-text-alerts.com/use-cases/two-way-conversational-inbox.md) 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](https://developers.mobile-text-alerts.com/api-reference/sent-messages.md) 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:

<table data-search="false"><thead><tr><th width="190">Value</th><th>Message was sent by</th></tr></thead><tbody><tr><td><code>chatbot</code></td><td>A Chatbot</td></tr><tr><td><code>hooks</code></td><td>An automated hook, this includes Automated and Smart Replies</td></tr><tr><td><code>scheduled</code></td><td>A <a href="https://developers.mobile-text-alerts.com/api-reference/scheduled-messages.md">scheduled message</a></td></tr><tr><td><code>node-api</code></td><td>A call via the<a href="https://developers.mobile-text-alerts.com/api-reference/send.md#post-send"> <code>/send</code> API endpoint</a></td></tr></tbody></table>

See the [List Sent Messages API reference](https://developers.mobile-text-alerts.com/api-reference/sent-messages.md#get-sent-messages) for the full list of `source` values.

#### The `hideAutomatedReplies` parameter

The [`GET /sent-messages`](https://developers.mobile-text-alerts.com/api-reference/sent-messages.md#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.

{% tabs %}
{% tab title="cURL" %}

```bash
# Only what the chatbot sent to this subscriber
curl -G "https://api.mobile-text-alerts.com/v3/sent-messages" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  --data-urlencode "filters[recipientQuery]=3175551111" \
  --data-urlencode "filters[source]=chatbot"

# Outbound history without automated replies
curl -G "https://api.mobile-text-alerts.com/v3/sent-messages" \
  -H "Authorization: Bearer $MTA_API_KEY" \
  --data-urlencode "filters[recipientQuery]=3175551111" \
  --data-urlencode "hideAutomatedReplies=true"
```

{% endtab %}

{% tab title="Node" %}

```javascript
async function listSentMessages(params) {
  const qs = new URLSearchParams(params);
  const response = await fetch(`https://api.mobile-text-alerts.com/v3/sent-messages?${qs}`, {
    headers: { Authorization: `Bearer ${process.env.MTA_API_KEY}` },
  });
  const { data } = await response.json();
  return data.rows;
}

// Only what the chatbot sent to this subscriber
const chatbotMessages = await listSentMessages({
  "filters[recipientQuery]": "3175551111",
  "filters[source]": "chatbot",
});

// Outbound history without automated replies
const humanMessages = await listSentMessages({
  "filters[recipientQuery]": "3175551111",
  hideAutomatedReplies: "true",
});
```

{% endtab %}

{% tab title="Python" %}

```python
def list_sent_messages(params: dict) -> list:
    response = requests.get(
        "https://api.mobile-text-alerts.com/v3/sent-messages",
        headers={"Authorization": f"Bearer {os.environ['MTA_API_KEY']}"},
        params=params,
    )
    return response.json()["data"]["rows"]

# Only what the chatbot sent to this subscriber
chatbot_messages = list_sent_messages({
    "filters[recipientQuery]": "3175551111",
    "filters[source]": "chatbot",
})

# Outbound history without automated replies
human_messages = list_sent_messages({
    "filters[recipientQuery]": "3175551111",
    "hideAutomatedReplies": "true",
})
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### 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`.
{% endhint %}

### Learn more

* [Two-way conversational inbox](https://developers.mobile-text-alerts.com/use-cases/two-way-conversational-inbox.md) — receive, store, and reply to conversations, including the `message-send` handler.
* [Receive and Reply to Messages](https://developers.mobile-text-alerts.com/tutorials/message-sending/receive-and-reply-to-messages.md) — handling a single reply with your own webhook.
* [Webhooks](https://developers.mobile-text-alerts.com/tutorials/webhooks.md) — payload reference for `message-reply` and `message-send`.

#### API References

* [Automated Replies](https://developers.mobile-text-alerts.com/api-reference/automated-replies.md), [Smart Replies](https://developers.mobile-text-alerts.com/api-reference/smart-replies.md), and [Chatbots](https://developers.mobile-text-alerts.com/api-reference/chatbots.md) — API references for each feature.
* [Sent Messages](https://developers.mobile-text-alerts.com/api-reference/sent-messages.md) — full reference for `autoTriggered`, `source`, and `hideAutomatedReplies`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.mobile-text-alerts.com/tutorials/message-sending/automated-message-replies.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
