All guides
Integrations Advanced 10 min read

Salesforce CRM Integration

Create and manage leads, deals and contacts directly in your Salesforce account.

Overview

The Salesforce CRM integration allows your agent to create and manage leads, deals, and contacts directly in your Salesforce account. This enables your AI assistant to perform CRM operations without human intervention, streamlining your sales process and customer management.

Connected App creation in Salesforce

  1. Log in as an administrator
  2. Navigate to Setup > App Manager
App Manager
  1. Click New Connected App
  2. Fill in: Connected App Name = MyChatBot Integration; API Name = MyChatBot_Integration_API; Contact Email; check Enable OAuth Settings; Callback URL = https://app.mychatbot.app and https://app.mychatbot.app/integration
Set app name

Select OAuth scopes: Access and manage your data (api) and Perform requests at any time (refresh_token, offline_access).

OAuth scopes
  1. Click Save and wait for the app to be created
  2. Click Manage Consumer Details
  3. Note your Consumer Key (Client ID) and Consumer Secret (Client Secret)
Copy credentials
  1. For security, set IP relaxation to "Relax IP restrictions" and check Enable Token Exchange Flow
Connected app settings

Creating integration on MyChatBot

  1. Navigate to the Integrations tab in your dashboard
  2. Select the agent you want to connect to Salesforce
Select agent
  1. Scroll down to find Salesforce CRM in the integrations list
  2. Click Connect
  3. Provide Domain (e.g. your-company.my.salesforce.com), Client ID (Consumer Key) and Client Secret (Consumer Secret)
Pass credentials
  1. Click Submit to save your integration

Entities & data fields configuration

After connecting, configure which entities and fields your agent can access:

Entity config

Toggle Use Leads and Use Deals. For each entity select standard Salesforce fields and custom fields, then click Apply fields.

Entity types: Leads, Deals (called Orders in Salesforce), Contacts, Accounts. Field types: Standard and Custom. Special fields: Status (values like "New", "Working", "Qualified", "Converted"; must match Salesforce), LeadSource (auto-set to "AI-" + assistant name), Order Start Date (required when creating a deal/order), Products (used in deal creation; each needs name, quantity, optional price). Products: add products via the products parameter in create_crm_deal, each needs name (required), quantity (required), price (optional, uses standard price otherwise). Products must already exist in your Salesforce Pricebook.

Available tools

After connecting, your agent gets four tools:

1. create_crm_lead, creates leads (full_name, phone, Status, custom fields). A contact and account are auto-created/found by name and phone, lead linked, source identifies the AI.

2. edit_crm_lead, updates existing leads (full_name, phone, Status, custom fields).

3. create_crm_deal, creates deals/orders (full_name required, phone required, Order Start Date required, Status defaults to "Draft", products [name, quantity, price], custom fields). Contact and account auto-created/found, products added if found in the Pricebook.

4. add_crm_client_contact, creates/updates contacts (full_name required, phone required). Updates an existing lead and creates a new contact record.

Configuration in agent instructions

Creating deals:

When a customer confirms a purchase intention, use create_crm_deal in Salesforce:
- Use their full name
- Include their phone number
- Set Order Start Date to today's date in format YYYY-MM-DD
- Add products they're interested in:
  [ { "name": "Product Name", "quantity": 1, "price": 99.99 } ]
- Set Status to "Draft"

Updating lead status:

When a customer requests a call back:
1. Use edit_crm_lead to update the lead status to "Working"

When a customer confirms interest:
1. Use edit_crm_lead to update the lead status to "Qualified"