Setup takes about 30 minutes. You need a Salesforce System Administrator profile and admin access in OpenCX.
Before you start
Salesforce edition with API access
Salesforce edition with API access
Enterprise, Unlimited, or Developer edition. Professional edition requires API access to be enabled separately.
System Administrator profile in Salesforce
System Administrator profile in Salesforce
You need to create a Connected App, a Named Credential, an Apex Class, and an Apex Trigger. Standard user roles cannot reach these.
Owner or admin in OpenCX
Owner or admin in OpenCX
Required to save integration settings in Settings → Integrations.
Setup
Create a Connected App in Salesforce
In Salesforce, go to Setup → Apps → App Manager and click New Connected App.
- Fill in the basic information (App Name, API Name, Contact Email).
- Under API (Enable OAuth Settings), check Enable OAuth Settings.
- Set the Callback URL to:
- Select scopes: Full access (full) and Perform requests at any time (refresh_token, offline_access).
- Check Require Secret for Web Server Flow.
- Check Require Secret for Refresh Token Flow.
- Click Save.
Enter credentials and connect
In your OpenCX dashboard, open Salesforce and select the Email tab.
Click Save Credentials, then click Connect to Salesforce. A Salesforce login window opens — authorize the connection. When you return to OpenCX, the status shows Connected.
| Field | Value |
|---|---|
| Client ID | The Consumer Key from your Connected App. |
| Client Secret | The Consumer Secret from your Connected App. |
| Login URL | https://login.salesforce.com for production. Use https://test.salesforce.com for sandbox environments. |
| Redirect URI | Auto-populated. Do not change this value. |
Configure the webhook in Salesforce
After connecting, OpenCX displays a Webhook URL. Copy it.Create a Named Credential in Salesforce:Create the Apex Trigger:Go to Setup → Apex Triggers, click New, select Case as the object, and paste:
- Go to Setup → Named Credentials and click New Named Credential.
- Set Name to
OpenCX_Integration. - Paste the webhook URL into the URL field.
- Set Identity Type to
Anonymous. - Leave Authentication Protocol as
No Authentication. - Save.
Verify end to end
Send a test email to an address connected to OpenCX. Escalate the conversation (or ask to speak with a human). Within a few seconds:
- A Case appears in Salesforce with
Case_From__cset toopencx. - Reply on the Case from Salesforce.
- The reply appears as an agent message on the matching session in your OpenCX Inbox.
How handoff lands in Salesforce
When triggers, OpenCX:- Creates a Salesforce Case with the conversation topic as Subject and the AI summary as Description.
- Sets
Case_From__ctoopencxso your views and reports can filter to AI-escalated cases. - Attaches the full transcript as Case comments.
- Stores the Salesforce Case ID on the OpenCX session for tracing.
- When your rep replies on the Case, the webhook fires and OpenCX delivers the reply to the contact’s inbox.
- When the Case is closed, the OpenCX session resolves.
If the same contact re-engages before the Case is closed, OpenCX appends to the existing Case instead of opening a new one.
Disconnecting
In OpenCX, open the Salesforce integration and click Disconnect. Then in Salesforce, delete the Named Credential (OpenCX_Integration) and the Apex Trigger/Class you created. Cases created while the integration was active remain untouched.
Related Documentation
AI Email in Salesforce
Per-channel implementation details for email handoff.
Live Messaging
The path for chat, SMS, WhatsApp, and phone channels.
Troubleshooting
OAuth errors, missing Cases, webhook issues.
Handoff settings
Global handoff rules and office hours.