> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Chat in Twilio Flex

> Route AI Chat Widget conversations into Flex tasks so reps pick up live chats in the Flex UI with full AI context.

Web chat conversations from the AI Chat Widget route through the <Tooltip tip="The Twilio messaging service that backs every Flex channel. Chat messages land here before TaskRouter picks up which worker sees the task.">Flex Conversations service</Tooltip>. When the AI hands off, your rep picks it up as a live messaging task in Flex — no ticket, no context lost.

## Pre-requisites

<Warning>
  **Install the AI Chat Widget on your site first.** Flex has nothing to route until the widget is live — start with [Install Widget](/widget/install-widget) and come back here.
</Warning>

* **Widget installed and reachable** — see [Install Widget](/widget/install-widget).
* **Twilio Flex credentials saved** — see [Connect Twilio Flex](/integrations/twilio-flex/connect).
* **Both webhooks registered** (TaskRouter + Conversations service).

## How conversations land in Flex

```mermaid theme={"dark"}
flowchart LR
  A[Visitor opens widget] --> B[AI answers]
  B --> C{AI can resolve?}
  C -- Yes --> D[Visitor closes the chat]
  C -- No --> E[Handoff attribute set on task]
  E --> F[Workflow routes to human queue]
  F --> G[Rep picks up task in Flex]
```

## What the rep sees

* A **messaging task** in the Flex UI assigned to their queue.
* The full AI-to-visitor transcript in the conversation thread.
* The handoff note at the top with summary, sentiment, and reason.
* The six `handoff*` attributes on the task panel (see [Handoff](/integrations/twilio-flex/handoff#what-opencx-writes-to-the-task)).
* Any `flex_*` custom data the workflow set during routing.
* Replies typed in the Flex UI land back in the visitor's widget within a couple of seconds.

## Channel-specific details

<AccordionGroup>
  <Accordion title="Authenticated visitors vs anonymous visitors" icon="shield-check">
    When the widget passes a verified identity via [widget authentication](/widget/authentication), OpenCX attaches the verified email and contact ID to the Flex conversation. Anonymous visitors show up as a fresh contact until they identify themselves.
  </Accordion>

  <Accordion title="Files visitors upload" icon="paperclip">
    Files uploaded in the widget appear as attachments on the Flex conversation. File-size limits follow your Twilio Conversations plan.
  </Accordion>

  <Accordion title="CSAT after the chat ends" icon="star">
    If your workflow triggers <Tooltip tip="Customer Satisfaction — a post-conversation survey measuring how satisfied the visitor was with the support experience.">CSAT</Tooltip>, the rating lands on the OpenCX session, not on the Flex task. Find it via the session ID in the [Inbox](https://platform.open.cx/inbox).
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="AI Chat Widget" icon="messages" href="/widget/introduction">
    The channel itself — install, configure, authenticate.
  </Card>

  <Card title="Connect Twilio Flex" icon="plug" href="/integrations/twilio-flex/connect">
    Credentials, webhook, workflow filters.
  </Card>

  <Card title="Twilio Flex overview" icon="headset" href="/integrations/twilio-flex/overview">
    What else Flex lights up across every channel.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/twilio-flex/troubleshooting">
    Missing task, wrong queue, events routed to the wrong org.
  </Card>
</CardGroup>
