Flex Flow Resource
This guide is for Flex UI 1.x and channels that use Programmable Chat and Proxy. If you are using Flex UI 2.x or you are starting out, we recommend that you build with Flex Conversations.
A Flex Flow is the logic linking a contact identity (e.g. SMS-enabled phone number or WhatsApp number) to Flex.
This page details the Flex Flow API Resource. Check out the additional documentation to learn more about working with Flex Flows.
FlexFlow properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Flex Flow resource and owns this Workflow. |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
sid
|
The unique string that we created to identify the Flex Flow resource. |
friendly_name
|
The string that you assigned to describe the resource. |
chat_service_sid
|
The SID of the chat service. |
channel_type
|
The channel type. One of |
contact_identity
|
The channel contact's Identity. |
enabled
|
Whether the Flex Flow is enabled. |
integration_type
|
The software that will handle inbound messages. Integration Type can be: |
integration
|
An object that contains specific parameters for the integration. |
long_lived
|
When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to |
janitor_enabled
|
When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to |
url
|
The absolute URL of the Flex Flow resource. |
Create a FlexFlow resource
https://flex-api.twilio.com/v1/FlexFlows
Parameters
Parameters in REST API format | |
---|---|
friendly_name
Required
|
A descriptive string that you create to describe the Flex Flow resource. |
chat_service_sid
Required
|
The SID of the chat service. |
channel_type
Required
|
The channel type. One of |
contact_identity
Optional
|
The channel contact's Identity. |
enabled
Optional
|
Whether the new Flex Flow is enabled. |
integration_type
Optional
|
The software that will handle inbound messages. Integration Type can be: |
integration.flow_sid
Optional
|
The SID of the Studio Flow. Required when |
integration.url
Optional
|
The URL of the external webhook. Required when |
integration.workspace_sid
Optional
|
The Workspace SID for a new Task. Required when |
integration.workflow_sid
Optional
|
The Workflow SID for a new Task. Required when |
integration.channel
Optional
|
The Task Channel SID (TCXXXX) or unique name (e.g., |
integration.timeout
Optional
|
The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when |
integration.priority
Optional
|
The Task priority of a new Task. The default priority is 0. Optional when |
integration.creation_on_message
Optional
|
In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. |
long_lived
Optional
|
When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to |
janitor_enabled
Optional
|
When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to |
integration.retry_count
Optional
|
The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when |
Example 1
Example 2
The Studio Usage Guide is a helpful introduction to Studio Flows and the general idea of how Studio works. If you're looking for a simple way to power your Flex Flow, an underlying Studio Flow might be the right way to go!
When you receive an inbound message, the Flex Flow will make a POST
request containing the message body and some metadata to your chosen webhook.
Fetch a FlexFlow resource
https://flex-api.twilio.com/v1/FlexFlows/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Flex Flow resource to fetch. |
Example 1
Read multiple FlexFlow resources
https://flex-api.twilio.com/v1/FlexFlows
Parameters
Parameters in REST API format | |
---|---|
friendly_name
Optional
|
The |
Example 1
Update a FlexFlow resource
https://flex-api.twilio.com/v1/FlexFlows/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Flex Flow resource to update. |
friendly_name
Optional
|
A descriptive string that you create to describe the Flex Flow resource. |
chat_service_sid
Optional
|
The SID of the chat service. |
channel_type
Optional
|
The channel type. One of |
contact_identity
Optional
|
The channel contact's Identity. |
enabled
Optional
|
Whether the new Flex Flow is enabled. |
integration_type
Optional
|
The software that will handle inbound messages. Integration Type can be: |
integration.flow_sid
Optional
|
The SID of the Studio Flow. Required when |
integration.url
Optional
|
The URL of the external webhook. Required when |
integration.workspace_sid
Optional
|
The Workspace SID for a new Task. Required when |
integration.workflow_sid
Optional
|
The Workflow SID for a new Task. Required when |
integration.channel
Optional
|
The Task Channel SID (TCXXXX) or unique name (e.g., |
integration.timeout
Optional
|
The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when |
integration.priority
Optional
|
The Task priority of a new Task. The default priority is 0. Optional when |
integration.creation_on_message
Optional
|
In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. |
long_lived
Optional
|
When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to |
janitor_enabled
Optional
|
When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to |
integration.retry_count
Optional
|
The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when |
Example 1
Delete a Flex Flow
https://flex-api.twilio.com/v1/FlexFlows/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Flex Flow resource to delete. |
Example 1
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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.