Skip to content

HubSpot

HubSpot is a customer relationship management software that helps businesses attract visitors, connect with customers, and close deals.

ingestr supports HubSpot as a source.

URI format

The URI format for HubSpot is as follows:

plaintext
hubspot://?api_key=<api-key-here>

URI parameters:

  • api_key: The API key is used for authentication with the HubSpot API.

The URI is used to connect to the HubSpot API for extracting data.

Setting up a HubSpot Integration

HubSpot requires a few steps to set up an integration, please follow the guide dltHub has built here.

Once you complete the guide, you should have an API key. Let's say your API key is pat_test_12345, here's a sample command that will copy the data from HubSpot into a DuckDB database:

sh
ingestr ingest --source-uri 'hubspot://?api_key=pat_test_12345' --source-table 'companies' --dest-uri duckdb:///hubspot.duckdb --dest-table 'companies.data'

The result of this command will be a table in the hubspot.duckdb database.

Tables

HubSpot source allows ingesting the following sources into separate tables:

TablePKInc KeyInc StrategyDetails
companieshs_object_idhs_lastmodifieddatemergeRetrieves information about organizations.
contactshs_object_idlastmodifieddatemergeRetrieves information about visitors, potential customers, and leads.
dealshs_object_idhs_lastmodifieddatemergeRetrieves deal records and tracks deal progress.
ticketshs_object_idhs_lastmodifieddatemergeHandles requests for help from customers or users.
productshs_object_idhs_lastmodifieddatemergeRetrieves pricing information of products.
quoteshs_object_idhs_lastmodifieddatemergeRetrieves price proposals that salespeople can create and send to their contacts.
callshs_object_idhs_lastmodifieddatemergeRetrieves call engagement records.
emailshs_object_idhs_lastmodifieddatemergeRetrieves email engagement records.
feedback_submissionshs_object_idhs_lastmodifieddatemergeRetrieves customer feedback survey responses.
line_itemshs_object_idhs_lastmodifieddatemergeRetrieves individual products or services associated with deals.
meetingshs_object_idhs_lastmodifieddatemergeRetrieves meeting engagement records.
noteshs_object_idhs_lastmodifieddatemergeRetrieves note engagement records.
taskshs_object_idhs_lastmodifieddatemergeRetrieves task engagement records.
cartshs_object_idhs_lastmodifieddatemergeRetrieves shopping cart records.
discountshs_object_idhs_lastmodifieddatemergeRetrieves discount records.
feeshs_object_idhs_lastmodifieddatemergeRetrieves fee records.
invoiceshs_object_idhs_lastmodifieddatemergeRetrieves invoice records.
commerce_paymentshs_object_idhs_lastmodifieddatemergeRetrieves commerce payment records.
taxeshs_object_idhs_lastmodifieddatemergeRetrieves tax records.
ownersidmergeRetrieves HubSpot users who can be assigned to CRM records.
schemasidmergeReturns all object schemas that have been defined for your account.

Use these as --source-table parameter in the ingestr ingest command.

Incremental Loading

HubSpot supports incremental loading out of the box. On the first run, ingestr performs a full load of all records. On subsequent runs, it uses the hs_lastmodifieddate field to fetch only records that have been created or updated since the last successful run.

No additional flags are needed — incremental state is managed automatically by ingestr.

Custom Objects

HubSpot allows you to create custom objects to store unique business data that's not covered by the standard objects. ingestr supports ingesting data from custom objects using the following format:

plaintext
custom:<custom_object_name>

or with associations to other objects:

plaintext
custom:<custom_object_name>:<associations>

Parameters

  • custom_object_name: The name of your custom object in HubSpot (can be either singular or plural form)
  • associations (optional): Comma-separated list of object types to include as associations (e.g., companies,deals,tickets,contacts)

Examples

Ingesting a custom object called "licenses":

sh
ingestr ingest \
  --source-uri 'hubspot://?api_key=pat_test_12345' \
  --source-table 'custom:licenses' \
  --dest-uri duckdb:///hubspot.duckdb \
  --dest-table 'licenses.data'

Ingesting a custom object with associations to companies, deals, and contacts:

sh
ingestr ingest \
  --source-uri 'hubspot://?api_key=pat_test_12345' \
  --source-table 'custom:licenses:companies,deals,contacts' \
  --dest-uri duckdb:///hubspot.duckdb \
  --dest-table 'licenses.data'

When you include associations, the response will contain information about the related objects, allowing you to track relationships between your custom objects and standard HubSpot objects.