> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Hubspot as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/hubspot > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Prerequisites](#prerequisites) - [Adding a data source](#adding-a-data-source) - [Sync modes](#sync-modes) - [Configuration](#configuration) - [Selecting columns](#selecting-columns) - [Supported tables](#supported-tables) - [Troubleshooting](#troubleshooting) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you The HubSpot connector syncs your CRM data – contacts, companies, deals, tickets, quotes, emails, and meetings – into PostHog, so you can analyze your sales and marketing data alongside your product data. ## Prerequisites You need a HubSpot account that you can authorize PostHog to access. The connection uses OAuth, so you don't need to manually create an API key – you'll sign in to HubSpot and grant access during setup. ## Adding a data source 1. In PostHog, go to the [Sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section. 2. Click **\+ New source** and click **Link** next to this source. 3. Enter your credentials (see [Configuration](#configuration) below) and click **Next**. 4. Select the tables you want to sync, choose a sync method and frequency, then click **Import**. Once the syncs are complete, you can start querying this data in PostHog. When linking HubSpot, select an existing HubSpot account to link to PostHog or create a new connection: - **Hubspot account** – Select the HubSpot account you want to link, then follow the prompts to authorize PostHog. This handles authentication via OAuth. You can optionally enable **Customize synced properties** to control which properties are synced for each schema. See [Configuration](#configuration) below for details. ## Sync modes Each table can be synced in one of several modes, depending on what the source supports: - **Webhook** (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes. - **Incremental** – only new or updated rows are synced on each run, using a cursor field (such as an `updated_at` timestamp). Cheaper than a full refresh, but deletes aren't captured. - **Append only** – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs. - **Full refresh** – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected. See [sync methods](https://posthog.com/docs/data-pipelines/sources.md#sync-methods) for a full explanation of how each mode works and how to choose between them. HubSpot tables support both full refresh and incremental syncing. With incremental sync, the first sync performs a full import to establish a baseline, then subsequent syncs only fetch records modified since the last sync (using the `hs_lastmodifieddate` property, or `lastmodifieddate` for contacts). Incremental syncing is more efficient for large HubSpot portals, and interrupted syncs resume from where they left off. ## Configuration | Option | Description | | --- | --- | | `Hubspot account` **Type:** oauth **Required:** True | | | `Customize synced properties` **Type:** switch-group **Required:** False | Specify which properties to sync for each schema. Leave empty to use defaults. Changing properties requires a full resync. | ### Customize synced properties By default, PostHog syncs a standard set of properties for each HubSpot schema. To control which properties are synced, enable the **Customize synced properties** toggle during setup. When enabled, a text field appears for each schema (contacts, companies, deals, tickets, quotes, emails, meetings). Enter a comma-separated list of HubSpot property names to sync. Leave a field empty to use the defaults. The default properties for each schema are: - **contacts** - `createdate`, `email`, `firstname`, `hs_object_id`, `hs_lead_status`, `lastmodifieddate`, `lastname`, `hs_buying_role` - **companies** - `createdate`, `domain`, `hs_lastmodifieddate`, `hs_object_id`, `hs_csm_sentiment`, `hs_lead_status`, `name` - **deals** - `amount`, `closedate`, `createdate`, `dealname`, `dealstage`, `hs_lastmodifieddate`, `hs_object_id`, `pipeline`, `hs_mrr` - **tickets** - `createdate`, `content`, `hs_lastmodifieddate`, `hs_object_id`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` - **quotes** - `hs_createdate`, `hs_expiration_date`, `hs_lastmodifieddate`, `hs_object_id`, `hs_public_url_key`, `hs_status`, `hs_title` - **emails** - `hs_timestamp`, `hs_lastmodifieddate`, `hs_object_id`, `hs_email_direction`, `hs_email_html`, `hs_email_status`, `hs_email_subject`, `hs_email_text`, `hs_attachment_ids`, `hs_email_headers` - **meetings** - `hs_timestamp`, `hs_lastmodifieddate`, `hs_object_id`, `hs_meeting_title`, `hs_meeting_body`, `hs_internal_meeting_notes`, `hs_meeting_external_URL`, `hs_meeting_location`, `hs_meeting_start_time`, `hs_meeting_end_time`, `hs_meeting_outcome`, `hs_activity_type`, `hs_attachment_ids` **Changing properties requires a full resync** Changing the synced properties after the initial import requires a full resync of your HubSpot data. Invalid properties are automatically filtered out. If all specified properties are invalid, the defaults are used instead. ## Selecting columns After the first sync completes, you can select which columns to include in future syncs: 1. Go to the [sources tab](https://app.posthog.com/data-management/sources) and click your HubSpot source. 2. Click **Configure** next to any schema. 3. Under **Columns**, select which columns to sync. Primary keys and internal columns (`_ph_*`, `_dlt_*`) are always synced and cannot be disabled. **Adding columns to existing syncs** When you add columns to a schema, PostHog prompts you to choose: - **Sync forward only** - New columns are populated only for future data. Existing rows show `NULL` for the new columns. - **Full resync** - Triggers a complete resync to backfill the new columns for all rows. > **Note:** This column selection feature is separate from **Customize synced properties**, which controls which HubSpot properties are fetched from the API during setup. Column selection lets you choose which already-synced columns appear in your warehouse tables after data has been imported. ## Supported tables | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `contacts` | A person tracked in HubSpot CRM — a lead, prospect, or customer. | Incremental, Full refresh | lastmodifieddate | — | | `deals` | A sales opportunity or transaction tracked through a pipeline in HubSpot CRM. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `companies` | An organization or business tracked in HubSpot CRM. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `tickets` | A customer support request tracked in HubSpot Service Hub. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `quotes` | A sales quote (proposal of products and prices) sent to a customer in HubSpot. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `emails` | A logged email engagement (sent or received) associated with CRM records in HubSpot. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `meetings` | A logged meeting engagement associated with CRM records in HubSpot. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `leads` | A potential customer tracked in HubSpot CRM, associated with a contact or company. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `calls` | A phone call logged against a contact, company, deal, or ticket. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `notes` | A free-text note logged against a CRM record. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `tasks` | A to-do item assigned to a user and linked to a CRM record. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `communications` | A message sent over an integrated channel such as SMS, WhatsApp, or LinkedIn. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `feedback_submissions` | A customer response to a HubSpot feedback survey (NPS, CSAT, or CES). | Incremental, Full refresh | hs\_lastmodifieddate | — | | `line_items` | An individual instance of a product sold on a deal or quote, with its own quantity and price. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `products` | A good or service sold by the company, used as the template for line items. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `invoices` | A bill issued to a customer through HubSpot Commerce. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `orders` | A customer order, typically synced from a connected commerce store. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `subscriptions` | A recurring commerce subscription billed through HubSpot. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `commerce_payments` | A payment collected through HubSpot Commerce against an invoice, quote, or payment link. | Incremental, Full refresh | hs\_lastmodifieddate | — | | `pipelines` | A pipeline that deals or tickets move through. Decodes the `pipeline` and `hs_pipeline` IDs carried on those records. | Full refresh | — | — | | `pipeline_stages` | A stage within a pipeline. Decodes the `dealstage` and `hs_pipeline_stage` IDs carried on deals and tickets. | Full refresh | — | — | | `properties` | The definition of a property on a CRM object, including custom properties. Use it to label and interpret the property columns on the object tables. | Full refresh | — | — | | `owners` | A HubSpot user who can own CRM records. Decodes the `hubspot_owner_id` carried on contacts, companies, deals, and tickets. | Full refresh | — | — | ## Troubleshooting If your sync is failing or data looks wrong, see the [Data warehouse troubleshooting guide](https://posthog.com/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.