Salesforce

Learn how to integrate our Conversational AI platform with Salesforce for enhanced customer relationship management

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.

Salesforce Integration Demo

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.

1

Initial Customer Inquiry

Configure your agent to gather customer information and identify their needs, asking relevant questions about their business requirements and current challenges.

2

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
3

Lead Qualification

If the customer is new or requires follow-up:

  • Collect comprehensive contact information
  • Assess business needs and qualification criteria
  • Determine the appropriate sales process or routing
4

Record Creation

  • Use the salesforce_create_record tool after information verification
  • Create leads, contacts, or opportunities as appropriate
  • Confirm record creation with the customer
  • Inform them about next steps in the sales process

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

  1. Log into your Salesforce org as an administrator
  2. Go to SetupApp Manager (or search “App Manager” in Quick Find)
  3. Click New External Client App
  4. Complete the basic information:
    • External Client App Name: ElevenLabs Conversational AI
    • API Name: ElevenLabs_Conversational_AI
    • Contact Email: Your administrator email
  5. 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
  6. Click Save
  7. 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.

  1. Enable Client Credentials Flow:

    • In your External Client App, go to ManageEdit 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
  2. 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 SetupCompany Information
    • Look for your My Domain URL or Organization information

    Method 3: Setup → Domain Management

    • Go to SetupDomain ManagementMy 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.

  3. 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

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

Create auth connection

Click Create auth connection to add your configuration.

4

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 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).

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:

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://your-domain.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 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

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

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:

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

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

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.

Additional Resources