Prompt
How do I handle SMS opt-outs automatically?
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
To handle SMS opt-outs automatically, the core idea is:
-
Detect an opt-out keyword
- Common keywords:
STOP,UNSUBSCRIBE,CANCEL,END,QUIT,STOPALL - Also often include language-specific equivalents if you text internationally.
- Common keywords:
-
Immediately suppress that phone number
- Mark the contact as do not message in your database/CRM.
- Do this in a centralized suppression list so all campaigns respect it.
-
Send the required confirmation
- Many jurisdictions and carriers expect an auto-reply like:
- “You’ve been unsubscribed. No more messages will be sent.”
- Don’t send marketing content after the opt-out.
- Many jurisdictions and carriers expect an auto-reply like:
-
Block future sends at send time
- Before any SMS goes out, check:
- opt-out status
- suppression list
- invalid/landline status if applicable
- This prevents race conditions where a queued message still sends.
- Before any SMS goes out, check:
-
Handle partial opt-outs if you offer multiple message types
- Example: a user may opt out of promotions but still want appointment reminders.
- If you do this, be very explicit and get clear consent per category.
- If they text
STOP, safest practice is to suppress all marketing SMS.
-
Log everything
- Store:
- incoming keyword
- timestamp
- source number
- confirmation sent
- user status changed
- This helps with compliance and dispute resolution.
- Store:
-
Use your SMS provider’s compliance tools
- Many providers support built-in keyword handling and suppression lists.
- Examples: Twilio, Vonage, Sinch, MessageBird, etc.
- If available, let the provider handle STOP/HELP/START keywords and sync status back to your system.
-
Provide re-opt-in instructions
- If a user opts out, tell them how to opt back in:
- “Reply START to re-subscribe.”
- Only resume messaging after a valid re-consent action.
- If a user opts out, tell them how to opt back in:
Simple implementation flow
- User texts
STOP - Webhook receives inbound SMS
- System normalizes text, matches opt-out keyword
- System updates contact to
unsubscribed - System adds number to suppression list
- System sends confirmation reply
- Outbound scheduler checks suppression list before sending any future messages
Important compliance note
Rules vary by country and message type, but in many places you must honor opt-out requests promptly and without requiring extra steps. If you’re sending SMS at scale, it’s worth reviewing TCPA/CTIA rules in the US or local telecom/privacy laws where your recipients are.
If you want, I can also give you:
- a database schema for opt-outs,
- a Twilio webhook example,
- or a language-agnostic pseudocode implementation.