Skip to main content
Advanced Opt-In/Out lets you customize keyword triggers and auto-responses on your messaging profile. Configure country-specific responses, custom keywords, and track opt-out behavior via webhooks — all while maintaining CTIA & TCPA compliance.

Default behavior

Without custom configuration, Telnyx handles standard opt-in/out keywords automatically:
These keywords create a block rule preventing further messages to the recipient:
Block rules operate at the messaging profile level. If a user opts out from one number on your profile, they’re opted out from all numbers on that profile.
When you attempt to message a blocked recipient, the API returns:

Create custom auto-responses

Configure custom keyword responses for opt-in, opt-out, and help messages:

Operation types


Country-specific auto-responses

Configure different responses per country using ISO 3166-1 alpha-2 codes. This enables localized language support:
The feature is language agnostic — you can use keywords and responses in any language. The country_code field determines which auto-response applies based on the sender’s number origin.

AI opt-out detection

Keyword matching catches STOP and UNSUBSCRIBE — but real users also say “please stop texting me”, “take me off this list”, or “I don’t want these anymore”. AI opt-out detection adds an AI classification layer that catches these natural-language opt-outs and handles them exactly like a keyword opt-out. Enable it per messaging profile:

How it works

  1. The keyword check always runs first. A message matching your opt-out keywords (default or custom) is handled instantly by the keyword path — AI detection never touches it.
  2. Only non-keyword messages are classified. When no keyword matches, the message is sent to an AI classifier that returns an opt-out / not-opt-out verdict with a confidence score.
  3. Only high-confidence opt-out verdicts act. When the classifier detects opt-out intent with high confidence, Telnyx applies the same handling a literal STOP would get: the sender is blocked and your configured opt-out auto-response is sent (or the default, if you haven’t configured a custom one). Lower-confidence verdicts are ignored — the message delivers normally.
  4. Media-only and non-text messages skip classification. Messages without text can’t express an opt-out and are never classified.
AI-detected opt-outs respect your custom STOP configuration. If your auto-response configuration suppresses blocking for the applicable country or profile scope, an AI-detected opt-out doesn’t block either. There’s no separate configuration surface — the feature layers on top of your existing opt-out rules.

What it costs

AI opt-out detection is billed at $0.002 per classified message — only messages the AI classifier actually checks (i.e., inbound text messages on profiles with the feature enabled that match no opt-out keyword). There’s no charge for:
  • Messages handled by keyword matching (your opt-out keywords are always free)
  • Media-only or non-text messages
  • Messages on profiles with the feature disabled
  • Any message during a classifier outage (the feature fails open — messages deliver normally rather than being held for classification)

Disabling

Set ai_opt_out_detection_enabled to false to disable detection — omitting the field from a PATCH leaves the current value unchanged. Existing block rules created by AI-detected opt-outs remain in effect until removed — disabling detection stops new classification, it doesn’t unblock anyone.

Track opt-out behavior via webhooks

When a user sends an opt-in, opt-out, or help keyword, the inbound message webhook includes an autoresponse_type field:

Handle opt-out webhooks

The autoresponse_type field is also available in your SMS Logs via Detail Record Search reporting.

Limitations

START, STOP, and HELP are reserved keywords for their respective operations and cannot be reassigned to different operations. You can add additional keywords to each operation, but the defaults always remain active.
Default operations (start, stop, help) require a minimum 20 characters for the auto-response message. This ensures compliance with carrier requirements.
Each auto-response configuration supports a maximum of 20 trigger keywords.
Toll-free numbers have a separate carrier-level opt-out system that Telnyx cannot customize or remove. When a user texts STOP to a toll-free number:
  1. The carrier sends its own auto-reply:
NETWORK MSG: You replied with the word “stop” which blocks all texts sent from this number. Text back “unstop” to receive messages again.
  1. Your custom STOP response is also sent (if configured)
  2. The carrier block is applied independently of Telnyx’s block rule
When a user texts START or UNSTOP:
NETWORK MSG: You have replied “unstop” and will begin receiving messages again from this number.
You cannot prevent the carrier’s NETWORK MSG responses on toll-free numbers. Design your custom responses to complement (not contradict) these messages.
AI opt-out detection only acts on high-confidence opt-out verdicts. If the classifier is uncertain, the message delivers normally — the feature errs on the side of delivery. Suppressed low-confidence detections are not billed differently: any message the classifier checked is billed the same flat rate (see AI opt-out detection).
Block rules apply at the messaging profile level, not the individual number level. If a user opts out from any number on your profile, they’re blocked from all numbers on that profile.To manage separate opt-out lists for different programs, use separate messaging profiles.

Messaging Profiles

Configure the messaging profile that manages your opt-in/out rules.

Webhooks

Set up webhooks to receive opt-in/out events.

Short Codes

Short code keyword handling and carrier certification.

Toll-Free Verification

Toll-free number verification and compliance.