# Hubspot Import Integration [Learn more about HubSpot Export Integration](/int/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 link: [https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/](https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/) ## Create a New Authentication on the TD 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** ![](/assets/hubspot-import-integration-2024-12-11.5bde931f7b4dbd26258a20ac4ebc17dc0b7f7c929d1e1221e17940894872e103.899d1e34.png) 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 TD 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**. ![](/assets/hubspot-import-integration-2024-12-11-1.044522dca7f1b31e29c9413a5a17d786f70471375fe13fe4c6e15256f4d25b3e.899d1e34.png) 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 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 **The API V3** A newer API version, the API V3, is used to support more data objects and bypass the 10k recordslimitation | **Field** | **Description** | | --- | --- | | 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](https://developers.hubspot.com/beta-docs/guides/api/crm/search).) - 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. ![](/assets/google-ads-import-integration-v2-2024-08-06-5.9673dac09cfdafcf311c3895320451d2e018d8e5f17d194f5c066d1649402578.7c52a81f.png) ### 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. ![](/assets/google-ads-import-integration-v2-2024-08-06-3.d1a7264878d399f9a4e744868a69b15ed5ab861a1fd396d9ecef55513fcc8527.7c52a81f.png) ### 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**. ![](/assets/9bcff190-9edf-477a-9bb2-71ca68a875ef.c34f58af08ad9329b71e53eb2ce3a6e83cac5070a0e24696459c451b133b39e3.69844539.png) ## Import from HubSpot via CLI (Toolbelt) ### Prerequisites - TD Toolbelt: install the latest version of the TD CLI tool: [TD Toolbelt](https://toolbelt.treasuredata.com/) - Authentication ID: follow the steps above to create an Authentication for this integration on the TD Console. Then the ID could be seen at the last portion of its URL on the Authentication screen. ![](/assets/google-ads-import-integration-v2-2024-08-06-9.fdc162a377e20998a8f41e69c38afef49bbd1ab0b84f6b913fd06fe82b2010f3.7c52a81f.png) ### 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](/int/hubspot-import-integration#h3_755695857) and [Example](/int/hubspot-import-integration#h3_1689083776) 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. | Name | Description | Value | Default value | Required | | --- | --- | --- | --- | --- | | `td_authentication_id` | Your authentication id, obtained in the UI | `numeric` | N/A | Yes | | `target` | Source. Enum of `contacts`, `engagements`, `companies`, `deals`, `contact_lists`, `email_events`, `properties`, `search`. | `String` | `contacts` | - | | `additional_properties` | Additional Custom Properties. Only applicable in case target is `contacts` or `companies` or `deals`. | `String` | N/A | - | | `object_names` | Comma separated object names for fetching object's properties. Only applicable when target is `properties`. | `String` | N/A | Yes if target is `properties` | | `object_name` | Object to be ingested when using search API v3. Only applicable in case target is `search`. | `String` | N/A | Yes if target is `search` | | `incremental_column` | Column used to do incremental loading when using search API v3. Only applicable in case target is `search` | `String` | N/A | - | | `fetch_all_properties` | Decides 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 `search` | `Boolean` | `false` | - | | `incremental` | Whether 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 `search` | `Boolean` | `false` | - | | `from_date` | Start 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`. | `Datetime` | N/A | - | | `fetch_days` | Number 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`. | `Number` | `1` | - | | `start_time` | Start time to ingest data (in ISO-8601 format). Only applicable in case target is `search`. | `Datetime` | N/A | - | | `end_time` | End time to ingest data (in ISO-8601 format). Only applicable in case target is `search`. | `Datetime` | N/A | - | ### Example ```yaml 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 ``` ## Related Topics - See [Scheduling Using TD Toolbelt](/int/scheduling-using-td-toolbelt) for periodic execution of this integration - See [Using TD Workflow with Integrations](/int/using-td-workflow-with-td-integrations) to trigger your created Source from a workflow