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

# Agent AI Integration with Salesforce Email-to-Case

The Agent AI integration with Salesforce Email-to-Case lets agents use Agent AI directly in the Salesforce Service Console for email-based cases. When a customer emails a configured Email-to-Case address, Salesforce automatically creates or updates a case and displays the Agent AI widget on the Case page.

Through the Agent AI widget, agents receive AI-powered suggestions, conversation summaries, next-best actions, guided responses, and contextual insights based on the email history retrieved from Salesforce through a configured external API. Because email interactions are asynchronous, agents can use the **Refresh** option in the Agent AI widget to sync newly received or sent emails and keep the context current, ensuring accurate intent detection and relevant suggestions.

Agents can generate **on-demand summaries** of past email interactions to quickly understand long-running conversations. The system stores these summaries in Custom Data of Agent AI for downstream use within Agent and Agentic Platform (see [Selecting conversation metadata](/ai-for-service/agentai/configuration/linked-services#conversation-metadata) or in Salesforce for future reference, helping maintain continuity and improve response quality.

The Assist tab displays a summary when the widget loads and updates the summary as new emails arrive or agents generate or submit one.

This integration helps agents respond faster, maintain context across email threads, and deliver consistent, high-quality customer support within Salesforce.

## Prerequisites

Before integrating Agent AI with Salesforce, ensure the following prerequisites:

* Configure Salesforce Email-to-Case. Refer to [Set up Email-to-Case](https://help.salesforce.com/s/articleView?id=service.setting_up_email-to-case.htm\&type=5) for help.
* Install the [Agent AI Salesforce](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N4V00000HSGlnUAH) package in your Salesforce organization.
* Ensure you have Agent AI admin permissions.

## Steps to Configure Agent AI in Salesforce

1. Sign in to **Salesforce**.

2. Select **App Launcher**.

3. Type **config** in the **search bar**, and select **Kore Agent AI Configuration** from the displayed list.

4. Select **New** from the top-right corner of the page.
   <img src="https://mintcdn.com/koreai/ebWLPXNtu13b1ba-/ai-for-service/agentai/integration/salesforce-email-to-case/images/agentai-configuration-page_1.png?fit=max&auto=format&n=ebWLPXNtu13b1ba-&q=85&s=da91b1bfd4b11a746cff4042a999638d" alt="agentai-configuration-page" width="1718" height="1400" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/agentai-configuration-page_1.png" />

5. Enter the required values in the **Agent AI URL**, **Bot ID**, **Client ID,** **Client Secret**, and **Language (bot language)** fields. To get these values:
   1. Sign in to Platform.
   2. Go to **Agent AI** > **Flows & Channels** > **Digital**.
   3. Select **Web/Mobile Client** and expand the **JWT App Details** section.
   4. Select the **copy** buttons against the required fields.
      <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/jwt-app-details-section_2.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=5ec3b4768c2eb93a0bbcf17273f0ca65" alt="jwt-app-details-section" width="675" height="877" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/jwt-app-details-section_2.png" />

6. Select **Generate Summary in Agent AI with External API Data** to generate both the Landing Summary and Intermittent Summary within the Agent AI widget using external data.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/api-with-external-data_3.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=6e990d8ded5302dd0e70fa9d1d532601" alt="api-with-external-data" width="1710" height="1384" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/api-with-external-data_3.png" />

7. Click **Save**.

### External API Configuration for Summary Generation

The **Generate Summary in Agent AI with External API Data** option allows Agent AI to fetch message history across channels like chat, social cases, and email. Using the details of this configured API, Agent AI fetches the history of the conversation and generates a summary. This is useful when summaries need to incorporate information beyond the email thread, such as case details, metadata, or related records.

When enabled, configure the following fields:

* **API Method**: Select the HTTP method (GET or POST) that Agent AI should use to invoke the external API.

* **Client ID**: Create an OAuth app by referring to the [Create an External Client App for the OAuth 2.0 Client Credentials Flow](https://developer.salesforce.com/docs/industries/loyalty/guide/authorization.html) doc. Enter the OAuth Consumer Key that's used to authenticate the API request.

* **Client Secret**: Enter the OAuth Consumer Secret associated with the Consumer Key.

* **API Endpoint**: Provide the complete API endpoint URL from which Agent AI fetches the data. For example, Salesforce Apex REST endpoint for retrieving case information.

  <Note>You can add static query parameters that are not associated with the Salesforce Case object directly to the API endpoint. For example, `https://your-domain.my.salesforce.com/services/apexrest/case?isSorted=true`</Note>

* **API Query Params (JSON)**: Enter the key-value pairs the system sends as query parameters, in JSON format.
  Example:

  ```
  {
      "caseId": "Id"
  }
  ```

  <Note>Configure the **Case Object** field names as values in **API Query Params** and **API Body** Objects. During runtime the API call is made with the actual values. For example, if **Id** is configured, the dynamic value of the Salesforce Case ID is used at runtime.</Note>

* **API Body (JSON)**: Define the request body in JSON format (applicable for POST requests). This can include dynamic case or conversation attributes required by the API.

Once configured and saved, Agent AI invokes the external API during summary generation and enriches the summary with the returned data, ensuring more complete and context-aware summaries for email-based cases.

## Add Component to the Case Page

1. Go to **App Launcher** and select **Cases**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/app-launcher-cases_4.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=ea968dfea64f75db325340f5391f2d9a" alt="app-launcher-cases" width="688" height="442" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/app-launcher-cases_4.png" />

2. Open any record of cases.

3. Click the **gear** icon in the top-right corner, and then select **Edit Page**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/edit-page_5.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=58c3bce3a1c3b41288cf30d1c637f674" alt="edit-page" width="1847" height="933" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/edit-page_5.png" />

4. Under the **Custom-Managed** components, find the **OmniChannel\_AgentAIEmail** component.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/custom-managed-omnichannel-agentai-email_6.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=0b938509bdc9872f8e6a6d558d02f397" alt="custom-managed-omnichannel-agentai-email" width="1847" height="932" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/custom-managed-omnichannel-agentai-email_6.png" />

5. Drag and drop the component on the **Case** page.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/case-page_7.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=a6dbb7e7e57d029c0bbc5a327cc7f2e5" alt="case-page" width="1847" height="932" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/case-page_7.png" />

6. Select **Save**.

7. Select **Activation** and activate the page.

   <Note>The **Email** section appears on the **Case** page only after **Email-to-Case** is successfully configured in your org.</Note>

## Test your Solution

1. The customer sends an email to the address configured under **Routing Addresses** in Email-to-Case.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/email-to-case-page_8.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=eb4cd0c9ffeca9b6cc3c9366936c0c7d" alt="email-to-case-page" width="1845" height="931" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/email-to-case-page_8.png" />

2. The system automatically creates a new case when the customer sends a new email.

3. When the case opens, the Agent AI widget loads in the location you configured during setup in the [previous step](#add-component-to-the-case-page).

   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/agentai-widget_9.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=99d5ed3ba558461071e48e5e550ad73e" alt="agentai-widget" width="1844" height="932" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/agentai-widget_9.png" />

   If you select and configure **Generate Summary in Agent AI with External API Data** during Agent AI Configuration, the system generates landing summary as follows:

   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/landing-summary_10.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=6fe4fd09b4541dd6b9a2fc1db0667f8e" alt="landing-summary" width="1833" height="883" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/landing-summary_10.png" />

4. When a new email appears in the Email section (whether from the agent or the customer), the agent must select the **Refresh** button at the top of the widget. After refreshing, the system passes the latest email to the Agent AI widget, which then provides suggestions based on the customer's message.

5. Since email conversations don't have a defined end, agents can use the [Generate Summary](/ai-for-service/agentai/agent-experience/agent-assist-widget-v3#generate-summary) button on the Agent AI widget to generate on-demand summary of the conversation. A summary pop-up appears within the Agent AI widget.

6. Summary behavior in the Assist tab:
   * When agents click **Summary** in the **Intermittent Summary** pop-up, the system displays the generated summary in the Assist tab as **Summary** (not **Landing Summary**).
   * When agents click **Submit**, the system overrides the existing Assist tab summary and replaces it with the latest submitted summary.

7. Select **Submit** to save the summary in one of the custom objects in Salesforce. To access these summaries, search for **Kore NonCTI AgentAI Conversation Summary** in the **App Launcher**.
   <img src="https://mintcdn.com/koreai/G6EEnbWlHDi01USy/ai-for-service/agentai/integration/salesforce-email-to-case/images/kore-noncti-agentai-conversation-summary_11.png?fit=max&auto=format&n=G6EEnbWlHDi01USy&q=85&s=f07bbc3b71b2a7b2b180ed168544c34f" alt="kore-noncti-agentai-conversation-summary" width="850" height="275" data-path="ai-for-service/agentai/integration/salesforce-email-to-case/images/kore-noncti-agentai-conversation-summary_11.png" />

***
