HubSpot
Overview
Leveraging the HubSpot integration, your agent can interact with your CRM both to retrieve and write relevant information about contacts, interactions, or follow ups.
Demo video
Watch the demonstration of the HubSpot + Conversational AI integration.
How it works
Here is an example of how a Conversational AI agent can interact with your HubSpot CRM using tool calling. Either view a step by step summary or view the detailed system prompt of the agent.
High level overview
Detailed system prompt
Customer Identification
You can configure your agent to ask for an identification item such as email, and prompt it use a tool we called search_contact
to search your CRM for that email to verify whether this customer exists.
Understand Call Intent
Configure the agent to ask about the caller’s intent. This can be adapted to meet your particular workflow.
Get previous interactions
While previous interactions can also be fetched and passed at the beginning of the conversation (see Personalization). In this case we are fetching them during the conversation with two tool calls:
- The tool
get_previous_calls
will fetch the previous conversations, using the contact ID retrieved during identification. - The response does not include the content of those conversations, so we need to use another endpoint to fetch the content with those call IDs.
This integration enhances agent efficiency by leveraging CRM interactions. All API calls require proper secret handling in the authorization headers.
Authentication Setup
Before configuring the tools, you must set up authentication with HubSpot.
Step 1: Generate HubsPot API Token
- Log into your HubSpot account
- Navigate to Account Management → Integrations → Private Apps
- Create a Private App
- Add the required scopes to the private app, to ensure it can interact with the required endpoints
- Save and get the Access token from the Auth section
Step 2: Create Authentication Secret
The HubSpot API requires Bearer authentication. You need to create a properly formatted secret:
-
Create the secret value by adding “Bearer ” prefix:
-
Save this as a secret in your agent’s secrets with name
hubspot_key
Tool Configurations
This sample integration with HubSpot employs four webhook tools. Use the tabs below to review each tool’s configuration.
search_contact
get_previous_calls
get_call_content
create_ticket
Name: search_contact
Description: Search for a contact with an email.
Method: POST
URL: https://api.hubapi.com/crm/v3/objects/contacts/search
Headers:
- Content-Type:
application/json
- Authorization: (Secret:
hubspot_key
)
Body Parameters:
- filtersGroups: An array containing:
- An object containing:
- filters: An array containing:
- An object containing:
- value: A string with description:
Set to the email provided by the user. Email should be in format: "name@address.com"
- propertyName: A string with description:
Set to: "email"
- operator: A string with description:
Set to: "CONTAINS_TOKEN"
- value: A string with description:
- An object containing:
- filters: An array containing:
- An object containing:
Tool JSON:
Here is the tool JSON that can be copied into the tool config:
Security Considerations
- Use HTTPS endpoints for all webhook calls.
- Store sensitive values as secrets using the ElevenLabs Secrets Manager.
- Validate that all authorization headers follow the required format.
Conclusion
This guide details how to integrate HubSpot CRM with our conversational AI platform. By leveraging webhook tools, the integration empowers AI agents to act more effectively in usecases such as sales, customer management, or support.
For additional details on tool configuration or other integrations, refer to the Tools Overview.