> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Hubspot connector

> Connect Mammoth to HubSpot with OAuth, query CRM tables with SQL or plain-language AI query generation, and save the results as a dataset.

The HubSpot connector imports CRM data from your HubSpot account into Mammoth as a dataset. Authenticate with OAuth—no API keys required. Supports AI query generation for natural-language data selection.

## Before you start

You need:

- A HubSpot account with access to the data you want to import

## Step 1: Select the HubSpot connector

1. In Mammoth, go to **Data Library** and click **+ New Dataset**
2. Select **Connectors**
3. Search for **HubSpot**
4. Click the **HubSpot** tile

## Step 2: Authenticate with HubSpot

Click **New Connection** to start the OAuth flow.

Mammoth sends you to HubSpot's authorization page in the same browser tab. Sign in and authorize Mammoth. You're redirected back to Mammoth automatically.

## Step 3: Select a HubSpot table and query your data

Select the connection under **Existing Connections** to open the query builder. The **List of tables** panel shows the tables this connector exposes. Click a table to load a `SELECT *` query for it and its preview.

### Write a custom HubSpot query

Edit the SQL in the **Enter SQL query** editor and click **Run**. Use the table and column names shown in the table list and the preview.

### Generate a HubSpot query with AI

Use the **Describe the data you need...** box above the query editor to tell Mammoth what you want in plain language—for example, *"all customers who became customers this year"*—and click the generate button. Mammoth writes the SQL query based on your table structure and description. The box appears only when AI query is enabled for your workspace, and it is disabled while Mammoth sets up metadata for AI query.

See [Understanding data preview & query](https://docs.mammoth.io/learn/connectors/understanding-data-preview-query/) for a full guide.

## Step 4: Save the HubSpot dataset

1. Enter a **dataset name** in the **Save table as** field (e.g., *"HubSpot Contacts"*)
2. Check the **Update Method** (the default is **Replace all data**). To change it, click the edit icon, pick an option, and click **Save changes**:
   - **Replace all data**—Replaces all existing data
   - **Add new data**—Adds new data based on a unique sequential column
   - **Replace with new data**—Replaces existing data with new data based on a unique sequential column
   For **Add new data** and **Replace with new data**, also choose a **Key column**—a numeric or date column with incrementing values, such as an ID or a date.
3. Click **Save as dataset**. When the dataset is saved, click **Done**

## Troubleshoot HubSpot connections

### Table not visible

- Check the HubSpot user's permissions—the user needs access to that type of data in HubSpot

---
Source: https://docs.mammoth.io/learn/connectors/hubspot-connector.md · Updated: 2026-10-13