HubSpot Connector

HubSpot Connector

Connect your HubSpot CRM to Brevo via Tajo for bidirectional contact sync, deal tracking, engagement data, and unified marketing automation across both platforms.

Overview

PropertyValue
PlatformHubSpot
CategoryCRM
Setup ComplexityMedium
Official IntegrationYes
Data SyncedContacts, Companies, Deals, Tickets, Events
API Base URLhttps://api.hubapi.com

Features

  • Bidirectional contact sync - Keep contacts in sync between HubSpot and Brevo in real time
  • Deal pipeline tracking - Sync deal stages and values for revenue-based segmentation
  • Company data sync - Associate contacts with company records and firmographic data
  • Ticket integration - Track support tickets for customer health scoring
  • Engagement tracking - Sync email opens, clicks, meetings, calls, and notes
  • Custom object support - Map HubSpot custom objects to Brevo attributes
  • Workflow triggers - Use HubSpot lifecycle stage changes to trigger Brevo automations
  • Webhook events - Real-time notifications for CRM data changes

Prerequisites

Before you begin, ensure you have:

  1. A HubSpot account (Free, Starter, Professional, or Enterprise)
  2. A HubSpot private app or OAuth app with required scopes
  3. A Brevo account with API access
  4. A Tajo account

Authentication

Create a private app in HubSpot for direct API access with granular scope control.

  1. Go to HubSpot Settings > Integrations > Private Apps
  2. Create a new private app
  3. Configure required scopes
  4. Copy the access token
Terminal window
curl -X GET "https://api.hubapi.com/crm/v3/objects/contacts" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"

OAuth 2.0

Use OAuth 2.0 for multi-account integrations that require user authorization.

Terminal window
# Authorization URL
https://app.hubspot.com/oauth/authorize?client_id={client_id}&scope=crm.objects.contacts.read&redirect_uri={redirect_uri}

Required Scopes

crm.objects.contacts.read
crm.objects.contacts.write
crm.objects.companies.read
crm.objects.deals.read
crm.objects.deals.write
crm.objects.custom.read
crm.schemas.custom.read

Configuration

Basic Setup

connectors:
hubspot:
enabled: true
access_token: "${HUBSPOT_ACCESS_TOKEN}"
# Data sync options
sync:
contacts: true
companies: true
deals: true
tickets: true
engagements: true
# Sync direction
direction: bidirectional # or 'hubspot_to_brevo' | 'brevo_to_hubspot'
# List assignment in Brevo
lists:
all_contacts: 10
qualified_leads: 11
customers: 12

Field Mapping

Map HubSpot properties to Brevo contact attributes:

Default Mappings

Parameter Type Description
email required
string

Contact email (primary identifier)

firstname optional
string

Maps to FIRSTNAME attribute in Brevo

lastname optional
string

Maps to LASTNAME attribute in Brevo

phone optional
string

Maps to SMS attribute for WhatsApp/SMS

company optional
string

Associated company name

lifecyclestage optional
string

HubSpot lifecycle stage (subscriber, lead, MQL, SQL, customer)

hs_lead_status optional
string

Lead qualification status

hubspot_owner_id optional
string

Assigned sales owner ID

Custom Property Mapping

field_mapping:
# Standard fields
email: email
firstname: FIRSTNAME
lastname: LASTNAME
phone: SMS
# CRM fields
lifecyclestage: LIFECYCLE_STAGE
hs_lead_status: LEAD_STATUS
company: COMPANY_NAME
# Deal metrics
hs_total_deal_value: DEAL_VALUE
num_associated_deals: DEAL_COUNT
# Custom properties
preferred_channel: PREFERRED_CHANNEL
customer_segment: SEGMENT

API Endpoints

CRM Objects

MethodEndpointDescription
GET/crm/v3/objects/contactsList contacts
POST/crm/v3/objects/contactsCreate a contact
PATCH/crm/v3/objects/contacts/{id}Update a contact
GET/crm/v3/objects/companiesList companies
GET/crm/v3/objects/dealsList deals
POST/crm/v3/objects/dealsCreate a deal
GET/crm/v3/objects/ticketsList tickets

Associations

MethodEndpointDescription
GET/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}Get associations
PUT/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}Create association

Engagements

MethodEndpointDescription
GET/crm/v3/objects/callsList call engagements
GET/crm/v3/objects/emailsList email engagements
GET/crm/v3/objects/meetingsList meetings
GET/crm/v3/objects/notesList notes
GET/crm/v3/objects/tasksList tasks

Events

Contact Events

EventTriggerUse Case
contact.creationNew contact createdWelcome flow trigger
contact.propertyChangeContact property updatedAttribute sync
contact.mergeContacts mergedDeduplication handling
contact.deletionContact deletedCleanup in Brevo

Deal Events

EventTriggerUse Case
deal.creationNew deal createdSales notification
deal.propertyChangeDeal stage changedPipeline automation
deal.deletionDeal removedRevenue reporting

Company Events

EventTriggerUse Case
company.creationNew company addedAccount-based marketing
company.propertyChangeCompany data updatedFirmographic sync

Code Examples

Initialize Connector

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
// Connect HubSpot
await tajo.connectors.connect('hubspot', {
accessToken: process.env.HUBSPOT_ACCESS_TOKEN
});

Run Contact Sync

// Full bidirectional sync
await tajo.connectors.sync('hubspot', {
type: 'full',
resources: ['contacts', 'companies', 'deals'],
direction: 'bidirectional',
since: '2023-01-01'
});
// Check sync status
const status = await tajo.connectors.status('hubspot');
console.log(status);
// {
// connected: true,
// lastSync: '2024-01-15T10:30:00Z',
// contactsSynced: 34200,
// companiesSynced: 5100,
// dealsSynced: 2340
// }

Handle Webhook Events

// Handle HubSpot webhook notifications
app.post('/webhooks/hubspot', async (req, res) => {
const signature = req.get('X-HubSpot-Signature-v3');
// Verify webhook signature
if (!verifyHubSpotSignature(req.body, signature)) {
return res.status(401).send('Unauthorized');
}
for (const event of req.body) {
await tajo.connectors.handleWebhook('hubspot', {
eventType: event.subscriptionType,
objectId: event.objectId,
propertyName: event.propertyName,
propertyValue: event.propertyValue
});
}
res.status(200).send('OK');
});

Rate Limits

HubSpot applies rate limits per private app or OAuth app:

PlanRate LimitBurst Limit
Free/Starter100 requests/10 seconds150 requests/10 seconds
Professional150 requests/10 seconds200 requests/10 seconds
Enterprise200 requests/10 seconds250 requests/10 seconds
API add-on200 requests/10 seconds250 requests/10 seconds

Additional limits:

  • Search API: 5 requests/second per app
  • Batch operations: 100 records per batch request
  • Daily limit: 500,000 requests/day (OAuth apps)

Rate Limit Handling

HubSpot returns a 429 Too Many Requests response when limits are exceeded. Use exponential backoff and monitor the X-HubSpot-RateLimit-* headers.

Troubleshooting

Common Issues

IssueCauseSolution
401 UnauthorizedExpired or invalid tokenRegenerate private app token or refresh OAuth token
Contact not syncedMissing email propertyHubSpot contacts require an email for Brevo sync
Duplicate contactsNo deduplication ruleConfigure merge rules in HubSpot
Webhook not receivedSubscription not activeRe-register webhook subscriptions
Property not mappedCustom property not createdCreate the property in HubSpot first

Debug Mode

Enable verbose logging:

connectors:
hubspot:
debug: true
log_level: verbose
log_webhooks: true

Test Connection

Terminal window
tajo connectors test hubspot
# ✓ API connection successful
# ✓ Contacts readable
# ✓ Companies readable
# ✓ Deals readable
# ✓ Webhooks registered

Best Practices

  1. Use private apps over API keys - API keys are deprecated; use private apps for better security
  2. Implement bidirectional sync carefully - Avoid infinite loops by tracking sync source
  3. Map lifecycle stages - Use HubSpot lifecycle stages to segment contacts in Brevo
  4. Batch API requests - Use batch endpoints for bulk operations to stay within rate limits
  5. Monitor webhook delivery - Set up retry logic and dead letter handling
  6. Use incremental sync - Sync only changed records using the lastmodifieddate property

Security

  • Private App Tokens - Scoped access tokens with granular permissions
  • OAuth 2.0 - Industry-standard authorization with refresh token rotation
  • Webhook signatures - HMAC-based signature verification (v3)
  • TLS encryption - All API communication encrypted in transit
  • Scoped permissions - Minimum required scope access per integration
AI-Assistent

Hallo! Fragen Sie mich alles über die Dokumentation.

Kostenlos mit Brevo starten