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

# Salesforce Service Cloud

<a href="/release-notes/4.100"><Badge className="version-badge" color="blue">Updated in 4.100</Badge></a>

<Frame>
  <img class="image-center" src="https://mintcdn.com/cognigy-15abf2ba/soxoo9ezWiZx15p2/_assets/ai/escalate/handover-reference/salesforce.svg?fit=max&auto=format&n=soxoo9ezWiZx15p2&q=85&s=4b471e834615ba5479fe15df84eba8da" alt="Salesforce Service Cloud handover provider logo" width="92" height="64" data-path="_assets/ai/escalate/handover-reference/salesforce.svg" />

  <figcaption>Salesforce Service Cloud</figcaption>
</Frame>

## Description

<Warning>
  Salesforce announced the removal date for [LiveAgent, Salesforce Chat, Embedded Chat, and Service Chat](https://help.salesforce.com/s/articleView?id=001790618\&type=1). The removal date is February 14, 2026. This handover provider connector will remain active until the removal date. Before this date, migrate to a [new connector](/ai/escalate/handover-reference/salesforce-miaw) for the Salesforce provider that supports [Messaging for In-App and Web](https://help.salesforce.com/s/articleView?id=service.miaw_intro_landing.htm\&type=5).
  If you configured the embedded Agent Copilot workspace, make sure that you update its [configuration](/ai/escalate/handover-reference/salesforce-miaw#additional-configuration) during the migration.

  The Salesforce handover provider bridges Cognigy.AI and [Salesforce Service Cloud](https://salesforce.com/),
  enabling end users to connect with human agents working in a contact center that uses Salesforce Service Cloud.
</Warning>

## Prerequisites

* Access to [Salesforce Service Cloud](https://login.salesforce.com/).
* Created Endpoint [compatible with Salesforce](/ai/agents/deploy/endpoints/handover-settings).

## Configuration on the Handover Provider Side

<Accordion title="Configure Salesforce Service Cloud">
  1. [Log in](https://login.salesforce.com/) to Salesforce.
  2. If no chat deployment is available in Salesforce, use the following guides:
     * [Create a Basic Chat Implementation](https://help.salesforce.com/s/articleView?id=sf.live_agent_set_up_basic_implementation.htm)
     * [Create Chat Deployments](https://help.salesforce.com/s/articleView?id=sf.live_agent_create_deployments.htm).
  3. On the Salesforce home page, navigate to **Feature Settings > Service > Chat > Chat Settings**. On the **Chat Settings** page, go to the **API Information > Chat API Endpoint**. Copy the Chat API Endpoint value without the `/chat/rest` part, for example `https://x.xxx-xx-xxx.salesforceliveagent.com`. Save it for future use.
  4. Navigate to **Feature Settings > Service > Embedded Service > Embedded Service Deployments**. In the row with the deployment you want to use, click <img src="https://mintcdn.com/cognigy-15abf2ba/sIAERK2J23A3FpS0/_assets/icons/black-and-white/vertical-ellipsis.svg?fit=max&auto=format&n=sIAERK2J23A3FpS0&q=85&s=6d2d4d534ed7e5d4ea9442c1c11f87c8" alt="vertical ellipsis" width="20" height="20" data-path="_assets/icons/black-and-white/vertical-ellipsis.svg" />, then select **View**.
  5. In the **Embedded Service Code Snippets** section, click **Get Code**. Copy and save the values from the following parameters without the single quotes `''`:

     * `deploymentId`
     * `buttonId`
     * `organizationId`

       <br />

     ```js theme={null}
     embedded_svc.init(
         'https://...', 
         'https://...', 
         gslbBaseURL, 
         '<your-organization-id>', // Copy the Organization ID
         '...', 
         {
             baseLiveAgentContentURL: '...',
             deploymentId: '<your-deployment-id>', // Copy the Deployment ID
             buttonId: '<your-button-id>', // Copy the Button ID
         }
     );
     ```
</Accordion>

## Configuration on the Cognigy.AI Side

<AccordionGroup>
  <Accordion title="1. Create a Handover Provider">
    1. Go to **Build > Handover Providers** and click **+ New Handover Provider**.
    2. In the **New Handover Provider** window, select **Salesforce** from the list and name the connector.
    3. *(Optional)* Activate the **Forward Events to the Flow** setting. This setting forwards any event to the Flow, which can be handled in the Lookup Node. Select the **Handover Status** type in the Lookup Node. In the Case Node, select **Events** from the **Handover Status** list. Agent Replies and Conversation Closed events are not forwarded.
    4. Fill in the following fields:

    | **Field**           | **Description**                                                                        |
    | ------------------- | -------------------------------------------------------------------------------------- |
    | Live Agent Base URL | The URL, copied from the **Chat API Endpoint** field.                                  |
    | API Version         | The API version is `52`.                                                               |
    | Organization ID     | The unique identifier for your Salesforce organization, copied from `organizationId`.  |
    | Deployment ID       | The ID of your deployment in Salesforce, copied from `deploymentId`.                   |
    | Button ID           | The ID of the button for the related deployment in Salesforce, copied from `buttonId`. |
  </Accordion>

  <Accordion title="2. Add a Handover to Human Agent Node">
    In the **Salesforce Settings** section of the [Handover to Human Agent](/ai/agents/develop/node-reference/service/handover-to-agent) Node, configure the following settings:

    * **Send Transcript as first message** — the setting allows Salesforce to receive the conversation transcript as the first message. This setting is turned off by default.
    * **Button ID** — the ID of the Button you created in the Salesforce installation. This setting will override the default Button ID that you specified in the Endpoint configuration. You can use different Button IDs for individual Handover to Human Agent Nodes.
    * **Pre-chat Entities and Details** — the additional context sent in a custom JSON structure, providing the information before engaging with the human agent.
  </Accordion>

  <Accordion title="2.1 Configure Pre-Chat Entities and Details">
    By default, Cognigy.AI doesn't send a conversation transcript from the chat with the AI Agent to the chat with the human agent. If you activate the Send Transcript as a first message setting, Cognigy.AI sends the conversation transcript to the chat with the human agent as the first message. The conversation transcript includes the entire chat between the user and the AI Agent.

    The conversation transcript is displayed when the human agent receives the first message from the user and can be found in the Salesforce Service Console, under the **Transcripts** tab, in the **Transcript > Details > Transcript > Body** section.

    Moreover, Cognigy.AI allows users to send Pre-chat Details and Pre-chat Entities arrays as a custom JSON structure. This feature allows users to include additional context or relevant information before initiating the chat with the human agent. This information can then be used for further processing or personalizing the conversation based on the provided details.

    **Pre-Chat Entities**

    Cognigy.AI allows the creation of fields
    and linking User details obtained through Pre-Chat Details to Salesforce Entities like Contact or Case.

    To do this, you must send the Pre-Chat Entities array to the live chat session on Salesforce.

    The JSON example shows how to connect the conversation to a Case and use Pre-Chat Details:

    ```json theme={null}
    [
       {
            "entityName":"Contact",         
            "saveToTranscript": "Contact",
            "linkToEntityName":"Case",
            "linkToEntityField":"ContactId",
            "showOnCreate":true,          
            "entityFieldsMaps":[
                {
                  "fieldName":"LastName",
                  "label":"LastName",
                  "doFind":true,
                  "isExactMatch":true,
                  "doCreate":true
               },
               {
                  "fieldName":"FirstName",
                  "label":"FirstName",
                  "doFind":true,
                  "isExactMatch":true,
                  "doCreate":true
               },
               {
                  "fieldName":"Email",
                  "label":"Email",
                  "doFind":true,
                  "isExactMatch":true,
                  "doCreate":true
               }          
            ]
         }   
      ]
    ```

    **Pre-Chat Details**

    Cognigy.AI allows sending conversation information to Salesforce Live Agent using Pre-chat Details.

    By using the **entityMaps** field, this information can be mapped to specific Pre-Chat Entity fields.

    CognigyScript can fetch values from Cognigy input, profile, and context objects before sending the data.

    ```json theme={null}
    [
          {
            "label":"LastName",
            "value":"Mustermann",
            "entityMaps":[
               {
                  "entityName":"contact",
                  "fieldName":"LastName"
               }
            ],
            "transcriptFields":[
               "LastName__c"
            ],
            "displayToAgent":true
         },
         {
            "label":"FirstName",
            "value":"Max",
            "entityMaps":[
               {
                  "entityName":"contact",
                  "fieldName":"FirstName"
               }
            ],
            "transcriptFields":[
               "FirstName__c"
            ],
            "displayToAgent":true
         },
         {
            "label":"Email",
            "value":"max.mustermann@mail.de",
            "entityMaps":[
               {
                  "entityName":"contact",
                  "fieldName":"Email"
               }
            ],
            "transcriptFields":[
               "Email__c"
            ],
            "displayToAgent":true
         }
    ]
    ```

    For more information about the Pre-Chat Entities and Pre-Chat Details fields and their usage, read the [Salesforce API documentation](https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_data_types.htm#CustomDetail).

    To check the handover, go to the installation that your server administrator has deployed.
  </Accordion>
</AccordionGroup>

## Additional Configuration

<Accordion title="Agent Copilot Workspace">
  To integrate Agent Copilot directly into Salesforce Service Cloud, refer to the [Salesforce Integrations](https://github.com/Cognigy/salesforce-integrations) documentation on GitHub.
</Accordion>

## More Information

* [All Handover Providers](/ai/escalate/handover-reference/overview)
* [Handovers](/ai/escalate/handovers)
