By default, Twilio automatically handles a specific set of opt-in/opt-out related keywords, such as
HELP. For more details on the default behavior, including the full list of reserved keywords and standard replies, see Twilio support for opt-out keywords (SMS STOP filtering).
If you wish to customize these keywords or the responses that users receive, you can use Advanced Opt-Out for Messaging Services. Advanced Opt-Out enables you to customize the keywords and responses for opt-out, opt-in and help messages to your numbers.
How Advanced Opt-Out Works
The Advanced Opt-Out feature gives you the following options for each of your Messaging Services:
- Add additional keywords for opt-out, opt-in and help messages
- Customize your reply messages for keywords
- Remove most of the default keywords (except for STOP, HELP, and START)
- Add support for additional languages (e.g. keywords and replies in Spanish)
- Add country-specific overrides, if needed (e.g. a unique set of keywords for Mexico mobile users)
Once your Advanced Opt-Out options are set, these customized opt-out settings will automatically be used in response to any keyword messages received to the short code and long code numbers associated with the Messaging Service.
Twilio will automatically handle replies to the keywords you've configured, but we will still let you know when you receive a message containing these keywords. If you have configured your Messaging Service to send incoming messages to a webhook, Twilio will POST the opt-out, help, or opt-in messages to your webhook to help you track these events. These will arrive with an extra parameter
OptOutType, which will indicate whether the message is a STOP, HELP or START message. The incoming keyword messages will also appear in your SMS Logs in Twilio Console..
Please note, the replies you configure for Advanced Opt-Out will not appear in your Twilio SMS Logs. In addition, Advanced Opt-Out will still generate replies for configured keywords even if your Messaging Service is set to "Drop Incoming Messages." Twilio does not bill you for these outbound reply messages.
Notice: Advanced Opt-Out only changes the keyword handling for Twilio phone numbers in the Messaging Service on which it is configured. Advanced Opt-Out does not apply to WhatsApp senders. Twilio will continue automatically handling standard English-language replies for all opt-in/out keyword messages received on Toll-Free and Long Code phone numbers that are not a member of a Messaging Service. This default opt-out handling is not customizable. For more information on default opt-out responses, see Twilio support for opt-out keywords (SMS STOP filtering).
Set Up Advanced Opt-Out
If you are not yet using a Messaging Service to send and receive messages, you will first need to set one up. You can create a Messaging Service in the Twilio Console and add your Twilio numbers to it. Read more about Messaging Services here.
Once you have a Messaging Service, Advanced Opt-Out can be configured from the Twilio Console:
- Access the Messaging Services page in Console.
- Click the desired Messaging Service
- Click the Opt-Out Management tab in the left-hand side bar.
From here, you can edit the default keywords and responses, add new keywords, add additional languages, and more. For a full tutorial on setting up Advanced Opt-Out, please see Configuring Advanced Opt-Out Keywords (Twilio Docs).
Please note that keyword responses have a maximum length of 320 characters. We recommend keeping your responses as concise as possible for the best user experience.
HELP keywords can't be removed, as these are required for basic opt-out compliance. You can, however, remove all secondary keywords, such as
CANCEL for opt-outs and
YES for opt-in messages.
Advanced Opt-Out API
There is currently no API access for managing Advanced Opt-Out configurations. There are also no options for exporting and/or importing configurations. At this time, Advanced Opt-Out is only configurable via Console.