# Escalate AI agent conversations to Salesforce > Connect Salesforce so your AI agent can open cases and hand customers to live agents in Salesforce The Salesforce integration connects your QwryAI agent to your Salesforce org so it can pass on what it can't resolve, in two ways: * **Create a case** for your team to follow up, from any channel where the [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human) Action runs. * **Hand the customer to a live agent** in Salesforce, inside the Chat bubble or Help page, with the [Salesforce live chat](/docs/user-guides/chatbot/actions/salesforce-actions#2-salesforce-live-chat) Action. ## Available capabilities | Capability | What it does | Where it runs | | - | - | - | | Case creation | Opens a Salesforce case with an AI-written summary and a link to the conversation | Any channel where the **Escalations** Action runs | | Live chat handoff | Hands the customer to a live agent in Salesforce Enhanced Chat | **Chat bubble** and **Help page** | ## Before you start * A QwryAI account with an agent. * A Salesforce org with API access, and a Salesforce user who can authorize connected apps. Cases are created as that user. * For live chat, Messaging for Enhanced Chat and Omni-Channel set up in the org. See [Configure your Salesforce org](/docs/user-guides/chatbot/actions/salesforce-actions#configure-your-salesforce-org). ## How to connect Salesforce **1. Open your agent** Sign in to your [QwryAI dashboard](https://www.qwryai.com) and select the agent you want to connect. **2. Find the Salesforce card** Open **Integrations** and find the **Salesforce** card. ![The Salesforce card on the Integrations page, Connect Salesforce so that your AI agent can escalate cases to humans or hand a chat over to your Salesforce agents., with the pointer on Connect.](annotated/01-integrations-card.webp "Integrations › Salesforce.") **3. Enter a custom domain if you need one** Most orgs can skip this. For a sandbox, or an org that blocks sign-in at login.salesforce.com, type your My Domain address in **Custom domain (optional)**, such as `acme.my.salesforce.com`. ![The Salesforce card with acme.my.salesforce.com typed in the Custom domain (optional) field.](annotated/02-custom-domain.webp "Custom domain (optional) for sandboxes and locked-down orgs.") **4. Connect** Select **Connect**. A Salesforce window opens. Sign in, review the access QwryAI asks for (managing your data through the API, and keeping access when you're offline) and select **Allow**. The window closes and the card shows **Connected**. > [!TIP] > > Test the integration by asking your agent for a follow-up, and check that a case appears in Salesforce under **Cases**. ## Create the Salesforce Actions **Create a case:** create an **Escalations** Action with **Salesforce** as the **Ticket Platform**. See the [Escalations guide](/docs/user-guides/chatbot/actions/escalate-to-human). **Live chat:** go to **Build › Actions**, open **Create Action** and select **Salesforce live chat**. Enter the **Salesforce Live Chat API URL**, **Developer Name** and **Org ID** from your Embedded Service Deployment. Until Salesforce is connected, the card offers **Connect** first. ![Create Action searched for Salesforce: selecting the Salesforce live chat card opens a dialog that asks you to connect Salesforce first.](walkthroughs/salesforce-action-card.gif) [Salesforce Actions](/docs/user-guides/chatbot/actions/salesforce-actions) covers both Actions in full, including the org setup for live chat. ## What the case contains The agent makes sure it has the customer's name and email first, asking for them if needed. | Case field | What QwryAI sends | | - | - | | **Subject** | A short subject the agent writes from the customer's issue | | **Description** | An AI-written summary of the issue, from the customer's point of view | | **Case Origin** | Web | | **Web Email** | The customer's email | | **Web Name** | The customer's name | QwryAI then adds a private case comment, *conversation link in QwryAI:*, with a link to the conversation in your QwryAI **Inbox**, and tells the customer the case number. ### Example A customer reports that invoices in their account show the wrong VAT number. The agent asks for their name and email, then creates: * **Subject:** Wrong VAT number on invoices * **Description:** All my invoices since March show our old VAT number. I need them reissued with the new one. * **Case Origin:** Web * **Private comment:** conversation link in QwryAI, followed by the link ## What the customer sees * **After a case:** the agent shares the case number and keeps replying in the chat. Your team's replies reach the customer the way Salesforce sends them, usually by email. * **During live chat:** the chat shows **Waiting for support agent to join** until a Salesforce agent replies, then they chat in the widget. When the Salesforce agent ends the session, the chat shows *Salesforce live chat ended.* and your QwryAI agent answers again. ## Disconnecting Salesforce On **Integrations**, open the **Manage Salesforce connection** menu on the **Salesforce** card and select **Disconnect**. The dialog lists the Actions that use Salesforce; confirming deletes them. To also remove QwryAI's access on the Salesforce side, revoke it in Salesforce **Setup** under **Connected Apps OAuth Usage**. ## Troubleshooting > [accordion] Connecting shows "Enter a Salesforce domain ending in .my.salesforce.com" > > **Custom domain (optional)** must be your My Domain address, such as `acme.my.salesforce.com` or `acme--uat.sandbox.my.salesforce.com`. Leave it empty to sign in at login.salesforce.com. > [accordion] Connecting fails with "Failed to connect Salesforce" > > Salesforce didn't finish the authorization. Check that your user can authorize connected apps and has API access, then select **Connect** again. > [accordion] Salesforce authorization expired > > *Salesforce authorization expired. Please reconnect.* The Salesforce window stayed open too long, or an admin revoked the app's access. Connect again. > [accordion] The customer was told the case could not be created > > Open the conversation in [Inbox](/docs/user-guides/chatbot/activity). Check that the connected user can still create cases and that the customer gave an email. If the card shows *Salesforce access was revoked*, select **Reconnect**. > [accordion] Live chat never starts > > Salesforce refused the handoff, so the agent keeps the conversation. Check the three Action values and the user verification keyset. See [Salesforce live chat](/docs/user-guides/chatbot/actions/salesforce-actions#2-salesforce-live-chat). ## Frequently asked questions > [accordion] Does it work with sandboxes? > > Yes. Enter the sandbox's My Domain address in **Custom domain (optional)** before you connect. > [accordion] Do I need both Actions? > > No. Use **Create ticket** for follow-ups, **Salesforce live chat** for real-time help, or both. > [accordion] Which channels support Salesforce live chat? > > The **Chat bubble** and **Help page**. Cases can be created from most channels. > [accordion] What happens to my Actions if I disconnect Salesforce? > > Disconnecting deletes the Actions that use Salesforce. The confirmation dialog lists them first. > [accordion] Does creating a case use credits? > > No. Only the agent's reply uses credits, as usual. ## Next steps > [card] Salesforce Actions | /docs/user-guides/chatbot/actions/salesforce-actions | Set up cases and live chat, including the Salesforce org configuration. > [card] Escalations Action | /docs/user-guides/chatbot/actions/escalate-to-human | Choose when your agent escalates, which details it collects and which channels it escalates from.