Flex Chat Channel Resource
Info
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.
Property nameTypePIIDescription
The SID of the Account that created the Channel resource and owns this Workflow.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Flex Flow.
Pattern: ^FO[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the Channel resource.
Pattern: ^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the chat user.
Pattern: ^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
Pattern: ^WT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The absolute URL of the Flex chat channel resource.
date_createdstring<date-time>
date_updatedstring<date-time>
POST https://flex.twilio.com/v1/Channels
Property nameTypeRequiredPIIDescription
FlexFlowSidSID<FO>required The SID of the Flex Flow.
Pattern: ^FO[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The identity
value that uniquely identifies the new resource's chat User.
ChatUserFriendlyNamestringrequired The chat participant's friendly name.
ChatFriendlyNamestringrequired The chat channel's friendly name.
The Target Contact Identity, for example the phone number of an SMS.
ChatUniqueNamestringOptional The chat channel's unique name.
PreEngagementDatastringOptional
The SID of the TaskRouter Task. Only valid when integration type is task
. null
for integration types studio
& external
Pattern: ^WT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
TaskAttributesstringOptional The Task attributes to be added for the TaskRouter Task.
Whether to create the channel as long-lived.
_21// Download the helper library from https://www.twilio.com/docs/node/install
_21const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21// Find your Account SID and Auth Token at twilio.com/console
_21// and set the environment variables. See http://twil.io/secure
_21const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21const authToken = process.env.TWILIO_AUTH_TOKEN;
_21const client = twilio(accountSid, authToken);
_21async function createChannel() {
_21 const channel = await client.flexApi.v1.channel.create({
_21 chatFriendlyName: "ChatFriendlyName",
_21 chatUserFriendlyName: "ChatUserFriendlyName",
_21 flexFlowSid: "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_21 identity: "Identity",
_21 console.log(channel.accountSid);
_10 "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "date_created": "2016-08-01T22:10:40Z",
_10 "date_updated": "2016-08-01T22:10:40Z",
_10 "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://flex.twilio.com/v1/Channels/{Sid}
Property nameTypeRequiredPIIDescription
The SID of the Flex chat channel resource to fetch.
Pattern: ^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function fetchChannel() {
_18 const channel = await client.flexApi.v1
_18 .channel("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 console.log(channel.accountSid);
_10 "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10 "date_created": "2016-08-01T22:10:40Z",
_10 "date_updated": "2016-08-01T22:10:40Z",
_10 "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://flex.twilio.com/v1/Channels
Property nameTypeRequiredPIIDescription
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_16// Download the helper library from https://www.twilio.com/docs/node/install
_16const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16// Find your Account SID and Auth Token at twilio.com/console
_16// and set the environment variables. See http://twil.io/secure
_16const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16const authToken = process.env.TWILIO_AUTH_TOKEN;
_16const client = twilio(accountSid, authToken);
_16async function listChannel() {
_16 const channels = await client.flexApi.v1.channel.list({ limit: 20 });
_16 channels.forEach((c) => console.log(c.accountSid));
_23 "first_page_url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
_23 "previous_page_url": null,
_23 "url": "https://flex-api.twilio.com/v1/Channels?PageSize=50&Page=0",
_23 "next_page_url": null,
_23 "key": "flex_chat_channels"
_23 "flex_chat_channels": [
_23 "flex_flow_sid": "FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_23 "date_created": "2016-08-01T22:10:40Z",
_23 "date_updated": "2016-08-01T22:10:40Z",
_23 "url": "https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
DELETE https://flex.twilio.com/v1/Channels/{Sid}
Property nameTypeRequiredPIIDescription
The SID of the Flex chat channel resource to delete.
Pattern: ^CH[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_16// Download the helper library from https://www.twilio.com/docs/node/install
_16const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16// Find your Account SID and Auth Token at twilio.com/console
_16// and set the environment variables. See http://twil.io/secure
_16const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16const authToken = process.env.TWILIO_AUTH_TOKEN;
_16const client = twilio(accountSid, authToken);
_16async function deleteChannel() {
_16 await client.flexApi.v1
_16 .channel("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")