Build an SMS Auto-Reply Bot With the Telnyx Messaging API_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Products_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Solutions_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Pricing_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Why Telnyx_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Resources_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream max-header-md:typography-h3-mobile">Developers<br>_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream">Contact us_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream">Log in<br>_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream">Contact us_[data-state='open'])_>_*:not([data-state='open'])_&]:text-gray-inactive header-md:[[data-state='open']_&]:dark:text-cream">Log inSign upOpen menu
Back to blog&]:translate-x-xxs ml-xxs [.link-rtl>&]:order-[-1] [.link-rtl>&]:ml-[0] [.link-rtl>&]:mr-xxs [.link-rtl:hover>&]:-translate-x-xxs"><br>Messaging<br>Build an SMS Auto-Reply Bot With the Telnyx Messaging API
Build an SMS auto-reply bot that responds instantly to inbound messages. Keyword routing, business-hours logic, and webhook signature verification with the Telnyx Messaging API.
By Harpreet Singh Seehra
svg]:w-full [&>svg]:h-full">svg]:w-full [&>svg]:h-full">svg]:w-full [&>svg]:h-full"><br>div:first-child_p:first-child]:mt-[0px] [&>div:first-child_h2:first-child]:mt-[0px] [&_p:first-of-type]:mt-[0px] sm:col-span-8 md:col-[5/13]">An SMS auto-reply bot is a webhook-driven service that receives an inbound text, chooses a response, and sends an SMS reply without human action. With the Telnyx Messaging API, Telnyx sends your app a message.received webhook, then your app replies through POST /v2/messages. The span]:typography-paragraph md:[&>span]:typography-paragraph-md" href="https://telnyx.com/products/sms-api" style="color:#00C894;text-decoration:none;border-bottom:1px solid rgba(0,227,170,0.3)">SMS API supports global messaging with 10DLC, toll-free, shortcodes, and high throughput, so one bot can handle after-hours, pricing, and support replies.<br>Use an SMS autoresponder when customers text outside office hours, ask for support, or need a routing answer. The bot can return a text message auto reply, route “hours” to a schedule, route “pricing” to sales, and send “help” to a support path. The logic runs in your app, so rules can match your queue, time zone, and consent process.<br>What an SMS auto-reply bot does<br>An SMS autoresponder listens for incoming text messages and sends back a pre-defined reply based on the content of the message. Telnyx receives the text on your number and sends your application an SMS webhook. Your application inspects the payload, selects the right response, and sends the reply back through the API.<br>The routing layer has two main jobs. Keyword routing maps words like “help,” “hours,” or “pricing” to specific responses. Business-hours logic changes the reply based on whether your team is available. During the day, the reply can point to a live support path. At night, it can set a clear response window.<br>Note: Treat STOP and START as explicit routes. Store opt-out state in your system and check it before any promotional reply. This is implementation guidance, not legal advice.<br>How an SMS auto-reply bot works<br>An inbound SMS automation flow has three steps.<br>A customer sends an SMS to your Telnyx number. Telnyx receives the message and forwards it to your application as a message.received webhook event. The payload includes the sender’s phone number, your Telnyx number, and the message text.<br>Your application generates a response. Your webhook handler parses the incoming message, checks it against keyword rules and business-hours logic, and selects the reply.<br>Your application sends the reply via the Telnyx API. Your app calls POST /v2/messages with the sender’s number as the destination, your Telnyx number as the sender, and the generated response as the message body.<br>No polling. No message queues. One webhook in, one API call out.<br>SMS auto-reply bot flow<br>Inbound SMS
message.received
Ed25519 check
Keyword rules
Business hours
POST /v2/messages
SMS reply
Autoresponder choices<br>There are three common...