This guide is for Flex UI 1.x.x and channels that use Programmable Chat and Proxy. If you are using Flex UI 2.x.x or you are starting out, we recommend that you build with Flex Conversations.
Flex Chat Channels allow agents to communicate with your customers across multiple channels like Webchat, SMS, and WhatsApp through a single chat interface. You can create a chat channel in Flex whenever you want to initiate a new communication flow between an agent and a customer. The Flex Chat Channel is an implementation of the Chat Channel Resource orchestrated for Flex.
The SID of the Account that created the Channel resource and owns this Workflow.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Flex Flow.
^FO[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Channel resource.
^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the chat user.
^US[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the TaskRouter Task. Only valid when integration type is task
. null
for integration types studio
& external
^WT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the Flex chat channel was created specified in ISO 8601 format.
POST https://flex-api.twilio.com/v1/Channels
application/x-www-form-urlencoded
The SID of the Flex Flow.
^FO[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The identity
value that uniquely identifies the new resource's chat User.
The SID of the TaskRouter Task. Only valid when integration type is task
. null
for integration types studio
& external
^WT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Whether to create the channel as long-lived.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createChannel() {11const channel = await client.flexApi.v1.channel.create({12chatFriendlyName: "ChatFriendlyName",13chatUserFriendlyName: "ChatUserFriendlyName",14flexFlowSid: "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15identity: "Identity",16});1718console.log(channel.accountSid);19}2021createChannel();
1{2"flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"date_created": "2016-08-01T22:10:40Z",8"date_updated": "2016-08-01T22:10:40Z",9"url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"10}
GET https://flex-api.twilio.com/v1/Channels/{Sid}
The SID of the Flex chat channel resource to fetch.
^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchChannel() {11const channel = await client.flexApi.v112.channel("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(channel.accountSid);16}1718fetchChannel();
1{2"flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"date_created": "2016-08-01T22:10:40Z",8"date_updated": "2016-08-01T22:10:40Z",9"url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"10}
GET https://flex-api.twilio.com/v1/Channels
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listChannel() {11const channels = await client.flexApi.v1.channel.list({ limit: 20 });1213channels.forEach((c) => console.log(c.accountSid));14}1516listChannel();
1{2"meta": {3"page": 0,4"page_size": 50,5"first_page_url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",6"previous_page_url": null,7"url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",8"next_page_url": null,9"key": "flex_chat_channels"10},11"flex_chat_channels": [12{13"flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",16"task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",17"user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"date_created": "2016-08-01T22:10:40Z",19"date_updated": "2016-08-01T22:10:40Z",20"url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"21}22]23}
DELETE https://flex-api.twilio.com/v1/Channels/{Sid}
The SID of the Flex chat channel resource to delete.
^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteChannel() {11await client.flexApi.v112.channel("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.remove();14}1516deleteChannel();