Before you start
Flex admin access
Flex admin access
You need access to the and the parent Twilio Console to copy credentials and register webhooks.
Workspace and AI queue ready
Workspace and AI queue ready
Know the (starts with
WS) you want OpenCX to join. If you have a dedicated , have its SID handy too.A workflow you can edit
A workflow you can edit
You need edit access to the that routes your inbound tasks — you’ll add two filters to it before the setup is complete.
Save credentials in OpenCX
Open the Flex integration
Go to Settings → Integrations in your OpenCX dashboard and click Twilio Flex.
Paste credentials
Fill in the form:
| Field | Where to find it |
|---|---|
| Account SID | Twilio Console dashboard — starts with AC. |
| Auth Token | Twilio Console dashboard — account-level token. |
| Workspace SID | Flex Console → Configuration → Workspace — starts with WS. |
| AI Queue SID (optional) | Flex Console → TaskRouter → Queues — starts with WQ. Leave blank to skip queue filtering. |
OpenCX automatically provisions an in your workspace on save — you do not create this worker yourself. Its SID is persisted inside OpenCX so your workflow filter can target it.
Copy the webhook URL
The Webhook URL field at the top of the modal shows the URL OpenCX will accept events on. Copy it — you’ll paste it into Twilio twice.
Register the webhook on TaskRouter
In the Twilio Flex Console, open TaskRouter → Workspaces → [your workspace] → Event Callbacks. Paste the OpenCX webhook URL and subscribe to the following events:- TaskRouter events
Subscribe this URL to all of these events:
reservation.createdreservation.acceptedreservation.timeouttask.createdworkflow.target-matched
Register the webhook on the Conversations service
In the Twilio Console, open Conversations → Services → [your Flex Conversations service] → Webhooks. Paste the same OpenCX webhook URL and subscribe to:- Conversations filters
Subscribe this URL to all of these filters:
onMessageAddedonConversationAddedonParticipantAdded
Add the workflow filters
Open your TaskRouter workflow and add two filters, in this order:Route AI-skilled tasks to the OpenCX AI worker
Filter expression: match tasks routed to your . Target the queue the AI worker is assigned to. This is the filter that gets the AI a crack at the task first.
Verify end to end
Send a test message
Send a message on the channel you wired up (SMS, WhatsApp, web chat, voice call). OpenCX’s AI worker should accept the reservation and reply.
Check the task in Flex
Open TaskRouter → Tasks. The task should show the AI worker as the assigned worker, with
conversationSid present in the task attributes.Related Documentation
Handoff and task attributes
What OpenCX writes to every task on handoff.
Channels
Per-channel implementation on top of this shared setup.
Troubleshooting
Missing webhook, wrong queue, events routed to the wrong org.
Human handoff
Global handoff rules and office hours.