Salesforce

Connect your ElevenLabs agents with Salesforce CRM

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.

1

Create an External Client App

  1. Log into your Salesforce org as an administrator
  2. Go to Setup > External Client App Manager
  3. Click New External Client App
  4. Fill in the External Client App Name (e.g., ElevenLabs Agents), API Name, and Contact Email
  5. 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
  6. Click Create
  7. On the app page, open the Settings tab, go to OAuth Settings, and click Consumer Key and Secret
  8. Copy the Consumer Key and Consumer Secret — you will need these for authentication
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.

  1. In your External Client App, click Edit
  2. Check Enable Client Credentials Flow — a Run As field will appear
  3. Set Run As to your admin user or a dedicated service account — this determines the permissions for all API calls
  4. Set Permitted Users to Admin approved users are pre-authorized
  5. 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.

3

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)
Use the full domain without a trailing slash.
4

Connect in ElevenLabs

In the ElevenLabs integration setup, enter your Salesforce instance hostname (e.g., acme.my.salesforce.com), Client ID (Consumer Key), and Client Secret (Consumer Secret).

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.

Salesforce integration demo

How it works

1

Initial customer inquiry

The agent gathers customer information and asks relevant questions to identify their business requirements and current challenges.

2

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.

3

Lead qualification

If the customer is new, the agent collects contact information, assesses their business needs, and determines the appropriate sales process or routing.

4

Record creation

The agent creates the appropriate record (lead, contact, or opportunity) using salesforce_create_record, confirms creation with the customer, and explains next steps.

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

2

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:
1{
2 "grant_type": "client_credentials"
3}
4

Create auth connection

Click Create auth connection to add your configuration.

5

Use in tool configurations

Once the connection is successful, save it and reference it in your webhook tool configurations in the Authentication section.

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.

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:

1{
2 "type": "webhook",
3 "name": "salesforce_search_records",
4 "description": "Searches for existing records in Salesforce using SOQL queries. Always returns human-readable names and details, not just IDs.",
5 "api_schema": {
6 "url": "https://acme.my.salesforce.com/services/data/v58.0/query/",
7 "method": "GET",
8 "path_params_schema": [],
9 "query_params_schema": [
10 {
11 "id": "q",
12 "type": "string",
13 "description": "SOQL query string to search for records. Always include Name fields and other human-readable information. Example: SELECT Id, Name, Email, Phone, Company FROM Contact WHERE Email = 'customer@example.com'. For Opportunities, include: SELECT Id, Name, StageName, Amount, CloseDate, Account.Name FROM Opportunity",
14 "dynamic_variable": "",
15 "constant_value": "",
16 "required": true,
17 "value_type": "llm_prompt"
18 }
19 ],
20 "request_body_schema": null,
21 "request_headers": [
22 {
23 "type": "value",
24 "name": "Content-Type",
25 "value": "application/json"
26 }
27 ]
28 },
29 "response_timeout_secs": 30,
30 "dynamic_variables": {
31 "dynamic_variable_placeholders": {}
32 }
33}

Common Salesforce objects

ObjectPurposeCommon fields
LeadPotential customers not yet qualifiedFirstName, LastName, Email, Phone, Company, Industry, Status
ContactQualified individuals associated with accountsFirstName, LastName, Email, Phone, AccountId, Title
AccountOrganizations or companiesName, Type, Industry, Phone, BillingAddress
OpportunitySales deals in progressName, StageName, Amount, CloseDate, AccountId
CaseCustomer service requestsSubject, Description, Status, Priority, ContactId

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

1SELECT Id, Name, Email, Phone, Title, Account.Name, Account.Type FROM Contact WHERE Email = 'customer@example.com'

Search for leads by email or phone

1SELECT Id, Name, Email, Phone, Company, Industry, Status, LeadSource, Title FROM Lead WHERE Email = 'customer@example.com' OR Phone = '+1234567890'

Search for accounts by name

1SELECT Id, Name, Type, Industry, Phone, BillingCity, BillingState, Website FROM Account WHERE Name LIKE '%Company Name%'

Search for recent opportunities

1SELECT Id, Name, StageName, Amount, CloseDate, Account.Name, Account.Type, Owner.Name, Description FROM Opportunity WHERE CreatedDate = THIS_MONTH

Search for opportunities by account

1SELECT Id, Name, StageName, Amount, CloseDate, Probability, NextStep, Owner.Name FROM Opportunity WHERE Account.Name LIKE '%Company Name%'

Integration testing

After setting up your External Client App and connecting the integration, test it before deploying to production:

  1. Search functionality: Ask your agent to search for existing contacts.
  2. Record creation: Have your agent create a new lead or contact.
  3. 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.