Menu

Core Concepts: Chat and Messaging

Twilio Flex includes messaging capabilities that allow your contact center agents to chat with customers through:

  • A chat widget on your website
  • SMS
  • Digital messaging channels (like WhatsApp, Facebook Messenger, etc.)

Flex currently supports inbound messaging (initiated by a customer). You can initiate messaging conversations as they arrive or append incoming messages to existing conversations, depending on your Chat channel configuration.

Learn more about messaging in Flex.

Chat Channels

Flex stores and manages all messaging interactions in Chat Channels. Flex creates Chat Channels as private by default. Messages are sent, received, and archived for later viewing by offline clients in the Chat Channels.

By default, Flex ships with sms and web channels integrated with Studio. To enable additional messaging flows in Flex, you can programmatically create Chat Channels (such as Facebook or WhatsApp).

Flex Flows

A Flex Flow is the logic linking a messaging channel to Flex. It also describes how Flex should handle messages on a particular channel. You can configure a Flex Flow via the Twilio Console or via the REST API.

flex-messaging.png

To learn more about different integration types and managing messaging channels, see Managing Flex Flows.

To preserve a customer's message history between multiple interactions (even if the subsequent interactions are handled by different agents), you can set up long-lived channels.

Use the Channel Janitor to clean up inactive chat channels. This will ensure new messages from customers don’t get lost by being routed to inactive channels. Channel Janitor is now enabled for Flex Flows by default and we recommend you leave it on.

WebChat Widget


Flex WebChat is a chat widget that you can embed on your website. The widget helps your customers chat with an agent without having to leave your web site. It is natively integrated with Flex.

After deploying your Flex instance, you can test the chat widget that comes out of the box and is integrated with Studio by default (via the Webchat Flow). You can launch the demo chat widget from the Admin panel of the Flex UI and test your agents' default interaction experience.

phone-number-admin-panel

WebChat widget is fully customizable with code. Refer to the WebChat developer documentation for details.

Chatbots


A chatbot is an artificial intelligence (AI) bot that provides an entry point for a messaging interaction with your customers. You can use Autopilot to program a chat bot to answer questions about your products, services, or policies. If the chatbot is unable to fully solve the customer's request, it should be escalated to a human agent. Use a Studio Flow to stitch this process together, using the Autopilot widget for the chatbot and the Send to Flex widget for sending into Flex to be handled by an agent. For an implementation example, see How to hand-off messaging conversations from Autopilot to your Contact Center.

Chat Encryption


Twilio takes data security seriously. All customer assets—including text, media, and most metadata—are encrypted at rest. We also encrypt all data at the volume level.

Twilio's servers and Flex, including the customer WebChat widget, communicate using secure WebSockets. These connections are authenticated using the same JWT token security as the rest of Flex, meaning they are governed by the same Single Sign On (SSO).

For guidance on frequently asked questions, see Flex Messaging FAQ and Troubleshooting.

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more