Skip to content

Hubspot CRM Integration

Overview

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

API Key Creation on Hubspot

  1. Log in to your Hubspot account as an administrator
  2. Navigate to Settings > Integrations > Private Apps Hubspot App Creation
  3. Click Create a private app
  4. Provide a name for your App key (e.g., "MyChatBot Integration") Hubspot App Creation
  5. Select all scopes to allow necessary access, including:
    • CRM
    • CMS
    • Communication preference
    • Marketing
    • Settings
    • Other
  6. Click Create App to generate your API key
  7. Make note of your API key - you'll need this to set up the integration in MyChatBot Hubspot App Creation

Creating Integration on MyChatBot

  1. Navigate to the Integrations tab in your MyChatBot dashboard - https://app.mychatbot.app/integration?integration=Hubspot
  2. Select the agent you want to connect to Hubspot Creating Integration on MyChatBot
  3. Scroll down to find Hubspot CRM in the integrations list
  4. Click the Connect button
  5. You'll need to provide the following credential:
    • API Key: The API Key you created in Hubspot Creating Integration on MyChatBot
  6. Click Submit to save your integration

Entities & Data Fields Configuration

After connecting your Hubspot account, you'll need to configure which entities and fields your agent can access: 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 entity type, you can select:
    • Standard fields from Hubspot
    • Custom fields that exist in your CRM
  3. Click Apply fields to save your configuration
  4. If you need to sync the latest pipeline stages, use the Sync statuses button at the top

Understanding Entity Types

Hubspot integration supports three main entity types:

  • Leads: Potential sales opportunities
  • Deals: Sales transactions in progress
  • Contacts: Individual client information

Field Types

Each entity has two types of fields:

  • Standard Fields: Default fields provided by Hubspot (appear under "Standard fields")
  • Custom Fields: User-defined fields specific to your CRM setup (appear under "Custom fields")

Special Fields

Several special fields require specific attention:

  1. Status

    • For leads: Represents the current stage in the lead pipeline
    • Common values include "New", "In Progress", "Qualified", "Disqualified"
    • Must match exactly with statuses defined in your Hubspot account
  2. hs_pipeline_stage

    • The unique identifier for a specific stage in your pipeline
    • Used as an alternative to Status when you need to reference a specific stage by ID
  3. lead_custom_source

    • Identifies where the lead originated
    • Automatically set to "AI-" + name of your assistant
    • This helps track which leads came from your AI assistant
  4. deal_source

    • Identifies where the deal originated
    • Automatically set to the communication channel or "AI"
    • This helps track which deals came from your AI assistant
  5. lead_chat_link and deal_chat_link

    • Automatically added to each lead or deal
    • Contains a link back to the conversation that generated the lead/deal

Working with Products

Deals in Hubspot can include products as line items:

  1. You can add products to deals using the products parameter in the create_crm_deal function
  2. Each product should include:
    • name: Product name
    • sku: Product SKU (required if creating a new product)
    • price: Product price
    • quantity: Number of items

Products can be referenced by:

  • product_id: If you know the Hubspot product ID
  • line_item_id: If you know the specific line item ID
  • name and sku: To look up or create a product

Available Tools

After connecting Hubspot CRM, your agent will have access to four powerful tools:

1. create_crm_lead

This tool allows your agent to create new leads with the following parameters:

  • full_name: Contact's full name
  • phone: Contact's phone number
  • Status: Current stage in the sales pipeline
  • hs_pipeline_stage: Pipeline stage ID (alternative to Status)
  • Custom Fields: Any additional fields you've configured

All fields you select in the "Entities & Data Fields Configuration" section will be available as parameters for this function.

When a lead is created:

  • A contact is automatically created or found based on the phone number
  • The lead is linked to this contact
  • A chat link is automatically added to trace back to the conversation
  • The source is set to identify your AI assistant

2. edit_crm_lead

This tool enables your agent to update existing leads:

  • full_name: Update the contact's name
  • phone: Update the contact's phone
  • Status: Update the lead's status/stage
  • hs_pipeline_stage: Update the lead's pipeline stage ID
  • Custom Fields: Update any field values as needed

All fields you select in the "Entities & Data Fields Configuration" section will be available as parameters for this function.

3. create_crm_deal

This tool allows your agent to create new deals with the following parameters:

  • full_name: Contact's full name (required)
  • phone: Contact's phone number (required)
  • products: Optional list of products to add to the deal, each with:
    • name: Product name
    • sku: Product SKU
    • price: Product price
    • quantity: Number of units
  • Deal Stage: Current stage in the pipeline
  • Custom Fields: Any additional fields you've configured

All fields you select in the "Entities & Data Fields Configuration" section will be available as parameters for this function.

When a deal is created:

  • A contact is automatically created or found based on the phone number
  • The deal is linked to this contact
  • Products are added to the deal (creating new products if needed)
  • A chat link is automatically added
  • The order information is tracked by MyChatBot internal system

4. add_crm_client_contact

This tool enables your agent to create or update contacts:

  • full_name: Contact's complete name (required)
  • phone: Primary phone number (required)

When a contact is created:

  • If a lead already exists for the client, it's updated with this contact information
  • The client's information in MyChatBot is also updated

The client status is tracked by the internal MyChatBot system

Configuration in Agent Instructions

Creating Leads or Deals

Include these examples in your agent's instructions to enable lead/deal creation:

When a customer expresses interest in our services, use create_crm_lead in Hubspot with the following information:
- Use their name as full_name
- Include their phone number
- Set Status to "New" 
- Add any relevant information to other fields

For deals:

When a customer confirms a purchase intention, use create_crm_deal in Hubspot:
- Use their full name
- Include their phone number
- Add products they're interested in:
  [
    {
      "name": "Product Name",
      "sku": "SKU123",
      "price": "99.99",
      "quantity": 1
    }
  ]
- Set Deal Stage to "Appointment Scheduled"

Updating Lead Status

Include these examples to enable status updates:

When a customer requests a call back:
1. Use edit_crm_lead to update the lead status to "In Progress"
2. Add the preferred callback time to the comments

When a customer confirms interest:
1. Use edit_crm_lead to update the lead status to "Qualified"
2. Add any additional details needed

Adding Contacts

Include these examples to enable contact creation:

When interacting with a new customer:
1. Use add_crm_client_contact to create a new contact with:
   - Their full name
   - Their phone number
2. Let them know their information has been registered
3. Proceed with the conversation flow