HubSpot Source
The HubSpot source extracts CRM data including contacts, companies, deals, and other objects from the HubSpot API.
Installation
Section titled “Installation”pip install bizon[hubspot]Quick Start
Section titled “Quick Start”name: hubspot-pipeline
source: name: hubspot stream: contacts sync_mode: full_refresh authentication: type: api_key params: token: BIZON_ENV_HUBSPOT_TOKEN
destination: name: bigquery config: project_id: my-project dataset_id: crm gcs_buffer_bucket: my-bucketAvailable Streams
Section titled “Available Streams”Check available streams:
bizon stream list hubspotCommon streams include:
contacts- CRM contactscompanies- CRM companiesdeals- Sales dealsowners- HubSpot users/owners
Configuration
Section titled “Configuration”Authentication
Section titled “Authentication”HubSpot supports API key (private app token) authentication:
source: name: hubspot stream: contacts authentication: type: api_key params: token: BIZON_ENV_HUBSPOT_TOKENTo get your token:
- Go to HubSpot Settings > Integrations > Private Apps
- Create a new private app
- Grant required scopes (crm.objects.contacts.read, etc.)
- Copy the access token
Sync Modes
Section titled “Sync Modes”Full Refresh
Section titled “Full Refresh”Syncs all records from scratch:
source: name: hubspot stream: contacts sync_mode: full_refreshIncremental
Section titled “Incremental”Syncs only new/updated records since last sync:
source: name: hubspot stream: contacts sync_mode: incrementalCheck incremental support:
bizon stream list hubspot# [Supports incremental] - contacts# [Full refresh only] - ownersExample Configurations
Section titled “Example Configurations”Contacts to BigQuery
Section titled “Contacts to BigQuery”name: hubspot-contacts
source: name: hubspot stream: contacts sync_mode: incremental authentication: type: api_key params: token: BIZON_ENV_HUBSPOT_TOKEN
destination: name: bigquery config: project_id: my-project dataset_id: crm dataset_location: US gcs_buffer_bucket: my-staging-bucket unnest: true record_schemas: - destination_id: my-project.crm.contacts record_schema: - name: id type: STRING mode: REQUIRED - name: email type: STRING mode: NULLABLE - name: firstname type: STRING mode: NULLABLE - name: lastname type: STRING mode: NULLABLE - name: createdate type: TIMESTAMP mode: NULLABLE - name: lastmodifieddate type: TIMESTAMP mode: NULLABLECompanies to BigQuery
Section titled “Companies to BigQuery”name: hubspot-companies
source: name: hubspot stream: companies sync_mode: incremental authentication: type: api_key params: token: BIZON_ENV_HUBSPOT_TOKEN
destination: name: bigquery config: project_id: my-project dataset_id: crm gcs_buffer_bucket: my-staging-bucketMultiple Objects
Section titled “Multiple Objects”Run separate pipelines for each object type:
# contacts.ymlbizon run contacts.yml
# companies.ymlbizon run companies.yml
# deals.ymlbizon run deals.ymlRate Limiting
Section titled “Rate Limiting”HubSpot has API rate limits. Bizon handles this automatically with:
source: name: hubspot stream: contacts api_config: retry_limit: 10 # Max retries on rate limitData Structure
Section titled “Data Structure”HubSpot records include:
| Field | Description |
|---|---|
id | HubSpot object ID |
properties | Object properties (email, name, etc.) |
createdAt | Record creation timestamp |
updatedAt | Last modification timestamp |
archived | Whether record is archived |
Transforms
Section titled “Transforms”Flatten HubSpot properties:
transforms: - label: flatten-properties python: | props = data.get('properties', {}) data = { 'id': data.get('id'), 'email': props.get('email'), 'firstname': props.get('firstname'), 'lastname': props.get('lastname'), 'company': props.get('company'), 'created_at': data.get('createdAt'), 'updated_at': data.get('updatedAt') }Next Steps
Section titled “Next Steps”- Sources Overview - Learn about source connectors
- Sync Modes - Understand incremental sync
- Authentication - Configure API keys