> ## 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.

# AI Chat Widget

> Route web chat conversations from the AI Chat Widget into the Zendesk Agent Workspace as live Sunshine chats.

Widget conversations route through <Tooltip tip="Zendesk's real-time messaging layer. Conversations surface in the Agent Workspace as live chats rather than tickets.">Sunshine Conversations</Tooltip>. When the AI hands off a chat, your rep picks it up as a live chat inside the Zendesk <Tooltip tip="Zendesk's unified UI where agents handle tickets and live messaging side by side.">Agent Workspace</Tooltip> — no ticket created, no context lost.

## Pre-requisites

<Warning>
  **Install the AI Chat Widget on your site first.** Zendesk handoff 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).
* **Zendesk Sunshine credentials saved** — see [Sunshine Conversations](/integrations/zendesk/sunshine-conversations).

## How conversations land in Zendesk

```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 via Sunshine]
  E --> F[Live chat in Agent Workspace]
  F --> G[Rep replies — lands in the widget]
```

## Setting up

<Steps>
  <Step title="Confirm the widget is live">
    Open the page where you embedded the widget and send a test message. You should see the AI respond. If the widget doesn't load, walk through [Install Widget](/widget/install-widget) first.
  </Step>

  <Step title="Confirm Sunshine is connected">
    In your [OpenCX dashboard](https://platform.open.cx/settings/integrations), open **Zendesk → Messaging**. The status should show **Active**. If not, complete the [Sunshine Conversations setup](/integrations/zendesk/sunshine-conversations).
  </Step>

  <Step title="Trigger a test handoff">
    Send a message like *"I want to talk to a human"* in the widget. The AI should hand off the conversation.
  </Step>

  <Step title="Verify in the Zendesk Agent Workspace">
    Open your Zendesk Agent Workspace. The conversation should appear as a **live chat** — not a ticket. Reply from Zendesk and confirm the message lands in the visitor's widget within a couple of seconds.
  </Step>
</Steps>

<Tip>
  If the conversation created a **ticket** instead of a live chat, Sunshine credentials are likely missing or inactive. Re-check [Settings → Integrations](https://platform.open.cx/settings/integrations) → Zendesk Messaging status.
</Tip>

## What the rep sees

* A **live chat in the Agent Workspace** on the same screen they work tickets from.
* The full AI-to-visitor transcript attached to the conversation.
* `opencx_channel_web` in Zendesk's view filters and reports.
* `opencx_org_id`, `opencx_contact_id`, and `opencx_session_id` on the conversation's <Tooltip tip="Key-value pairs OpenCX attaches to every Sunshine conversation. Not visible to reps directly, but reachable via the Conversations API for debugging and analytics.">`metadata`</Tooltip> — the session ID is the trace key back to OpenCX.
* Replies typed in the Agent Workspace 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 email via [widget authentication](/widget/authentication), OpenCX merges the Sunshine messaging contact with the existing Zendesk support user on that email — no duplicate contact records. Anonymous visitors get a fresh Sunshine contact until they identify themselves.
  </Accordion>

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

  <Accordion title="Widget custom components still render on the visitor side" icon="bolt">
    When an AI action returns data rendered by a [custom component](/widget/custom-components), the visitor sees the richer UI. Your rep sees the underlying text and data in the Agent Workspace — pick copy that reads well in both surfaces.
  </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 and comment land on the OpenCX session (visible via the **View session in OpenCX** link), not as a Zendesk satisfaction rating.
  </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="Sunshine Conversations setup" icon="plug" href="/integrations/zendesk/sunshine-conversations">
    Credentials, webhook, and user merge.
  </Card>

  <Card title="Zendesk overview" icon="headset" href="/integrations/zendesk/overview">
    What else Zendesk lights up across every channel.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/zendesk/troubleshooting">
    Widget handoff creating a ticket instead, missing rep replies.
  </Card>
</CardGroup>
