# Hand off to live Zendesk agents with Sunshine Conversations > Connect Sunshine Conversations so your AI agent can hand customers to a live agent in Zendesk without leaving the QwryAI widget The Sunshine integration connects your QwryAI agent to Zendesk's Sunshine Conversations, so a customer chatting in the QwryAI widget can be handed to a live person in Zendesk. Your Zendesk agent works the chat from Zendesk Agent Workspace, and their replies appear in the same Chat bubble, Center Stage or Help page the customer is already using. ## Before you start * A QwryAI account with an agent. * A Zendesk account with access to the **Conversations API** (Sunshine Conversations). * The [Zendesk](/docs/user-guides/integrations/zendesk) ticketing integration connected on the same agent. Until it is, the **Sunshine** card's **Connect** button is disabled and shows **Connect Zendesk first** when you point at it. * [Zendesk Messaging](/docs/user-guides/integrations/zendesk-messaging) not connected on this agent. An agent can use Sunshine or Zendesk Messaging, not both. * A workspace that isn't HIPAA-compliant. On HIPAA-compliant workspaces the card shows *Not available on HIPAA-compliant accounts.* ![The Sunshine card on the Integrations page, Connect Sunshine to enable live chat inside Zendesk., with its Connect button disabled and the tooltip Connect Zendesk first.](annotated/01-integrations-card.webp "Sunshine waits for Zendesk.") ## How Sunshine differs from Zendesk Messaging | | Sunshine | Zendesk Messaging | | - | - | - | | Where customers chat | QwryAI's own widget: Chat bubble, Center Stage or Help page | Your Zendesk messaging channels, such as the Zendesk Web Widget, mobile SDKs or WhatsApp | | Where agent replies appear | In the QwryAI widget | In the Zendesk channel | | Needs the Zendesk ticketing integration | Yes | No | | HIPAA-compliant workspaces | Not available | Available | ## How to connect Sunshine **1. Create an API key in Zendesk** 1. Sign in to Zendesk as an admin and open **Admin Center**. 2. Go to **Apps and integrations › APIs › Conversations API**. 3. Select **Create API key**, name it `QwryAI`, and continue. 4. Copy the **App ID**, **Key ID** and **Secret key** it shows. **2. Connect Sunshine in QwryAI** 1. In your [QwryAI dashboard](https://www.qwryai.com), open the agent you want to hand off from. 2. Go to **Integrations** and check that **Zendesk** shows **Connected**. 3. Select **Connect** on the **Sunshine** card. A **Sunshine Integration** window opens: *Allow QwryAI to integrate with Sunshine Conversations?* 4. Paste the **App ID**, **Key ID** and **Secret Key**, then select **Submit**. ![The Sunshine Integration window, Allow QwryAI to integrate with Sunshine Conversations?, with the App ID, Key ID and Secret Key fields and the Close and Submit buttons.](annotated/02-connect-window.webp "Enter the App ID, Key ID and Secret Key.") If any value is wrong, QwryAI shows *Invalid Sunshine Conversations credentials.* Copy all three again and resubmit. On success, QwryAI registers a webhook named **QwryAI** in your Conversations API settings so Zendesk can send agent replies back. **3. Let agents end messaging sessions in Zendesk** A live chat ends when your Zendesk agent ends the messaging session, which hands the conversation back from Agent Workspace. In Zendesk Admin Center, open **Channels › Messaging and social › Messaging**, select **Manage settings**, and under **Ending sessions** allow agents to end messaging sessions. Save your settings. **4. Create the Sunshine live chat Action** 1. Go to **Build › Actions** and open **Create Action**. 2. Select **Sunshine live chat** (*Hand over from the AI agent to live chat with a human support agent*). Until Sunshine is connected, the card asks you to connect it first. 3. Edit **When to use**, select **Continue**, then **Enable**. ![Create Action searched for Sunshine: selecting the Sunshine live chat card opens a dialog that asks you to connect Sunshine first.](walkthroughs/sunshine-action-card.gif) > [!TIP] > > Test it by asking your agent for a person on the Chat bubble, and check that the conversation reaches Agent Workspace in Zendesk. ## What happens during a handoff 1. The agent decides the customer needs a person, based on the Action's **When to use**. 2. It writes a subject and a first-person summary from the conversation, without asking the customer for them. 3. QwryAI opens a new Zendesk messaging conversation as the customer, titled with the subject, posts the summary as its first message, and passes it to Agent Workspace. The customer's name and email go on their Zendesk profile when QwryAI knows them. 4. The chat shows *Waiting for support agent to join*. The customer's next messages go to Zendesk, and your agent's replies appear in the widget. 5. When your agent ends the session in Zendesk, the chat shows *Sunshine live chat ended.* and your QwryAI agent answers again. ![On the Help page, a customer asks for a person; the chat shows Waiting for support agent to join, a Zendesk agent replies from Agent Workspace, the reply appears in the widget, and the chat later shows Sunshine live chat ended.](walkthroughs/sunshine-handoff.gif) ### Example handoff ```text Customer: My account is locked and the reset email never arrives. I need to talk to someone. Agent: I'll connect you with our support team now. (Waiting for support agent to join) Zendesk agent: Hi Sam, I've unlocked your account. Try signing in again. ``` In Zendesk, the conversation is titled something like "Locked account, reset email not received" and opens with the summary. ## Limitations * **Sunshine requires Zendesk.** The Zendesk integration must be connected first, and disconnecting Zendesk deletes the Sunshine live chat Action too. * **Sunshine and Zendesk Messaging can't share an agent.** Disconnect one before connecting the other. * **Not available on HIPAA-compliant workspaces.** * **Widget channels only.** The Action runs on the **Chat bubble**, **Help page** and **Center Stage**. Every other channel is incompatible. * **One live chat at a time** per conversation. ## Troubleshooting > [accordion] The Connect button is disabled and shows Connect Zendesk first > > Connect the [Zendesk](/docs/user-guides/integrations/zendesk) ticketing integration on the same agent's **Integrations** page, then connect Sunshine. > [accordion] Connecting shows Invalid Sunshine Conversations credentials > > The **App ID**, **Key ID** or **Secret Key** is wrong. Copy all three from **Conversations API** in Zendesk Admin Center and submit again. If you lost the secret key, create a new API key. > [accordion] Connecting says to disconnect Zendesk Messaging > > *Disconnect Zendesk Messaging before connecting Sunshine.* Disconnect [Zendesk Messaging](/docs/user-guides/integrations/zendesk-messaging) on **Integrations**, then connect Sunshine. > [accordion] The chat doesn't end in QwryAI when my agent finishes > > The live chat ends when your agent ends the messaging session in Zendesk. Check that agents are allowed to end messaging sessions under **Ending sessions** in your Messaging settings. ## Frequently asked questions > [accordion] Do I need the Zendesk integration to use Sunshine? > > Yes. Connect the [Zendesk](/docs/user-guides/integrations/zendesk) ticketing integration first. > [accordion] Where does the customer see the Zendesk agent's replies? > > In the same QwryAI widget they were already chatting in. > [accordion] Who ends a Sunshine conversation? > > Your Zendesk agent, by ending the messaging session in Zendesk. Your QwryAI agent then picks the conversation back up. > [accordion] Can I use Sunshine and Zendesk Messaging on the same agent? > > No. See [How Sunshine differs from Zendesk Messaging](#how-sunshine-differs-from-zendesk-messaging). > [accordion] Which channels support Sunshine live chat? > > The Chat bubble, Help page and Center Stage. ## Next steps > [card] Escalations Action | /docs/user-guides/chatbot/actions/escalate-to-human | Prefer an asynchronous handoff? Open a ticket instead of routing the customer to a live agent.