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

# Salesforce Connector

> Sync cases and conversation data from Salesforce Service Cloud to cxconnect.ai

## Overview

The **Salesforce Connector** automatically syncs your service cases and conversation data from Salesforce Service Cloud to cxconnect.ai.

## What Data is Synced

The connector will sync the following information from your Salesforce account:

* **Cases**: Service cases including subject, description, status, and priority
* **Conversations**: Messaging conversation details from Salesforce Messaging
* **Messages**: Individual messages within each conversation

## Prerequisites

Before you begin, make sure you have:

1. Administrator access to your Salesforce account

<Note>
  This connector requires some technical setup in Salesforce. If you need assistance, please reach out to our support team.
</Note>

## Required Information

You'll need to provide the following when setting up the connector:

| Field       | What is it?                             | Where to find it                                  |
| ----------- | --------------------------------------- | ------------------------------------------------- |
| Username    | Salesforce integration user email       | Your integration user's email                     |
| Client ID   | Unique identifier from Connected App    | Generated in Step 1 below                         |
| Certificate | Security certificate file               | Provided by cxconnect.ai in Step 2 below          |
| Is Sandbox  | Whether you're using a test environment | Select "true" for sandbox, "false" for production |

## Setup Instructions

### Step 1: Create Connected App in Salesforce

First, you'll create a Connected App in Salesforce to generate the Client ID. We'll use this Client ID to generate your certificate.

#### 1. Log in to Salesforce as an administrator

#### 2. Go to **Setup** > **External Client App Manager**

<img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-external-app.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=c87580e16fcb854388bf905e493f8c03" alt="" width="502" height="944" data-path="images/sync-sf-external-app.png" />

#### 3. Click **New External Client App**

<img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-new-app.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=38cf40f679c1f3d74ad4f87e2d8fbfc8" alt="" width="2418" height="182" data-path="images/sync-sf-new-app.png" />

#### 4. Fill in the details under Basic Information:

* **App Name**: `cxconnectai Sync`
* **Contact Email**: Your email address
* **Distribution State**: Local
  <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-basic-info.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=0cc2325634892937593d7b70cbf44ddc" alt="" width="2372" height="834" data-path="images/sync-sf-basic-info.png" />

#### 5. Under **API (Enable OAuth Settings)**:

* Check **Enable OAuth**
  <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-enable-oauth.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=c6bd8e6b97fab5600192c1a93edd0245" alt="" width="644" height="262" data-path="images/sync-sf-enable-oauth.png" />
* **Callback URL**:
  * For Production Enter: `https://api.cxconnect.ai/cortex`
  * For Sandbox Enter: `https://test.api.cxconnect.ai/cortex`
* Select these OAuth scopes:
  * Full access (full)
  * Perform requests at any time (refresh\_token, offline\_access)
  * Access the Salesforce API Platform (sfap\_api)
  * Access Interaction API resources (interaction\_api)

#### 6. Under **Flow Enablement**:

* Select the following:
  <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-flow-enablement-setup.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=fbc0a33d716d124832328f95846ec746" alt="" width="1326" height="506" data-path="images/sync-sf-flow-enablement-setup.png" />

#### 7. Under **Security**:

* Assure the following are selected:
  <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-security-checks.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=e392b5c430cb0ec8760fe606ce1bdf2d" alt="" width="1400" height="428" data-path="images/sync-sf-security-checks.png" />

#### 8. Click **Create**

#### 9. Back under Settings > OAuth Settings:

* Click **Consumer Key and Secret**
  <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-consumer-key-click.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=3c3a5387835a11762cfbf7ee1fe00b50" alt="" width="744" height="336" data-path="images/sync-sf-consumer-key-click.png" />
* Copy **Consumer Key**

<Note>
  Keep your Client Key handy - you'll need to provide it to cxconnect.ai in the next steps.
</Note>

### Step 2: Set Up or Create Integration User

Make sure your integration user has these permissions through profile or permission set:

* API Enabled
* View All Data (or specific read access to Cases, Conversations, Email Messages)
* Access to Bulk API

### Step 3: Configure App Policies

Return to External Client App created:

1. Click **Edit** under **Policies**
   <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-policy-edit.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=66f554525bae0c63867be350b82c28e6" alt="" width="2426" height="680" data-path="images/sync-sf-policy-edit.png" />
2. Under **OAuth Policies**:
   * Under **Permitted Users** select the option "Admin approved users are pre-authorized"
   * Confirm the selection
     <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-admin-approved.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=3bff8ae81f56d7be91dcf9f8e8c62456" alt="" width="976" height="334" data-path="images/sync-sf-admin-approved.png" />
3. Under **App Policies** there should now be profile and permission set options for pre-authorized users.
   * Select a profile or permission set that has read access to the data being synced (Case, Email, Messaging, etc)
     <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-app-policy-permissions.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=c3b2c153010754892417390b00e9361f" alt="" width="2058" height="1008" data-path="images/sync-sf-app-policy-permissions.png" />
4. Under **OAuth Flows and External Client App Enhancements**
   * Check Enable Token Exchange Flow
     <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-token-exchange.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=0e78ef163aa8252c72c701973b71de79" alt="" width="846" height="218" data-path="images/sync-sf-token-exchange.png" />
5. Under **App Authorization**:
   * Under *IP Relaxation* select: Relax IP restrictions
     <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-relax-ip.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=71d83aeecfb84e10417ff25cabb40d6b" alt="" width="2078" height="584" data-path="images/sync-sf-relax-ip.png" />
6. Click **Save**

### Step 4: Obtain Certificate from cxconnect.ai

Contact the cxconnect.ai support team with the following information. We will generate a certificate specifically for your Salesforce integration and send it to you.

* **Email Support**: [help@cxconnect.ai](mailto:help@cxconnect.ai)
* **What to include**:
  * Your **Client ID** (Consumer Key) from Step 1
  * Your **Username** (integration user email)
  * Whether you're using a **Sandbox** environment (`true` for sandbox, `false` for production)

<Warning>
  Keep your certificate file secure and never share it publicly or commit it to version control.
</Warning>

### Step 5: Upload Certificate to Salesforce

Once you receive the certificate file from cxconnect.ai:

1. Return to your External App.
2. Find your **cxconnectai Sync** Connected App
3. Under **Settings** select **Edit**
4. Scroll to **OAuth Settings** > **Flow Enablement**
5. Check the **Enable JWT Bearer Flow**
   <img src="https://mintcdn.com/cxconnectai/ZcZS1QbMilCN3OPW/images/sync-sf-jwt-enabled.png?fit=max&auto=format&n=ZcZS1QbMilCN3OPW&q=85&s=673b059f7c76b3933ad781b155cf4af0" alt="" width="1524" height="664" data-path="images/sync-sf-jwt-enabled.png" />
6. Click **Upload Files**
7. Select the certificate obtained from support in Step 4.
8. Click **Save**

### Step 6: Connect in cxconnect.ai Admin Portal

<Note>
  The Sync Engine and Admin Portal are currently in development and not yet deployed. Steps 6 and 7 will be available once the feature is released.
</Note>

### Step 7: Monitor Your Sync

Once activated, the connector will automatically sync your data:

* Initial sync may take some time depending on data volume
* Monitor progress in the Admin Portal dashboard
* Check sync logs for any issues

## Troubleshooting

### Connection Issues

**Problem**: Unable to connect or authenticate

**What to check**:

* Verify the certificate file uploaded to Salesforce matches the one provided by cxconnect.ai
* Make sure the username exactly matches your Salesforce user (case-sensitive)
* Check that the user is pre-authorized in the Connected App
* Confirm the "Is Sandbox" setting matches your Salesforce environment
* Verify the Consumer Key (Client ID) is correct

### Permission Errors

**Problem**: Connection works but can't access data

**What to check**:

* Ensure the integration user has "API Enabled" permission
* Verify the user has read access to Cases and Conversations
* Check that the Connected App is assigned to the user
* Make sure the user has Bulk API access

### Missing Data

**Problem**: Some cases or conversations aren't syncing

**What to check**:

* Verify Salesforce Messaging is enabled if syncing conversations
* Check that the integration user has access to the records
* Ensure records exist in the date range being synced
* Contact support if data consistently appears to be missing

### Certificate Issues

**Problem**: Authentication fails with certificate errors

**What to check**:

* Confirm you uploaded the certificate provided by cxconnect.ai to Salesforce
* Make sure the certificate hasn't expired
* Verify you used the correct Client ID when requesting the certificate
* Contact cxconnect.ai support if certificate issues persist

## Need Help?

This connector requires technical setup. If you need assistance:

* **Email Support**: [help@cxconnect.ai](mailto:help@cxconnect.ai) (we can help walk you through the setup)
* **Salesforce Documentation**: [Salesforce Developer Docs](https://developer.salesforce.com/docs)
