Skip to content
Last updated

Hubspot Import Integration

Learn more about HubSpot Export Integration.

HubSpot is an inbound marketing and sales platform that helps companies attract visitors, convert leads, and close deals. Using this integration to import HubSpot data in TD to eliminate the data silos, understand the customer behavior across all touchpoints, and create more relevant and timely interactions with customers, leading to better retention and loyalty.

Various HubSpot objects are supported in this integration, including Contacts, Companies, Contact Lists, Email events, Engagement activities, Deals, and other data objects.

Prerequisites

  • Basic knowledge of Treasure Data
  • Basic knowledge of HubSpot

Static IP Address of Treasure Data Integration

If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.

Please find the complete list of static IP addresses, organized by region, at the following document

Create a New Authentication on the Treasure Console

When you configure a data connection, you provide authentication to access the integration. In Treasure Data, you configure the authentication and specify the source information.

  1. Navigate to Integrations Hub > Catalog
  2. Search for and select HubSpot

  1. Select Create Authentication and provide the OAuth of a HubSpot account
  2. After being redirected back to the Integration Hub, repeat the above steps (this time your provided OAuth will be shown), enter a name for your authentication, and select Done

Create a Source

  1. Open Treasure Console
  2. Navigate to Integrations Hub > Authentications
  3. Locate your new authentication and select New Source
  4. On the first step 1 - Connection, type a source name in the Data Transfer Name field, and select Next

Identify the source data

Identify what data to be ingested into Treasure Data using the parameters below, and select Next.

To support backward compatibility, this integration utilizes the API V1 for the data objects below:

  • Contacts, with custom attributes
  • Companies, with custom attributes
  • Contact Lists
  • Email events
  • Engagement activities
  • Deals, with custom attributes
Contact Lists v1 sunset — action required

HubSpot sunset the Contact Lists v1 API on 2026-04-30. The contact_lists target now calls POST /crm/v3/lists/search and returns the v3 schema, which differs from v1:

  • Removed columns: metaData, archived, internalListId, dynamic, filters, portalId, deleteable, listType
  • Type changes: listId, createdAt, updatedAt are now STRING (v3 returns string IDs and ISO-8601 timestamps; previously LONG)
  • New columns: listVersion, processingType, processingStatus, objectTypeId, filtersUpdatedAt, createdById, updatedById, additionalProperties

Downstream tables and queries that depend on the v1 column names or numeric listId/createdAt/updatedAt must be updated.

References: Contact Lists v1 sunset · v1 → v3 migration guide

The API V1 allows the incremental loading of Contacts, Companies, and Email events

  • Start date: date from which to fetch data objects in HubSpot
  • Number of days to fetch: Number of days to fetch. A maximum of the past 30 days can be fetched

Known limitations of the API V1:

  • Not all custom attributes are supported
  • A data import has an upper limit of 10,000 records
Migrating from API v1 targets to API v3 Search

The API v1 targets below remain functional but are subject to HubSpot's ongoing v1 sunsets. To avoid future breakage, switch to the search target (API v3):

BeforeAfter
target: contactstarget: search, object_name: contacts, incremental_column: lastmodifieddate
target: companiestarget: search, object_name: companies, incremental_column: hs_lastmodifieddate
target: dealstarget: search, object_name: deals, incremental_column: hs_lastmodifieddate
target: engagementsSplit into one job per engagement type — target: search, object_name: calls (or emails, meetings, notes, tasks)

Note: the v3 schema differs from v1. Column names and types will change in your destination table.

The API V3

A newer API version, the API V3, is used to support more data objects and bypass the 10k recordslimitation

FieldDescription
Source
  • API v3 Search: select this option and declare the data object name to be imported in the next field
  • API v3 Properties: use this option in case you would like to explore available attributes of data objects on your HubSpot account

Object Name

The data object name to be imported. (For a full list of supported data objects, see HubSpot.)

  • Objects: carts, companies, contacts, deals, deal_split, discounts, feedback_submissions, fees, invoices, leads, ...
  • Engagements: calls, emails, meetings, notes, tasks

In the case of API v3 Properties, a comma-separated list of object names can be filled in.

Incremental Column(For API v3 Search - Mandatory) The column is used for incremental loading and/or filtering.
Fetch All Properties(For API v3 Search) When unchecked, only the default properties of the data object will be imported.
Incremental(For API v3 Search) When checked, only the new data since the last execution will be imported.
Start Date Time End Date Time(For API v3 Search) Data within Start - End time will be imported. These options are useful for initial data loading.

Define Data Settings

Optionally, you can modify advanced data settings. Select Next to move to the next step.

Preview Your Data

  • On the 4 Data Preview step, select Generate Preview to see a sample of your data before running the import (optional).
  • Select Next to continue.

Define Your Data Placement

For data placement, select the target database and table where you want your data placed and indicate how often the import should run, then select Save or Save & Run Now.

Import from HubSpot via CLI (Toolbelt)

Prerequisites

  • TD Toolbelt: install the latest version of the Treasure CLI tool: TD Toolbelt
  • Authentication ID: follow the steps above to create an Authentication for this integration on the Treasure Console. Then the ID could be seen at the last portion of its URL on the Authentication screen.

General steps

  1. Create a YML configuration file, ex: **load.yml**, referencing the created authentication in the `td_authentication_id' field. Refer to the below Parameter Reference and Example for more details
  2. Preview the input data (optional) using the command: $ td connector:preview load.yml
  3. Trigger the data import using the command: $ td connector:issue load.yml --database db-name --table table-name
  4. Schedule the execution using the command: $ td connector:create daily\_import "10 0 \* \* \*" db-name table-name load.yml

Parameters Reference

The following table describes the parameters for configuring the HubSpot import integration via CLI.

NameDescriptionValueDefault valueRequired
td_authentication_idYour authentication id, obtained in the UInumericN/AYes
targetSource. Enum of contacts, engagements, companies, deals, contact_lists, email_events, properties, search.Stringcontacts
additional_propertiesAdditional Custom Properties. Only applicable in case target is contacts or companies or deals.StringN/A
object_namesComma separated object names for fetching object's properties. Only applicable when target is properties.StringN/AYes if target is properties
object_nameObject to be ingested when using search API v3. Only applicable in case target is search.StringN/AYes if target is search
incremental_columnColumn used to do incremental loading when using search API v3. Only applicable in case target is searchStringN/A
fetch_all_propertiesDecides whether or not to get all object's properties. This may add latency to the execution if checked but will provide more information. Only applicable in case target is searchBooleanfalse
incrementalWhether or not to import new data from last run only. Only applicable in case target is contacts or companies or deals or email_events or searchBooleanfalse
from_dateStart Date to ingest data (in ISO-8601 format). Only applicable when incremental is true and target is contacts or engagements or companies or deals or contact_lists or email_events.DatetimeN/A
fetch_daysNumber of days to fetch date from start date. Only applicable when incremental is true and target is contacts or engagements or companies or deals or contact_lists or email_events.Number1
start_timeStart time to ingest data (in ISO-8601 format). Only applicable in case target is search.DatetimeN/A
end_timeEnd time to ingest data (in ISO-8601 format). Only applicable in case target is search.DatetimeN/A

Example

in:
  type: hubspot
  td_authentication_id: 330392
  additional_properties: "prop_1, prop_2, prop_3"
  custom_properties_chunk_size: 100
  retry_intial_wait_msec : "500" # initial waiting time as 0.5 second
  retry_limit : "10"
  max_retry_wait_msec :  "90000" # maximum 1.5 minute of waiting time for each retry
  from_date: 2016-09-01T00:00:00.000Z
  fetch_days: 2
out:
  mode: append