Salesforce
Overview
Connect your ElevenLabs AI agents with Salesforce CRM to access customer data, manage leads, and create opportunities. This integration enables your agents to retrieve existing customer records, create new leads and contacts, and query Salesforce objects during conversations.
Setup
This integration uses Salesforce OAuth 2.0 Client Credentials for authentication. You will need to create an External Client App in Salesforce.
Create an External Client App
- Log into your Salesforce org as an administrator
- Go to Setup > External Client App Manager
- Click New External Client App
- Fill in the External Client App Name (e.g.,
ElevenLabs Agents), API Name, and Contact Email - Under API (Enable OAuth Settings):
- Check Enable OAuth and Enable Client Credentials Flow
- Callback URL:
https://api.elevenlabs.io/oauth/callback - OAuth Start URL:
https://api.elevenlabs.io/oauth/start - 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 Create
- On the app page, open the Settings tab, go to OAuth Settings, and click Consumer Key and Secret
- Copy the Consumer Key and Consumer Secret — you will need these for authentication
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.
- In your External Client App, click Edit
- Check Enable Client Credentials Flow — a Run As field will appear
- Set Run As to your admin user or a dedicated service account — this determines the permissions for all API calls
- Set Permitted Users to Admin approved users are pre-authorized
- Click Save
The Run As user determines the permissions for all API calls. Choose a user with a System Administrator profile or a custom profile that has API access and permission to the objects your agent needs (Contact, Lead, Account, etc.). The API Enabled permission must be checked on the user record.
Find your Salesforce domain
Your Salesforce domain is required for API calls.
Method 1: Check your current URL
When logged into Salesforce, look at your browser’s address bar:
- Lightning Experience:
https://acme.lightning.force.com/ - My Domain:
https://acme.my.salesforce.com/
Method 2: Setup > Company Information
Go to Setup > Company Information and 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://acme.my.salesforce.com(My Domain)https://acme.lightning.force.com(Lightning)https://acme.develop.my.salesforce.com(Sandbox)
Demo video
This demo uses legacy webhook tools. If you’re using the native Salesforce integration, the tools are configured automatically — no manual webhook setup is needed.
How it works
High-level overview
Detailed system prompt
Initial customer inquiry
The agent gathers customer information and asks relevant questions to identify their business requirements and current challenges.
Customer data lookup
The agent checks for existing records using salesforce_search_records to find contacts, accounts, or leads. It retrieves full details with salesforce_get_record and uses this information to personalize the conversation.
Tool authorization can be managed using Workplace Auth Connections, which handles token refresh automatically. The tools return human-readable names and descriptions rather than technical IDs to improve conversation quality.
Tool configurations
Three webhook tools are available: salesforce_search_records, salesforce_get_record, and salesforce_create_record. Configure authorization for each using a Workplace Auth Connection.
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://{domain}.my.salesforce.com/services/oauth2/token - Example:
https://acme.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 handles token refresh automatically, so you do not need to manage tokens manually.
Webhook tool configurations
Add a Workplace Auth Connection (OAuth2) to each tool in the Authentication section. Use the tabs below to review each tool’s configuration.
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://acme.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 Salesforce objects
Common SOQL queries
Use these SOQL queries as starting points when customizing your agent’s system prompt. All queries return human-readable information rather than 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
After setting up your External Client App and connecting the integration, test it before deploying to production:
- Search functionality: Ask your agent to search for existing contacts.
- Record creation: Have your agent create a new lead or contact.
- Data retrieval: Verify your agent can retrieve detailed customer information.
Security considerations
- Use HTTPS endpoints for all API calls.
- Ensure proper field-level security is configured in Salesforce.
- The Run As user’s permissions determine what data the integration can access — scope them appropriately.
- Regularly audit API access and usage.