> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HubSpot

> Query HubSpot deals, contacts, companies, tickets and leads live from Explore and AI agents

The HubSpot [live source](https://docs.lightdash.com/integrations/live-sources) reads the deals, contacts, companies, tickets and leads in your HubSpot CRM, plus your deal and ticket pipelines.

## Before you start

* **A service key** with the scopes below, from **Development** → **Keys** → **Service keys** in HubSpot. An existing private app's access token also works.

## Scopes

| Scope | Why |
| - | - |
| `crm.objects.deals.read`, `crm.schemas.deals.read` | Read deals and their properties |
| `crm.objects.contacts.read`, `crm.schemas.contacts.read` | Read contacts and their properties |
| `crm.objects.companies.read`, `crm.schemas.companies.read` | Read companies and their properties |
| `crm.objects.tickets.read`, `crm.schemas.tickets.read` | Read tickets and their properties |
| `crm.objects.leads.read` | Reads leads |
| `crm.objects.owners.read` | Shows owner names instead of IDs |
| `crm.objects.custom.read`, `crm.schemas.custom.read` | Optional, for custom objects (HubSpot Enterprise) |

## Connect HubSpot

[Add a live source](https://docs.lightdash.com/integrations/live-sources/set-up-and-manage.md#connect-a-live-source), select **HubSpot**, and enter the **Access token**.

![The Add HubSpot source dialog, with a Scopes card listing the read scopes for deals, contacts, companies, tickets and leads, an Authentication card with the Access token field and a Test button, a Details card with the Name field, and the Add source button](https://mintcdn.com/lightdash/WuPlti30p6CHhcUC/images/integrations/live-sources/hubspot-config.png?fit=max\&auto=format\&n=WuPlti30p6CHhcUC\&q=85\&s=aa6774ed6dcccc5eaf7e4cb99a836e02)

## Semantic layer

> [!NOTE]
>
> Each custom object in your HubSpot account also gets its own explore.

### Deals

Deals in HubSpot, one row per record, with their properties

| Field | Description |
| - | - |
|  Record ID | HubSpot's ID for the record |
|  Create Date | When the record was created, in UTC |
|  Last Modified Date | When the record last changed, in UTC |
|  Count | Number of deals that match the filters |

Your deal properties also show up as fields.

### Contacts

Contacts in HubSpot, one row per record, with their properties

| Field | Description |
| - | - |
|  Record ID | HubSpot's ID for the record |
|  Create Date | When the record was created, in UTC |
|  Last Modified Date | When the record last changed, in UTC |
|  Count | Number of contacts that match the filters |

Your contact properties also show up as fields.

### Companies

Companies in HubSpot, one row per record, with their properties

| Field | Description |
| - | - |
|  Record ID | HubSpot's ID for the record |
|  Create Date | When the record was created, in UTC |
|  Last Modified Date | When the record last changed, in UTC |
|  Count | Number of companies that match the filters |

Your company properties also show up as fields.

### Tickets

Tickets in HubSpot, one row per record, with their properties

| Field | Description |
| - | - |
|  Record ID | HubSpot's ID for the record |
|  Create Date | When the record was created, in UTC |
|  Last Modified Date | When the record last changed, in UTC |
|  Count | Number of tickets that match the filters |

Your ticket properties also show up as fields.

### Leads

Leads in HubSpot, one row per record, with their properties

| Field | Description |
| - | - |
|  Record ID | HubSpot's ID for the record |
|  Create Date | When the record was created, in UTC |
|  Last Modified Date | When the record last changed, in UTC |
|  Count | Number of leads that match the filters |

Your lead properties also show up as fields.

### Pipeline stages

Deal and ticket pipelines in HubSpot and their stages, one row per stage, with the names HubSpot shows

| Field | Description |
| - | - |
|  Object | Object the pipeline belongs to: Deals or Tickets |
|  Pipeline ID | Pipeline's internal ID, as records store it |
|  Pipeline | Pipeline name as HubSpot shows it |
|  Pipeline order | Pipeline's display order in HubSpot; lower comes first |
|  Stage ID | Stage's internal ID, as records store it |
|  Stage | Stage name as HubSpot shows it |
|  Stage order | Stage's display order in its pipeline; lower comes first |
|  Deal probability | For deal stages, the probability that a deal in this stage closes as won, from 0 to 1. Empty for ticket stages |
|  Is closed | Whether records in this stage are closed: won or lost deals, or closed tickets |

## Limits

| Limit | Value |
| - | - |
| Most rows per query | 1,000 |
| Filter conditions per query | 6, with a date range counting as two |
| Properties per object | 400, your own before HubSpot's `hs_` properties |
| Sorts per query | 1 |
| Count | Can't be split by a field |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.