# HubSpot

HubSpot is an AI-powered customer platform with all the software, integrations, and resources you need to connect your marketing, sales, and customer service.

It replicates data using the [HubSpot REST API](https://developers.hubspot.com/docs/api-reference/overview).

See the [Schema](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#Schema) section for a list of objects available for replication.

## Preparing for authentication

To access your data, you need to authenticate the connection with your account credentials.

Information noteMake sure that the account you use has read access to the tables you want to fetch.

To retrieve your access token:

1. Log into [HubSpot](https://app.hubspot.com/myaccounts).

2. Create a private app by following [HubSpot's documentation](https://developers.hubspot.com/docs/apps/legacy-apps/private-apps/overview#create-a-private-app).

   You must have a HubSpot super admin role to create a private app.

3. Once your private app is created, navigate to Development.

4. In the left sidebar menu, navigate to Legacy apps.

5. Click the name of your app.

6. Click the Auth tab &gt; Show token to reveal your access token.

7. Copy and paste your access token into a secured file.

## Creating the connection

For more information, see [Connecting to SaaS applications](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/Landing/connecting-web-applications.htm).

1. Fill in the required connection properties.

2. Provide a name for the connection in Connection name.

3. Select Open connection metadata to define metadata for the connection when it has been created.

4. Click Create.

Connection settings

| Setting | Description |
| --- | --- |
| Data gateway | Select a Data Movement gateway if required by your use case.<br><br>Information note<br><br>This field is not available with the Qlik Talend Cloud Starter subscription, as it does not support Data Movement gateway. If you have another subscription tier and do not want to use Data Movement gateway, select None.<br><br>For information on the benefits of Data Movement gateway and use cases that require it, see [Qlik Data Gateway - Data Movement](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Gateways/replication-gateway.htm). |
| Start Date | Enter the date, in the format `MM/DD/YYYY`, from which the data must be replicated from your source to your target. |
| Personal Access Token | Personal access token. |

## Schema

Information note

Schemas and naming conventions can change from version to version. It is recommended to verify your version before continuing.

### Custom HubSpot field replication

Custom object properties, or fields, are supported by HubSpot integration. It will query the `properties` list for each object and, if custom fields are available through HubSpot’s API, replicate them to your destination.

The data types of these fields will be the same as the data type in HubSpot. For example: A custom field containing `date` data will be a `date` field in your destination.

This is applicable to any object that supports custom fields in HubSpot.

### HubSpot date/date-time values & UNIX timestamps

HubSpot uses UNIX-formatted timestamps in milliseconds to store `date` and `datetime` data. For more information, see [Charts overview](https://developers.hubspot.com/docs/apps/developer-platform/add-features/ui-extensibility/ui-components/standard-components/charts/overview). It doesn’t perform any transformation during the replication process, meaning these values won’t be converted to timestamps before they’re loaded into your destination.

To account for this, consider creating a user-defined function to perform the conversion or building views on top of the raw data.

Depending on your destination, table and column names may not appear as they are outlined below.

### campaigns

The `campaigns` table contains info about the campaigns in your HubSpot account.

| **Replication Method** | Full Table |
| --- | --- |
| **Primary Key** | id |
| **Useful links** | [HubSpot documentation](http://developers.hubspot.com/Content/methods/email/get_campaign_data)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/email/get_campaign_data "Opens in new tab: HubSpot API method") |

campaigns table foreign keys

| Join campaigns with | on |
| --- | --- |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>campaigns.id = email_events.emailCampaignId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>campaigns.id = forms.leadNurturingCampaignId<br>``` |

campaigns table schema

| **appId**<br><br><br>INTEGER |
| --- |
| **appName**<br><br><br>STRING |
| **contentId**<br><br><br>INTEGER |
| **counters**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>bounce: INTEGER</li><li>click: INTEGER</li><li>deferred: INTEGER</li><li>delievered: INTEGER</li><li>delivered: INTEGER</li><li>dropped: INTEGER</li><li>forward: INTEGER</li><li>mta_dropped: INTEGER</li><li>open: INTEGER</li><li>print: INTEGER</li><li>processed: INTEGER</li><li>reply: INTEGER</li><li>sent: INTEGER</li><li>spamreport: INTEGER</li><li>statuschange: INTEGER</li><li>suppressed: INTEGER</li><li>unsubscribed: INTEGER</li></ul> |
| **id**<br><br><br>INTEGER |
| **name**<br><br><br>STRING |
| **numIncluded**<br><br><br>INTEGER |
| **numQueued**<br><br><br>INTEGER |
| **subType**<br><br><br>STRING |
| **subject**<br><br><br>STRING |
| **type**<br><br><br>STRING |

### companies

The `companies` table contains info about the companies your HubSpot contacts belong to.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | companyId |
| **Useful links** | [HubSpot documentation](http://developers.hubspot.com/Content/methods/companies/get_company)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/companies/get_company "Opens in new tab: HubSpot API method") |

companies table foreign keys

| Join companies with | on |
| --- | --- |
| [contacts_by_company](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts-by-company) | ```<br>companies.companyId = contacts_by_company.company-id<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>companies.companyId = deals.associations.associatedCompanyIds<br>```<br><br>```<br>companies.portalId = deals.portalId<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>companies.companyId = engagements.associations.companyIds<br>```<br><br>```<br>companies.portalId = engagements.engagement.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>companies.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>companies.portalId = contacts.portal-id<br>```<br><br>```<br>companies.portalId = contacts.form-submissions.portal-id<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>companies.portalId = email_events.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>companies.portalId = forms.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>companies.portalId = owners.portalId<br>```<br><br>```<br>companies.portalId = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>companies.portalId = subscription_changes.portalId<br>```<br><br>```<br>companies.portalId = subscription_changes.changes.portalId<br>``` |

companies table schema

| **companyId**<br><br><br>INTEGER |
| --- |
| **portalId**<br><br><br>INTEGER |

### contact\_lists

The `contact_lists` table contains info about the contacts lists in your HubSpot account. Contact lists are used to segment contacts into groups, and there are two types: dynamic (smart lists) and static.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | listId |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/lists/contact-lists-overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/lists/get_lists "Opens in new tab: HubSpot API method") |

contact\_lists table foreign keys

| Join contact\_lists with | on |
| --- | --- |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>contact_lists.listId = contacts.list-memberships.internal-list-id<br>```<br><br>```<br>contact_lists.portalId = contacts.portal-id<br>```<br><br>```<br>contact_lists.portalId = contacts.form-submissions.portal-id<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>contact_lists.listId = engagements.associations.contactIds<br>```<br><br>```<br>contact_lists.portalId = engagements.engagement.portalId<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>contact_lists.portalId = companies.portalId<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>contact_lists.portalId = deals.portalId<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>contact_lists.portalId = email_events.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>contact_lists.portalId = forms.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>contact_lists.portalId = owners.portalId<br>```<br><br>```<br>contact_lists.portalId = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>contact_lists.portalId = subscription_changes.portalId<br>```<br><br>```<br>contact_lists.portalId = subscription_changes.changes.portalId<br>``` |

contact\_lists table schema

| **processingType**<br><br><br>STRING |
| --- |
| **objectTypeId**<br><br><br>STRING |
| **listId**<br><br><br>STRING |
| **processingStatus**<br><br><br>STRING |
| **listVersion**<br><br><br>STRING |
| **additionalProperties**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>hs_folder_name: STRING</li><li>hs_last_record_added_at: STRING</li><li>hs_last_record_removed_at: STRING</li><li>hs_list_reference_count: STRING</li><li>hs_list_size: STRING</li></ul> |
| **updatedById**<br><br><br>STRING |
| **createdById**<br><br><br>STRING |
| **name**<br><br><br>STRING |
| **createdAt**<br><br><br>STRING |
| **updatedAt**<br><br><br>STRING |
| **filtersUpdatedAt**<br><br><br>STRING |
| **deletedAt**<br><br><br>STRING |

### contacts

The `contacts` table contains info about individual contacts in HubSpot.

### Contact properties

If properties have been set for the contact, additional fields beginning with `properties__` will be included in the table. **Note**: Contacts will only have an entry for a property if that property has been set for the contact’s record.

HubSpot always types the value of `properties` fields as `STRING` despite the property type. [Refer to HubSpot’s documentation for more info](https://developers.hubspot.com/Content/methods/contacts/contacts-overview).

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | vid |
| **Replication Key** | versionTimestamp |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/contacts/contacts-overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/contacts/get_contacts "Opens in new tab: HubSpot API method") |

contacts table foreign keys

| Join contacts with | on |
| --- | --- |
| [contacts_by_company](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts-by-company) | ```<br>contacts.canonical-vid = contacts_by_company.contact-id<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>contacts.list-memberships.internal-list-id = contact_lists.listId<br>```<br><br>```<br>contacts.portal-id = contact_lists.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = contact_lists.portalId<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>contacts.list-memberships.internal-list-id = engagements.associations.contactIds<br>```<br><br>```<br>contacts.portal-id = engagements.engagement.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = engagements.engagement.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>contacts.form-submissions.form-id = forms.guid<br>```<br><br>```<br>contacts.portal-id = forms.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = forms.portalId<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>contacts.portal-id = companies.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = companies.portalId<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>contacts.portal-id = deals.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = deals.portalId<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>contacts.portal-id = email_events.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = email_events.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>contacts.portal-id = owners.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = owners.portalId<br>```<br><br>```<br>contacts.portal-id = owners.remoteList.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>contacts.portal-id = subscription_changes.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = subscription_changes.portalId<br>```<br><br>```<br>contacts.portal-id = subscription_changes.changes.portalId<br>```<br><br>```<br>contacts.form-submissions.portal-id = subscription_changes.changes.portalId<br>``` |

contacts table schema

| **id**<br><br><br>STRING |
| --- |
| **createdAt**<br><br><br>STRING |
| **updatedAt**<br><br><br>STRING |
| **archived**<br><br><br>BOOLEAN |
| **associations**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>contacts: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>deals: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>tickets: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li></ul> |
| **objectWriteTraceId**<br><br><br>STRING |

### contacts\_by\_company

The `contacts_by_company` table contains contact and company ID pairs, allowing you to join contacts to relevant company data.

To replicate data from this table, you must also select the parent `companies` table.

| **Replication Method** | Full Table |
| --- | --- |
| **Primary Keys** | contact-id<br><br>company-id |
| **Useful links** | [HubSpot documentation](http://developers.hubspot.com/Content/methods/companies/get_company) |

contacts\_by\_company table foreign keys

| Join contacts\_by\_company with | on |
| --- | --- |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>contacts_by_company.contact-id = contacts.canonical-vid<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>contacts_by_company.company-id = companies.companyId<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>contacts_by_company.company-id = deals.associations.associatedCompanyIds<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>contacts_by_company.company-id = engagements.associations.companyIds<br>``` |

contacts\_by\_company table schema

| **company-id**<br><br><br>INTEGER |
| --- |
| **contact-id**<br><br><br>INTEGER |

### custom\_objects

Tables for custom CRM objects in your HubSpot account will have the same name as the object. For example, if you have a custom object named `cars`, the table will be named `cars`.

The fields listed below are standard fields; they are included in every custom object table. A field will be added for each property you select when configuring the table. The property names will be prefixed with `property_`. For example, if you have a property named `model`, it will appear as `property_model`.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | id |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/api/crm/crm-custom-objects) |

custom\_objects table schema

| **archived**<br><br><br>BOOLEAN |
| --- |
| **associations**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>calls: OBJECT, which is also a nested data structure.												<ul><li>results: ARRAY, which is also a nested data structure.														<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>companies: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>contacts: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>conversation_session: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>deals: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>emails: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>meetings: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>notes: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>products: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>tasks: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>tickets: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li></ul> |
| **createdAt**<br><br><br>DATE-TIME |
| **id**<br><br><br>STRING |
| **updatedAt**<br><br><br>DATE-TIME |

### deal\_pipelines

The `deal_pipelines` table contains info about the `deal stage` and `pipeline` properties.

| **Replication Method** | Full Table |
| --- | --- |
| **Primary Key** | pipelineId |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/deal-pipelines/overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/deal-pipelines/get-all-deal-pipelines "Opens in new tab: HubSpot API method") |

deal\_pipelines table schema

| **active**<br><br><br>BOOLEAN |
| --- |
| **displayOrder**<br><br><br>INTEGER |
| **label**<br><br><br>STRING |
| **pipelineId**<br><br><br>STRING |
| **stages**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>active: BOOLEAN</li><li>closedWon: BOOLEAN</li><li>displayOrder: INTEGER</li><li>label: STRING</li><li>probability: NUMBER</li><li>stageId: STRING</li></ul> |
| **staticDefault**<br><br><br>BOOLEAN |

### deals

The `deals` table contains info about the deals in a HubSpot portal.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | dealId |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/deals/deals_overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/deals/get-all-deals "Opens in new tab: HubSpot API method") |

deals table foreign keys

| Join deals with | on |
| --- | --- |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>deals.associations.associatedCompanyIds = companies.companyId<br>```<br><br>```<br>deals.portalId = companies.portalId<br>``` |
| [contacts_by_company](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts-by-company) | ```<br>deals.associations.associatedCompanyIds = contacts_by_company.company-id<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>deals.associations.associatedCompanyIds = engagements.associations.companyIds<br>```<br><br>```<br>deals.dealId = engagements.associations.dealIds<br>```<br><br>```<br>deals.associations.associatedDealIds = engagements.associations.dealIds<br>```<br><br>```<br>deals.portalId = engagements.engagement.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>deals.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>deals.portalId = contacts.portal-id<br>```<br><br>```<br>deals.portalId = contacts.form-submissions.portal-id<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>deals.portalId = email_events.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>deals.portalId = forms.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>deals.portalId = owners.portalId<br>```<br><br>```<br>deals.portalId = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>deals.portalId = subscription_changes.portalId<br>```<br><br>```<br>deals.portalId = subscription_changes.changes.portalId<br>``` |

deals table schema

| **associations**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>associatedCompanyIds: ARRAY</li><li>associatedDealIds! ARRAY</li><li>associatedVids: ARRAY</li></ul> |
| --- |
| **dealId**<br><br><br>INTEGER |
| **isDeleted**<br><br><br>BOOLEAN |
| **portalId**<br><br><br>INTEGER |

### email\_events

The `email_events` table contains info about email events and how recipients interact with content.

#### Email events and HubSpot permissions

Replicating this table requires **Super Admin** permissions in HubSpot. The Super Admin role is different than the Admin role, which you can read more about in [HubSpot’s documentation](https://knowledge.hubspot.com/articles/kcs_article/settings/hubspot-user-roles-guide#admin).

If this table is selected and you don’t have Super Admin permissions in HubSpot, an error similar to the following will surface in the integration’s Extraction Logs:

```
tap - ERROR b'{"status":"error","message":"This oauth-token (**********) does not have proper permissions! (requires any of [email-access])", [...]
```

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | id |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/email/email_events_overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/email/get_events "Opens in new tab: HubSpot API method") |

email\_events table foreign keys

| Join email\_events with | on |
| --- | --- |
| [campaigns](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#campaigns) | ```<br>email_events.emailCampaignId = campaigns.id<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>email_events.emailCampaignId = forms.leadNurturingCampaignId<br>```<br><br>```<br>email_events.portalId = forms.portalId<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>email_events.portalId = companies.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>email_events.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>email_events.portalId = contacts.portal-id<br>```<br><br>```<br>email_events.portalId = contacts.form-submissions.portal-id<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>email_events.portalId = deals.portalId<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>email_events.portalId = engagements.engagement.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>email_events.portalId = owners.portalId<br>```<br><br>```<br>email_events.portalId = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>email_events.portalId = subscription_changes.portalId<br>```<br><br>```<br>email_events.portalId = subscription_changes.changes.portalId<br>``` |

email\_events table schema

| **appId**<br><br><br>INTEGER |
| --- |
| **appName**<br><br><br>STRING |
| **browser**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>family: STRING</li><li>name: STRING</li><li>producer: STRING</li><li>producerUrl: STRING</li><li>type: STRING</li><li>url: STRING</li></ul> |
| **created**<br><br><br>DATE-TIME |
| **deviceType**<br><br><br>STRING |
| **duration**<br><br><br>INTEGER |
| **emailCampaignGroupId**<br><br><br>INTEGER |
| **emailCampaignId**<br><br><br>INTEGER |
| **filteredEvent**<br><br><br>BOOLEAN |
| **from**<br><br><br>STRING |
| **hmid**<br><br><br>STRING |
| **id**<br><br><br>STRING |
| **ipAddress**<br><br><br>STRING |
| **linkId**<br><br><br>INTEGER |
| **location**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>city: STRING</li><li>country: STRING</li><li>state: STRING</li></ul> |
| **portalId**<br><br><br>INTEGER |
| **recipient**<br><br><br>STRING |
| **response**<br><br><br>STRING |
| **sentBy**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>created: DATE-TIME</li><li>id: STRING</li></ul> |
| **smtpId**<br><br><br>STRING |
| **subject**<br><br><br>STRING |
| **type**<br><br><br>STRING |
| **url**<br><br><br>STRING |
| **userAgent**<br><br><br>STRING |

### engagements

The `engagements` table contains info about all the engagements in a HubSpot portal.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | engagement\_id |
| **Replication Key** | lastUpdated |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/engagements/engagements-overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/engagements/get-all-engagements "Opens in new tab: HubSpot API method") |

engagements table foreign keys

| Join engagements with | on |
| --- | --- |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>engagements.associations.companyIds = companies.companyId<br>```<br><br>```<br>engagements.engagement.portalId = companies.portalId<br>``` |
| [contacts_by_company](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts-by-company) | ```<br>engagements.associations.companyIds = contacts_by_company.company-id<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>engagements.associations.companyIds = deals.associations.associatedCompanyIds<br>```<br><br>```<br>engagements.associations.dealIds = deals.dealId<br>```<br><br>```<br>engagements.associations.dealIds = deals.associations.associatedDealIds<br>```<br><br>```<br>engagements.engagement.portalId = deals.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>engagements.associations.contactIds = contact_lists.listId<br>```<br><br>```<br>engagements.engagement.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>engagements.associations.contactIds = contacts.list-memberships.internal-list-id<br>```<br><br>```<br>engagements.engagement.portalId = contacts.portal-id<br>```<br><br>```<br>engagements.engagement.portalId = contacts.form-submissions.portal-id<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>engagements.engagement.ownerId = owners.ownerId<br>```<br><br>```<br>engagements.engagement.ownerId = owners.remoteList.ownerId<br>```<br><br>```<br>engagements.engagement.portalId = owners.portalId<br>```<br><br>```<br>engagements.engagement.portalId = owners.remoteList.portalId<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>engagements.engagement.portalId = email_events.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>engagements.engagement.portalId = forms.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>engagements.engagement.portalId = subscription_changes.portalId<br>```<br><br>```<br>engagements.engagement.portalId = subscription_changes.changes.portalId<br>``` |

engagements table schema

| **associations**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>companyIds: ARRAY, which is also a nested data structure.</li><li>contactIds: ARRAY, which is also a nested data structure.</li><li>dealIds: ARRAY, which is also a nested data structure.</li></ul> |
| --- |
| **attachments**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>id: INTEGER</li></ul> |
| **engagement**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>active: BOOLEAN</li><li>createdAt: DATE-TIME</li><li>id: INTEGER</li><li>lastUpdated: DATE-TIME</li><li>ownerId: INTEGER</li><li>portalId: INTEGER</li><li>timestamp: DATE-TIME</li><li>type: STRING</li></ul> |
| **engagement\_id**<br><br><br>INTEGER |
| **lastUpdated**<br><br><br>DATE-TIME |
| **metadata**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>bcc: ARRAY, which is also a nested data structure.											<ul><li>email: STRING</li></ul></li><li>body: STRING</li><li>cc: ARRAY, which is also a nested data structure.											<ul><li>email: STRING</li></ul></li><li>disposition: STRING</li><li>durationMilliseconds: INTEGER</li><li>endTime: INTEGER</li><li>externalAccountId: STRING</li><li>externalId: STRING</li><li>forObjectType: STRING</li><li>from: OBJECT, which is also a nested data structure.											<ul><li>email: STRING</li><li>firstName: STRING</li><li>lastName: STRING</li></ul></li><li>fromNumber: STRING</li><li>html: STRING</li><li>recordingUrl: STRING</li><li>startTime: INTEGER</li><li>status: STRING</li><li>subject: STRING</li><li>text: STRING</li><li>title: STRING</li><li>to: ARRAY, which is also a nested data structure.											<ul><li>email: STRING</li></ul></li><li>toNumber: STRING</li></ul> |

### forms

The `forms` table contains info about your HubSpot website forms.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | guid |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/forms/forms_overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/forms/v2/get_forms "Opens in new tab: HubSpot API method") |

forms table foreign keys

| Join forms with | on |
| --- | --- |
| [campaigns](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#campaigns) | ```<br>forms.leadNurturingCampaignId = campaigns.id<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>forms.leadNurturingCampaignId = email_events.emailCampaignId<br>```<br><br>```<br>forms.portalId = email_events.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>forms.guid = contacts.form-submissions.form-id<br>```<br><br>```<br>forms.portalId = contacts.portal-id<br>```<br><br>```<br>forms.portalId = contacts.form-submissions.portal-id<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>forms.portalId = companies.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>forms.portalId = contact_lists.portalId<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>forms.portalId = deals.portalId<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>forms.portalId = engagements.engagement.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>forms.portalId = owners.portalId<br>```<br><br>```<br>forms.portalId = owners.remoteList.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>forms.portalId = subscription_changes.portalId<br>```<br><br>```<br>forms.portalId = subscription_changes.changes.portalId<br>``` |

forms table schema

| **action**<br><br><br>STRING |
| --- |
| **campaignGuid**<br><br><br>STRING |
| **captchaEnabled**<br><br><br>BOOLEAN |
| **cloneable**<br><br><br>BOOLEAN |
| **createdAt**<br><br><br>DATE-TIME |
| **cssClass**<br><br><br>STRING |
| **deletable**<br><br><br>BOOLEAN |
| **deletedAt**<br><br><br>INTEGER |
| **editable**<br><br><br>BOOLEAN |
| **followUpId**<br><br><br>STRING |
| **formFieldGroups**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>default: BOOLEAN</li><li>fields: ARRAY, which is also a nested data structure.											<ul><li>defaultValue: STRING</li><li>description: STRING</li><li>displayOrder: INTEGER</li><li>enabled: BOOLEAN</li><li>fieldType: STRING</li><li>groupName: STRING</li><li>hidden: BOOLEAN</li><li>isSmartField: BOOLEAN</li><li>label: STRING</li><li>labelHidden: BOOLEAN</li><li>name: STRING</li><li>options: ARRAY, which is also a nested data structure.													<ul><li>description: STRING</li><li>displayOrder: INTEGER</li><li>doubleData: NUMBER</li><li>hidden: BOOLEAN</li><li>label: STRING</li><li>readOnly: BOOLEAN</li><li>value: STRING</li></ul></li><li>placeholder: STRING</li><li>required: BOOLEAN</li><li>selectedOptions: ARRAY</li><li>type: STRING</li><li>unselectedLabel: STRING</li><li>validation: OBJECT, which is also a nested data structure.													<ul><li>blockedEmailAddresses: ARRAY</li><li>data: STRING</li><li>message: STRING</li><li>name: STRING</li><li>useDefaultBlockList: BOOLEAN</li></ul></li></ul></li><li>isSmartGroup: BOOLEAN</li><li>richText: OBJECT, which is also a nested data structure.											<ul><li>content: STRING</li></ul></li></ul> |
| **formType**<br><br><br>STRING |
| **guid**<br><br><br>STRING |
| **ignoreCurrentValues**<br><br><br>BOOLEAN |
| **inlineMessage**<br><br><br>STRING |
| **leadNurturingCampaignId**<br><br><br>STRING |
| **metaData**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>name: STRING</li><li>value: STRING</li></ul> |
| **method**<br><br><br>STRING |
| **migratedFrom**<br><br><br>STRING |
| **name**<br><br><br>STRING |
| **notifyRecipients**<br><br><br>STRING |
| **performableHtml**<br><br><br>STRING |
| **portalId**<br><br><br>INTEGER |
| **redirect**<br><br><br>STRING |
| **submitText**<br><br><br>STRING |
| **tmsId**<br><br><br>STRING |
| **updatedAt**<br><br><br>DATE-TIME |

### owners

The `owners` table contains info about the owners that exist in your HubSpot portal. Owners are created and updated in HubSpot when new users are added or when owners are synced from Salesforce to HubSpot.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | ownerId |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/owners/owners_overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/owners/get_owners "Opens in new tab: HubSpot API method") |

owners table foreign keys

| Join owners with | on |
| --- | --- |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>owners.ownerId = engagements.engagement.ownerId<br>```<br><br>```<br>owners.remoteList.ownerId = engagements.engagement.ownerId<br>```<br><br>```<br>owners.portalId = engagements.engagement.portalId<br>```<br><br>```<br>owners.remoteList.portalId = engagements.engagement.portalId<br>``` |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>owners.portalId = companies.portalId<br>```<br><br>```<br>owners.remoteList.portalId = companies.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>owners.portalId = contact_lists.portalId<br>```<br><br>```<br>owners.remoteList.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>owners.portalId = contacts.portal-id<br>```<br><br>```<br>owners.remoteList.portalId = contacts.portal-id<br>```<br><br>```<br>owners.portalId = contacts.form-submissions.portal-id<br>```<br><br>```<br>owners.remoteList.portalId = contacts.form-submissions.portal-id<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>owners.portalId = deals.portalId<br>```<br><br>```<br>owners.remoteList.portalId = deals.portalId<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>owners.portalId = email_events.portalId<br>```<br><br>```<br>owners.remoteList.portalId = email_events.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>owners.portalId = forms.portalId<br>```<br><br>```<br>owners.remoteList.portalId = forms.portalId<br>``` |
| [subscription_changes](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#subscription-changes) | ```<br>owners.portalId = subscription_changes.portalId<br>```<br><br>```<br>owners.remoteList.portalId = subscription_changes.portalId<br>```<br><br>```<br>owners.portalId = subscription_changes.changes.portalId<br>```<br><br>```<br>owners.remoteList.portalId = subscription_changes.changes.portalId<br>``` |

owners table schema

| **archived**<br><br><br>BOOLEAN |
| --- |
| **createdAt**<br><br><br>DATE-TIME |
| **email**<br><br><br>STRING |
| **firstName**<br><br><br>STRING |
| **id**<br><br><br>STRING |
| **lastName**<br><br><br>STRING |
| **teams**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>id: STRING</li><li>name: STRING</li><li>primary: BOOLEAN</li></ul> |
| **updatedAt**<br><br><br>DATE-TIME |
| **userId**<br><br><br>INTEGER |

### subscription\_changes

The `subscription_changes` table contains info about changes made subscriptions.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Keys** | recipient<br><br>portalId<br><br>timestamp |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/timeline/timeline-overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/email/get_subscriptions_timeline "Opens in new tab: HubSpot API method") |

subscription\_changes table foreign keys

| Join subscription\_changes with | on |
| --- | --- |
| [companies](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#companies) | ```<br>subscription_changes.portalId = companies.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = companies.portalId<br>``` |
| [contact_lists](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contact-lists) | ```<br>subscription_changes.portalId = contact_lists.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = contact_lists.portalId<br>``` |
| [contacts](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#contacts) | ```<br>subscription_changes.portalId = contacts.portal-id<br>```<br><br>```<br>subscription_changes.changes.portalId = contacts.portal-id<br>```<br><br>```<br>subscription_changes.portalId = contacts.form-submissions.portal-id<br>```<br><br>```<br>subscription_changes.changes.portalId = contacts.form-submissions.portal-id<br>``` |
| [deals](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#deals) | ```<br>subscription_changes.portalId = deals.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = deals.portalId<br>``` |
| [email_events](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#email-events) | ```<br>subscription_changes.portalId = email_events.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = email_events.portalId<br>``` |
| [engagements](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#engagements) | ```<br>subscription_changes.portalId = engagements.engagement.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = engagements.engagement.portalId<br>``` |
| [forms](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#forms) | ```<br>subscription_changes.portalId = forms.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = forms.portalId<br>``` |
| [owners](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-HubSpot.htm#owners) | ```<br>subscription_changes.portalId = owners.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = owners.portalId<br>```<br><br>```<br>subscription_changes.portalId = owners.remoteList.portalId<br>```<br><br>```<br>subscription_changes.changes.portalId = owners.remoteList.portalId<br>``` |

subscription\_changes table schema

| **changes**<br><br><br>ARRAY<br><br>This is a nested data structure:<br><br><ul><li>causedByEvent: OBJECT, which is also a nested data structure.											<ul><li>created: DATE-TIME</li><li>id: STRING</li></ul></li><li>change: STRING</li><li>changeType: STRING</li><li>portalId: INTEGER</li><li>source: STRING</li><li>subscriptionId: INTEGER</li><li>timestamp: DATE-TIME</li></ul> |
| --- |
| **portalId**<br><br><br>INTEGER |
| **recipient**<br><br><br>STRING |
| **timestamp**<br><br><br>DATE-TIME |

### tickets

In HubSpot, tickets represents customer requests for help

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | id |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot API method](https://developers.hubspot.com/Content/api/crm/tickets "Opens in new tab: HubSpot API method") |

tickets table schema

| **archived**<br><br><br>BOOLEAN |
| --- |
| **associations**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>companies: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>contacts: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li><li>deals: OBJECT, which is also a nested data structure.											<ul><li>results: ARRAY, which is also a nested data structure.													<ul><li>id: STRING</li><li>type: STRING</li></ul></li></ul></li></ul> |
| **createdAt**<br><br><br>DATE-TIME |
| **id**<br><br><br>STRING |
| **updatedAt**<br><br><br>DATE-TIME |

### workflows

The `workflows` table contains info about the workflows in your HubSpot portal.

**Note**: The `workflows` stream only supports contact-based workflows.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Key** | id |
| **Replication Key** | updatedAt |
| **Useful links** | [HubSpot documentation](https://developers.hubspot.com/Content/methods/workflows/workflows_overview)<br><br>[HubSpot API method](https://developers.hubspot.com/Content/methods/workflows/v3/get_workflows "Opens in new tab: HubSpot API method") |

workflows table schema

| **contactListIds**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>active: INTEGER</li><li>enrolled: INTEGER</li><li>steps: ARRAY, which is also a nested data structure.</li></ul> |
| --- |
| **enabled**<br><br><br>BOOLEAN |
| **id**<br><br><br>INTEGER |
| **insertedAt**<br><br><br>DATE-TIME |
| **name**<br><br><br>STRING |
| **personaTagIds**<br><br><br>ARRAY<br><br>This is a nested data structure. |
| **type**<br><br><br>STRING |
| **updatedAt**<br><br><br>DATE-TIME |