HubSpot Integration
Sync AssistLoop leads with HubSpot
HubSpot Integration
The AssistLoop HubSpot integration automatically syncs leads from your chat conversations directly to your HubSpot CRM. When customers submit lead forms through your AssistLoop chat interface, their information is instantly created or updated as contacts in HubSpot, eliminating manual data entry and ensuring your CRM stays up-to-date.
Overview
With the AssistLoop HubSpot integration, you can:
- Automatically create contacts in HubSpot when leads submit forms through your chat
- Update existing contacts if a lead with the same email already exists
- Map form fields to HubSpot contact properties automatically
- Sync lead data in real-time via asynchronous background processing
- Handle OAuth authentication securely with automatic token refresh
This integration uses HubSpot's OAuth 2.0 API and follows HubSpot's best practices for secure, reliable data synchronization.
How It Works
Integration Flow
- Customer submits a lead form through your AssistLoop chat interface
- AssistLoop processes the form and stores the lead data
- HubSpot sync job is triggered automatically in the background
- Contact is created or updated in HubSpot based on email address
- Integration status is tracked for monitoring and troubleshooting
Key Features
- Automatic Sync: No manual intervention required - leads sync automatically
- Duplicate Handling: Checks for existing contacts by email before creating new ones
- Field Mapping: Intelligently maps common form fields to HubSpot properties
- Error Handling: Robust error handling with retry logic for transient failures
- Token Management: Automatic OAuth token refresh ensures continuous operation
Installation & Setup
Prerequisites
- An active AssistLoop account
- A HubSpot account (Free, Starter, Professional, or Enterprise)
- Admin access to your HubSpot account to install the integration
Step 1: Install the Integration in HubSpot
- Navigate to the HubSpot App Marketplace
- Search for "AssistLoop" or navigate to the AssistLoop app listing
- Click "Install app" or "Get app"
- Review the required permissions and click "Install"
- You'll be redirected to authorize the connection
Step 2: Authorize the Connection
- You'll be redirected to AssistLoop's integrations page
- Find HubSpot in the list of available integrations
- Click "Connect" next to HubSpot
- You'll be redirected to HubSpot's authorization page
- Review the requested permissions:
- Read contacts: View existing contacts in HubSpot
- Write contacts: Create and update contacts in HubSpot
- Click "Authorize" or "Allow" in HubSpot to approve the connection
- You'll be redirected back to AssistLoop's integrations page
- HubSpot will now show as "Connected" with a green status indicator
Step 3: Enable Lead Collection
- Ensure the "Collect Lead" action is enabled for your agent
- Configure when the action should be triggered by defining the tool's description or conditions
- For example: "Use this tool when the customer tries to reach out to the sales team"
- The action will be triggered based on customer intent matching your configuration
- When triggered, the lead form will be shown to the customer during the conversation
- Any leads collected through the form will automatically sync to HubSpot
- The integration is now fully configured and ready to sync leads
Field Mapping
The integration automatically maps form fields to HubSpot contact properties. Currently, the following fields are supported:
Supported Field Mappings
| Form Field Name | HubSpot Property | Notes |
|---|---|---|
email | email | Required - Contacts must have an email address to be created in HubSpot |
first_name | firstname | First name of the contact |
last_name | lastname | Last name of the contact |
name | firstname + lastname | Automatically split into first and last name (see below) |
phone | phone | Contact phone number |
Name Field Handling
If your form uses a single name field instead of separate first_name and last_name fields, the integration will automatically split it:
- Single word (e.g., "John"): Mapped to
firstnameonly - Multiple words (e.g., "John Doe"): First word becomes
firstname, remaining words becomelastname
Example:
- Form field
name= "John Doe" → HubSpot:firstname= "John",lastname= "Doe" - Form field
name= "John" → HubSpot:firstname= "John",lastname= (empty)
OAuth Authentication
The integration uses OAuth 2.0 for secure authentication with HubSpot. This ensures your HubSpot credentials are never exposed or stored in plain text.
Authentication Flow
- Authorization Request: When you install the app, AssistLoop requests authorization from HubSpot
- User Approval: You approve the requested permissions in HubSpot
- Token Exchange: AssistLoop exchanges the authorization code for access and refresh tokens
- Token Storage: Tokens are encrypted and stored securely
- Automatic Refresh: Access tokens expire after 30 minutes; refresh tokens are used automatically to obtain new access tokens
Required Scopes
The integration requires the following HubSpot OAuth scopes:
crm.objects.contacts.read- Read existing contacts to check for duplicatescrm.objects.contacts.write- Create and update contacts
These scopes are automatically requested during installation and cannot be modified.
Token Management
- Access Tokens: Valid for 30 minutes (1,800 seconds)
- Refresh Tokens: Long-lived tokens used to obtain new access tokens
- Automatic Refresh: Tokens are automatically refreshed when they expire
- Security: All tokens are encrypted at rest and transmitted over HTTPS only
Technical Details
API Endpoints
The integration uses the following HubSpot API endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/oauth/v1/token | POST | Exchange authorization code or refresh tokens |
/crm/v3/objects/contacts/search | POST | Search for existing contacts by email |
/crm/v3/objects/contacts | POST | Create new contacts |
/crm/v3/objects/contacts/{contactId} | PATCH | Update existing contacts |
Rate Limits
HubSpot enforces rate limits on API requests:
- 100 requests per 10 seconds per HubSpot account
- The integration includes automatic rate limit handling and retry logic
- Requests are queued and processed asynchronously to prevent blocking
Data Processing
- Asynchronous Processing: Lead sync happens in the background via queue jobs
- Retry Logic: Failed syncs are automatically retried up to 3 times with exponential backoff
- Error Handling: Validation errors (e.g., invalid properties) are handled gracefully and don't trigger retries
Troubleshooting
Integration Not Syncing Leads
Check Connection Status
- Go to your AssistLoop dashboard
- Navigate to your agent's integrations settings
- Verify HubSpot shows as "Connected"
Check Lead Form Submission
- Ensure the "Collect Lead" action is enabled for your agent
- Verify that the action's tool description or trigger conditions are properly configured
- The lead form will be shown when the AI determines customer intent matches your configured conditions
- Test the lead collection flow by triggering the action through customer conversation
Contacts Not Appearing in HubSpot
Check HubSpot Property Permissions
- Verify that your HubSpot account has permission to create contacts
- Ensure required properties (like
email) are not restricted
OAuth Token Errors
Token Expired
- The integration automatically refreshes tokens when they expire
- If you see token expiration errors, the integration will retry with a refreshed token
Re-authorization Required
- If tokens cannot be refreshed, you may need to reconnect the integration
- Disconnect and reconnect the integration in your AssistLoop dashboard
API Reference
OAuth Endpoints
The integration uses standard OAuth 2.0 endpoints for authentication:
Authorization URL
https://app.hubspot.com/oauth/authorizeToken URL
https://api.hubapi.com/oauth/v1/tokenRequired Parameters
client_id: Your HubSpot app's client IDclient_secret: Your HubSpot app's client secretredirect_uri: The callback URL registered in HubSpotgrant_type:authorization_code(for initial auth) orrefresh_token(for token refresh)
Contact Creation
Endpoint: POST /crm/v3/objects/contacts
Request Body:
{
"properties": {
"email": "[email protected]",
"firstname": "John",
"lastname": "Doe",
"phone": "+1234567890",
"company": "Example Corp"
}
}Response:
{
"id": "12345678",
"properties": {
"email": "[email protected]",
"firstname": "John",
"lastname": "Doe",
"phone": "+1234567890",
"company": "Example Corp"
},
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}Contact Search
Endpoint: POST /crm/v3/objects/contacts/search
Request Body:
{
"filterGroups": [
{
"filters": [
{
"propertyName": "email",
"operator": "EQ",
"value": "[email protected]"
}
]
}
],
"properties": ["email", "firstname", "lastname", "phone"]
}Changelog
Version 1.0.0 (Current)
- Initial release
- Automatic lead sync to HubSpot
- OAuth 2.0 authentication
- Automatic field mapping
- Duplicate contact handling
- Error handling and retry logic
- Custom property support
Last Updated: October 2025