Respond to inbound keywords

When people send you SMS messages, you can use automations to handle the incoming messages and trigger responses.

How it works

We treat inbound messages like events in Customer.io: they can trigger automations and add people to segments .

We handle inbound messages by looking for keywords. Think of it a bit like the menu you hear when you call somewhere that has an automated phone system: the phone system prompts the user to press an option on the keypad to advance to the next message.

Except in this case, rather than pressing the right button to advance in a menu, the user responds with a keyword from a list of supported keywords, and you send them down a path based on the keyword they used.

Set up an inbound message automation

  1. When you set up an automation, click the Trigger.
  2. Select the Event trigger option.
  3. Change they perform the event to they send an inbound SMS.

Don't use this process for reserved keywords

Words like STOP, START, UNSTOP, HELP, or INFO are processed by carriers and Customer.io’s built-in SMS compliance flows and won’t trigger your automations the way you expect. Rather than looking for reserved keywords like STOP or START, you should base your automation logic on the downstream effects of these keywords instead—like watching for changes to opt-in or opt-out status.

Inbound SMS automation trigger

The Inbound message event that triggers your automation doesn’t differentiate between replies to different phone numbers. If you want to handle inbound replies to your different sender numbers independently, you should add conditions to your trigger based on the to value. (Inbound messages come from your audience and to your SMS “sender” number.)

Inbound SMS automation trigger with a filter for a sender number

Using inbound message data

Like other event-triggered automations, inbound message variables start with event. For example, referencing the keyword variable would be {{event.keyword}}.

Most of these values come directly from the inbound message, but there are rules to the keyword variable.

JSON
{
    "body": "join",
    "from": "+15551234567",
    "in_reply_to": "01HA3K8Z9QF6N4XW2RBT5YVDPC",
    "keyword": "JOIN",
    "messaging_service_sid": "MG1c4d997a947f60dfaddf382a32dffc11",
    "origin_action_id": 41,
    "origin_campaign_id": 9,
    "sid": "SMec32f5db600322613b0c592d4d7417f1",
    "to": "+15559876543"
}
VariableDescription
bodyThe body of the inbound message
fromThe phone number of the person who sent the inbound message
in_reply_toThe ID of the delivery the person replied to, if we can attribute the reply to one. See Attributing replies to your messages
keywordThe keyword that the person used, if we can parse it from the body of the inbound message
messaging_service_sidThe Twilio messaging service SID that the inbound message came from
origin_campaign_id, origin_broadcast_id, origin_newsletter_id, origin_transactional_message_idThe ID of the automation, API-triggered broadcast, one-time send, or transactional message that started the conversation. A reply carries at most one of these, and none if we can’t attribute it to a message you sent. See Route replies to the right automation
origin_action_idThe ID of the SMS action in the automation or API-triggered broadcast that sent the message that started the conversation. Only present with origin_campaign_id or origin_broadcast_id
sidTwilio’s unique ID for the inbound message
toThe phone number that the inbound message was sent to, also the “sender” of the message the person replied to

Keywords

When we parse an inbound message, we normalize recognized terms into keyword values that you can use in automation conditions. This works if the inbound message contains a single keyword.

If an inbound message contains multiple words, the keyword variable will be empty. If this happens, you can respond with a message that tells the user to try again with one of the supported keywords.

flowchart LR B{"Does inbound message<br>contain multiple words?"} B-->|No|d{Does inbound message have<br> a recognized keyword?} d-->|Yes|e(Recognized keyword) d-.->|No|f(Custom keyword) B-..->|Yes|c(No keyword recognized)

We have a set of reserved keywords that carriers and Customer.io handle automatically. You can also set up automations to handle custom keywords, so you can respond to people when they use terms specific to your business.

Reserved keywords

Carriers and Customer.io handle these keywords automatically as a matter of compliance, no matter which provider you send through.

KeywordSupported termsDescription
STOPSTOP, CANCEL, UNSUBSCRIBE, OPTOUT, END, QUIT, REVOKE, STOPALLOpt-out keywords that unsubscribe the user from SMS messages
STARTSTART, UNSTOPOpt-in keywords that resubscribe the user to SMS messages
HELPHELP, INFOKeywords that trigger help or information responses

Because we process these keywords automatically outside of automation workflows, you shouldn’t use them as automation triggers or branch conditions because they might not trigger your automation (or other conditions) as expected.

If you want to listen for reserved keywords, you should base your automation logic on the downstream effects of these keywords instead—like changes to opt-in or opt-out status rather than the START or STOP keywords themselves.

See Opt-out keyword handling to understand how Customer.io handles SMS opt-outs.

Custom keywords

Beyond the default keywords above, you can also tell people to respond with custom keywords like JOIN, PROMO, SURVEY, or DETAILS. For example, if you want to run a survey, you could ask people to respond 1-5 to indicate satisfaction. If you want people to join a list, you could ask them to reply JOIN.

Route replies to the right automation

To start an automation when people reply to a particular message, you can filter the inbound message trigger on the message that started the conversation.

Filter by the message that started the conversation

In your inbound message trigger, choose which replies start the automation with the Replying to setting:

  • Anything: Every reply. This is the default.
  • Not a reply: Inbound messages that we can’t attribute to a message you sent, like a person texting your number unprompted.
  • An automation, broadcast, or other send: Search for and select the automation, API-triggered broadcast, one-time send, or transactional message that started the conversation. The trigger fires for every reply in a conversation that the send started, including replies to messages that later automations sent in that conversation.

Replying to adds trigger filters on the origin_* fields of the event. You can add these filters yourself as well. For example, filter on origin_campaign_id equals 9 to handle replies in conversations started from the automation with ID 9. You can also use these fields in your messages with liquid , like {{event.origin_campaign_id}}.

The origin of a reply

The origin is the automation, API-triggered broadcast, one-time send, or transactional message that started a conversation. An automation can send several messages, so the origin is the whole automation, not a single message in it. Each inbound event carries the origin as one origin_* ID field named for that kind, and none if we can’t attribute the reply to a message you sent. The ID in origin_broadcast_id is the ID of the API-triggered broadcast, the same ID you see in reporting webhooks and in messages from the App API.

The origin and in_reply_to differ. in_reply_to is the delivery the person replied to directly. The origin stays the same for the whole conversation, including when an inbound message triggers an automation that replies and the person responds again. In that case, in_reply_to is the automation’s reply, and the origin is still the automation, broadcast, or other send that started the conversation. An automation that a reply triggers doesn’t become the origin of its own messages, so selecting it in Replying to matches only conversations that it started itself.

Use separate senders to keep replies apart

We attribute a reply to the newest SMS message you sent from the number or messaging service the person replied to, within the last 72 hours. If two automations send to the same person from the same number, a reply goes to whichever message went out last. To keep replies to different automations apart, send them from different numbers or messaging services.

Example automation and best practices

In a custom keyword automation, use a multi-split branch to route people based on non-reserved keywords. For example, you might branch on JOIN, PROMO, SURVEY, or DETAILS, then add an “all others” branch for replies you don’t recognize.

Don’t branch on reserved keywords like STOP, START, UNSTOP, HELP, or INFO. For opt-out targeting, use SMS opt-out segments instead of automation branches.

Filter by sender number or outbound message

If you want to handle keywords differently based on the sender number, add a Filter on the to value to your automation trigger. To handle replies to a specific message, use Replying to as described in Route replies to the right automation.

Inbound SMS automation trigger with a filter for a sender number

Set up branches to handle different keywords

Set up branches for the custom keywords your message asks people to send. Add an “all others” branch to respond when the reply doesn’t match a supported keyword.

Inbound SMS automation branches

Remember not to branch on reserved keywords like STOP, START, UNSTOP, HELP, or INFO. See Reserved keywords for more information. For opt-out targeting, use SMS opt-out segments instead of listening for reserved keywords.

You cannot wait for subsequent messages in your automation

In your automation, you can’t wait for another inbound message or a follow-up event. You have to handle cascading inbound messages with subsequent automations.

You can still use the Wait Until action to wait for other conditions, but you cannot currently wait for a separate inbound message to continue through an automation.

When to limit send rates

If you want to send an SMS broadcast or one-time send, and you want to respond to inbound messages on the same “sender” number in Customer.io, you should throttle your broadcast so that your inbound-based responses aren’t delayed by messages queued from your broadcast.

Imagine you send a broadcast to 100,000 people. How fast a single phone number can send depends on the type of number and your trust score. Even at the highest rate of 225 messages per second, this broadcast takes around 444 seconds, or around 7 minutes, to send. If someone replies as soon as they receive your message, Customer.io adds your response to the end of the queue, so it waits until the rest of the broadcast finishes sending.

Throttling broadcasts and one-time sends ensures that your sender phone number can continue to send messages as it normally would, without being blocked by messages queued from your broadcast.

You can't limit automation send rates this way

When you start automations triggered by segments or attribute changes, you can let people who already meet your conditions enter the automation immediately. If you choose this option, you can’t limit the send rate from, or the number of people who enter, your automation. This could cause a queue of SMS messages that delays other automations or broadcasts that rely on the same sender numbers.

Updated November 13, 2026