Skip to content

Salesforce CRM Integration ​

Let your MyChatBot agent create and manage leads, deals, and contacts directly in Salesforce β€” no human in the loop. This connects your AI assistant to Salesforce CRM so it can run sales operations automatically as it chats with customers.

At a glance ​

You needWhereResult
A Connected App (Consumer Key + Secret)Salesforce β†’ Setup β†’ App ManagerOAuth credentials for MyChatBot
Callback URLs + OAuth scopes setConnected App β†’ OAuth SettingsApp can request api + refresh_token access
Token Exchange Flow + IP relaxation enabledConnected App β†’ SettingsConnection succeeds
Domain + Client ID + Client SecretMyChatBot β†’ Integrations β†’ SalesforceIntegration connected to your agent
Entities & fields toggledEntities & Data Fields ConfigurationAgent can create/update leads, create deals, and add contacts

Connect in 3 steps: create a Salesforce Connected App β†’ paste Domain / Client ID / Client Secret into MyChatBot β†’ configure entities & fields.

1. Create a Connected App in Salesforce ​

  1. Log in to Salesforce as an administrator.
  2. Navigate to Setup β†’ App Manager. Connected App Creation in Salesforce
  3. Click New Connected App.
  4. Fill in the required information:
    • Connected App Name: MyChatBot Integration
    • API Name: MyChatBot_Integration_API
    • Contact Email: Your email address
    • Enable OAuth Settings: Check this box
    • Callback URL: https://app.mychatbot.app and https://app.mychatbot.app/integrationConnected App Creation in Salesforce
    • Selected OAuth Scopes:
      • Access and manage your data (api)
      • Perform requests at any time (refresh_token, offline_access) Connected App Creation in Salesforce
  5. Click Save and wait for the app to be created.
  6. After creation, click Manage Consumer Details. Connected App Creation in Salesforce
  7. Note your Consumer Key (Client ID) and Consumer Secret (Client Secret). Connected App Creation in Salesforce
  8. For security, set IP relaxation to Relax IP restrictions and check Enable Token Exchange Flow. Connected App Creation in Salesforce

WARNING

The connection will not complete unless Enable Token Exchange Flow is checked and IP relaxation is set to Relax IP restrictions on the Connected App. Set both before submitting credentials on MyChatBot.

2. Create the integration on MyChatBot ​

In the app

Go to Integrations and open the Salesforce card: https://app.mychatbot.app/integration?integration=Salesforce. Pick the agent you want to connect, then click Connect and paste in your credentials.

  1. Open the Integrations tab in your MyChatBot dashboard.
  2. Select the agent you want to connect to Salesforce. Creating Integration on MyChatBot
  3. Scroll down to find Salesforce CRM in the integrations list.
  4. Click Connect.
  5. Provide the following credentials:
    • Domain: Your Salesforce domain (e.g., your-company.my.salesforce.com)
    • Client ID: The Consumer Key from your Salesforce Connected App
    • Client Secret: The Consumer Secret from your Salesforce Connected App Creating Integration on MyChatBotSelecting the agent and entering Salesforce Domain, Client ID, and Client Secret on the Salesforce integration card
  6. Click Submit to save your integration.

3. Configure entities & data fields ​

Once Salesforce is connected, the Entities & Data Fields Configuration section appears β€” "Select the entities and their fields you want the assistant to fill." This is where you choose exactly what your agent is allowed to read and write.

Entities & Data Fields Configuration

  1. In the Entities & Data Fields Configuration section you can:
    • Toggle Use Leads to enable lead management.
    • Toggle Use Deals to enable deal management.
  2. For each enabled entity, pick which fields the agent may fill:
    • Standard fields for Leads / Deals β€” the default Salesforce fields.
    • Most used custom fields and Other custom fields β€” the custom fields that exist in your CRM.
    • Select Pipeline β€” where relevant, choose the pipeline the entity should land in.
  3. Under Phone Lead/Deal/Entity Settings you can mark phone as required per entity (Lead Phone Required, Deal Phone Required, Entity Phone Required).
  4. Click Apply fields to save your configuration.

Only the fields you enable here are ever offered to the agent, so this section doubles as a guardrail on what it can touch.

Entity types ​

The Salesforce integration works with four entity types:

  • Leads: Potential sales opportunities.
  • Deals: Sales transactions (called Orders in Salesforce).
  • Contacts: Individual client information.
  • Accounts: Organizations that contacts belong to.

Field types ​

Each entity has two kinds of fields:

  • Standard Fields: Default fields provided by Salesforce.
  • Custom Fields: Fields specific to your own CRM setup.

Special fields ​

A few fields need extra attention:

  1. Status
    • For leads: the current stage in the lead pipeline.
    • Common values include "New", "Working", "Qualified", "Converted".
    • Must match exactly the statuses defined in your Salesforce account.
  2. LeadSource
    • Identifies where the lead originated.
    • Automatically set to AI- + the name of your assistant, so you can tell at a glance which leads came from your AI assistant.
  3. Order Start Date
    • Required when creating a deal (order).
    • Specifies when the order begins.
  4. Products
    • Used in deal creation to specify products to add to the order.
    • Each product needs a name, a quantity, and optionally a price.

WARNING

Status values must match the statuses defined in your Salesforce account exactly, and any product referenced in a deal must already exist in your Salesforce Pricebook β€” otherwise the order will not be created.

Working with products ​

Deals in Salesforce can include products as order items. When your agent creates a deal, each product it adds should include:

  • name: Product name (required).
  • quantity: Number of items (required).
  • price: Unit price (optional; the standard Pricebook price is used if you don't specify one).

Products must already exist in your Salesforce Pricebook for the order to be created successfully.

What your agent can do in Salesforce ​

Once connected, your agent can act in Salesforce on its own as it talks to customers. It can use whatever fields you enabled under Entities & Data Fields Configuration.

CapabilityWhat the agent doesTypical trigger
Create a leadAdds a new lead, plus the contact and account behind itA customer shows interest
Update a leadChanges an existing lead's status, name, phone, or other fieldsA lead progresses (e.g. requests a call back, confirms interest)
Create a dealCreates an order, links it to the contact/account, and adds productsA customer confirms they want to buy
Add a contactCreates or updates a client contact recordYou want a new customer on file

Create a lead ​

Captures a new lead using the name, phone, status, and any custom fields you enabled. When a lead is created:

  • A contact and account are automatically created or matched from the full name and phone number.
  • The lead is linked to that contact.
  • The source is stamped to identify your AI assistant.

Update a lead ​

Updates an existing lead β€” its status/stage, the contact's name or phone, or any other enabled field.

Create a deal ​

Creates a new deal (order). It needs the customer's full name, phone, and an Order Start Date; Status defaults to "Draft" if you don't set one, and you can pass a list of products. When a deal is created:

  • A contact and account are automatically created or matched from the full name and phone number.
  • The order is linked to that contact and account.
  • Products are added to the order (when specified and found in the Pricebook).
  • MyChatBot also records the order against the client's chat record so you can see it in your dashboard.

Add a contact ​

Creates or updates a contact from a full name and phone number. When a contact is added:

  • If a lead already exists for that client, it's updated with this contact information.
  • A new contact record is created in Salesforce.
  • The client's details in MyChatBot are updated to match, so the two stay in sync.

Guiding the agent with instructions ​

Your agent decides when to act based on its instructions. Add plain-language rules like the ones below to your agent's instructions so it knows when to create or update records β€” no function names needed, just describe the business action.

Creating leads or deals ​

When a customer expresses interest in our services, create a new lead in Salesforce:
- Use their name as the full name
- Include their phone number
- Set Status to "New"
- Fill in any other relevant fields

For deals:

When a customer confirms they want to buy, create a deal (order) in Salesforce:
- Use their full name and phone number
- Set the Order Start Date to today's date in YYYY-MM-DD format
- Add the products they're interested in (name, quantity, and price if it differs
  from the standard price)
- Set Status to "Draft"

Updating lead status ​

When a customer requests a call back, update their lead's Status to "Working"
and note any important details in the relevant fields.

When a customer confirms interest, update their lead's Status to "Qualified"
and refresh their contact information if needed.

Adding contacts ​

When you start talking with a new customer, add them as a contact in Salesforce
with their full name and phone number, let them know they've been registered,
and continue the conversation.

See also ​