Salesforce
Overview
Your conversational AI agents can access customer data, manage leads, and create opportunities directly within Salesforce. You can streamline CRM processes by automatically retrieving customer information, checking for existing records, and securely creating new records like leads and opportunities. Benefits include faster customer qualification, reduced manual data entry, and enhanced customer experience through personalized interactions.
Demo Video
Watch the demonstration of the Salesforce & Conversational AI integration.
How it works
We lay out below how we have configured the Conversational AI agent to manage customer relationships by using tool calling to step through the CRM process. Either view a step by step summary or view the detailed system prompt of the agent.
High level overview
Detailed system prompt
Initial Customer Inquiry
Configure your agent to gather customer information and identify their needs, asking relevant questions about their business requirements and current challenges.
Customer Data Lookup
Configure the agent to check for existing customer records by:
- Using the
salesforce_search_records
tool to find existing contacts, accounts, or leads - Retrieving customer history and previous interactions
- Extracting relevant details via the
salesforce_get_record
tool - Using this information to personalize the conversation
This integration enhances sales efficiency by leveraging existing customer data and automating lead qualification. Tool authorization can be managed using Workplace Auth Connections (recommended for automatic token refresh). The tools are configured to return human-readable names and descriptions rather than technical IDs to improve conversation quality.
Authentication Setup
Before configuring the tools, you must set up OAuth 2.0 authentication with Salesforce using an External Client App.
Step 1: Create an External Client App in Salesforce
- Log into your Salesforce org as an administrator
- Go to Setup → App Manager (or search “App Manager” in Quick Find)
- Click New External Client App
- Complete the basic information:
- External Client App Name: ElevenLabs Conversational AI
- API Name: ElevenLabs_Conversational_AI
- Contact Email: Your administrator email
- In the API (Enable OAuth Settings) section:
- Check Enable OAuth Settings
- Callback URL:
https://api.elevenlabs.io/oauth/callback
(or your specific callback URL) - OAuth Start URL:
https://api.elevenlabs.io/oauth/start
(required field) - Selected OAuth Scopes: Add these scopes:
- Full access (full)
- Perform requests on your behalf at any time (refresh_token, offline_access)
- Manage user data via api
- Click Save
- Copy the Consumer Key and Consumer Secret - you’ll need these for authentication
Step 2: Configure OAuth Client Credentials Flow
The Client Credentials Flow is recommended for server-to-server integrations where no user interaction is required. Ensure your Salesforce admin has enabled this flow.
-
Enable Client Credentials Flow:
- In your External Client App, go to Manage → Edit Policies
- In OAuth Policies, select Client Credentials Flow
- Run As: Select your admin user (or a dedicated service account user)
- Set Permitted Users to Admin approved users are pre-authorized
- Click Save
Important: The “Run As” user determines the permissions for all API calls. Choose a user with:
- System Administrator profile, OR
- A custom profile with the necessary permissions for your use case
- Access to the objects you want to query/create (Contact, Lead, Account, etc.)
- API Enabled permission must be checked
-
Find Your Salesforce Domain: Your Salesforce domain is required for API calls. Here’s how to find it:
Method 1: Check Your Current URL (Easiest) When logged into Salesforce, look at your browser’s address bar:
- Lightning Experience:
https://yourcompany.lightning.force.com/
- My Domain:
https://yourcompany.my.salesforce.com/
Method 2: Setup → Company Information
- Go to Setup → Company Information
- Look for your My Domain URL or Organization information
Method 3: Setup → Domain Management
- Go to Setup → Domain Management → My Domain
- Your domain will be shown at the top of the page
Common Domain Formats:
https://yourcompany.my.salesforce.com
(My Domain)https://yourcompany.lightning.force.com
(Lightning)https://yourcompany.develop.my.salesforce.com
(Sandbox)
Note: Use the full domain without trailing slash for API calls.
- Lightning Experience:
-
Setup Complete: You have now created the External Client App and configured Client Credentials Flow. The Consumer Key and Consumer Secret will be used for token generation in the tool authorization step.
Tool Configurations
The integration with Salesforce employs three primary webhook tools to manage customer relationships. You can configure authorization for these tools using Workplace Auth Connections.
Authorization - Workplace OAuth2 Connection
Configure Salesforce Connection
Fill in the following fields for your Salesforce integration:
Connection Name: Salesforce CRM
Client ID
- Your Consumer Key from the External Client App
- Example:
3MVG9JJlvRU3L4pRiOu8pQt5xXB4xGZGm0yW...
Client Secret
- Your Consumer Secret from the External Client App
- Example:
1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF...
Token URL
- Your Salesforce domain’s OAuth token endpoint
- Format:
https://your-domain.my.salesforce.com/services/oauth2/token
- Example:
https://mycompany.my.salesforce.com/services/oauth2/token
Scopes (optional)
- OAuth scopes for Salesforce API access
- Recommended:
full, api, refresh_token
- Leave blank to use default scopes from your External Client App
Extra Parameters (JSON)
- Additional OAuth parameters specific to your setup
- Example for Client Credentials flow:
Workplace Auth Connections automatically handles token refresh, eliminating the need for manual token management and improving reliability of your Salesforce integration.
Tool Configurations
Use the tabs below to review each tool’s configuration. Remember to add Workplace Auth Connection to the tool (OAuth2).
salesforce_search_records
salesforce_get_record
salesforce_create_record
Name: salesforce_search_records
Description: Searches for existing records in Salesforce using SOQL queries. Always returns human-readable information including Names, not just IDs.
Method: GET
URL: https://your-domain.my.salesforce.com/services/data/v58.0/query/?q={soql_query}
Headers:
- Content-Type:
application/json
Query Parameters:
- q: SOQL query string (e.g., “SELECT Id, Name, Email FROM Contact WHERE Email = ‘example@email.com’”)
Tool JSON:
Common SOQL Queries
Here are some commonly used SOQL queries for the salesforce_search_records
tool. It can be useful to consider this structure when customizing system/tool prompt. All queries prioritize human-readable information over technical IDs:
Search for Contacts by Email
Search for Leads by Email or Phone
Search for Accounts by Name
Search for Recent Opportunities
Search for Opportunities by Account
Integration Testing
Test your Salesforce integration thoroughly before deploying to production. The following steps will help you validate that all components are working correctly.
Testing Your Integration
After setting up your External Client App and configuring the webhook tools, test your integration to ensure everything works correctly:
Agent Testing
Test your integration with your conversational AI agent:
- Test Search Functionality: Ask your agent to search for existing contacts
- Test Record Creation: Have your agent create a new lead or contact
- Test Data Retrieval: Verify your agent can get detailed customer information
Impact
With this integration in place, you can:
- Accelerate Lead Qualification: Automatically qualify leads and gather essential information
- Improve Data Quality: Ensure consistent and accurate customer data entry
- Enhance Customer Experience: Provide personalized interactions based on existing customer data
- Increase Sales Efficiency: Reduce manual data entry and focus on high-value activities
- Track Performance: Monitor conversion rates and lead quality metrics
Security Considerations
- Use HTTPS endpoints for all API calls
- Store sensitive values as secrets using the ElevenLabs Secrets Manager
- Implement proper OAuth 2.0 token management and refresh logic
- Follow Salesforce security best practices for External Client Apps
- Ensure proper field-level security is configured in Salesforce
- Regularly audit API access and usage
Common Salesforce Objects
Conclusion
This guide details how to integrate Salesforce into our conversational AI platform for comprehensive customer relationship management. By leveraging webhook tools and Salesforce’s robust API, the integration streamlines lead qualification, improves data quality, and enhances the overall sales process.
For additional details on tool configuration or other integrations, refer to the Tools Overview.