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

# Hubspot

> Integrate your application with the Hubspot API

## 🚀 Quickstart

Connect to Hubspot with Nango and see data flow in 2 minutes.

<Steps>
  <Step title="Create the integration">
    In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Hubspot*.
  </Step>

  <Step title="Authorize Hubspot">
    Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then log in to Hubspot. Later, you'll let your users do the same directly from your app.
  </Step>

  <Step title="Call the Hubspot API">
    Let's make your first request to the Hubspot API (fetch a list of contacts). Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.nango.dev/proxy/crm/v3/objects/contacts?properties=email,phone" \
          -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
          -H "Provider-Config-Key: <INTEGRATION-ID>" \
          -H "Connection-Id: <CONNECTION-ID>"
        ```
      </Tab>

      <Tab title="Node">
        Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

        ```typescript theme={null}
        import { Nango } from '@nangohq/node';

        const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

        const res = await nango.get({
            endpoint: '/crm/v3/objects/contacts',
            params: { properties: "email,phone" },
            providerConfigKey: '<INTEGRATION-ID>',
            connectionId: '<CONNECTION-ID>'
        });

        console.log(res.data);
        ```
      </Tab>
    </Tabs>

    Or fetch credentials with the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
  </Step>

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/guides/primitives/auth) to integrate Nango in your app.

    To obtain your own production credentials, follow the setup guide linked below.
  </Step>
</Steps>

## 📚 Hubspot Integration Guides

Nango maintained guides for common use cases.

* [How to register your own Hubspot OAuth app](/api-integrations/hubspot/how-to-register-your-own-hubspot-api-oauth-app)\
  Register an OAuth app with Hubspot and obtain credentials to connect it to Nango

Official docs: [Hubspot API docs](https://developers.hubspot.com/docs/reference/api/overview)

## 🧩 Pre-built syncs & actions for Hubspot

Enable them in your dashboard. Extend and customize to fit your needs.

### Account

| Function name               | Description                                                                      | Type                                         | Source code                                                                                                                       |
| --------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `fetch-account-information` | Retrieve portal account details, currency settings, timezone, and hosting region | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/fetch-account-information.ts) |

### Associations

| Function name        | Description                    | Type                                         | Source code                                                                                                                |
| -------------------- | ------------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `create-association` | Associate two records together | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-association.ts) |

### CRM

| Function name          | Description                                                    | Type                                         | Source code                                                                                                                  |
| ---------------------- | -------------------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `fetch-custom-objects` | Retrieve HubSpot custom object schemas for enterprise accounts | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/fetch-custom-objects.ts) |
| `fetch-properties`     | List CRM property metadata for a specified HubSpot object type | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/fetch-properties.ts)     |

### Companies

| Function name            | Description                       | Type                                           | Source code                                                                                                                    |
| ------------------------ | --------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `batch-create-companies` | Create multiple companies at once | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/batch-create-companies.ts) |
| `batch-update-companies` | Update multiple companies at once | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/batch-update-companies.ts) |
| `create-company`         | Create a company record           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-company.ts)         |
| `delete-company`         | Delete a company record           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-company.ts)         |
| `get-company`            | Get a company by ID               | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-company.ts)            |
| `list-companies`         | List company records              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-companies.ts)         |
| `search-companies`       | Search companies by criteria      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/search-companies.ts)       |
| `update-company`         | Update a company record           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-company.ts)         |
| `companies`              | Sync companies from HubSpot CRM   | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/companies.ts)                |

### Contacts

| Function name    | Description             | Type                                           | Source code                                                                                                            |
| ---------------- | ----------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `create-contact` | Create a contact record | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-contact.ts) |
| `delete-contact` | Delete a contact record | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-contact.ts) |
| `get-contact`    | Get a contact by ID     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-contact.ts)    |
| `list-contacts`  | List contact records    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-contacts.ts)  |
| `update-contact` | Update a contact record | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-contact.ts) |
| `contacts`       | Sync contacts           | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/contacts.ts)         |

### Deals

| Function name  | Description                                                                                          | Type                                           | Source code                                                                                                          |
| -------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `create-deal`  | Create a deal record in HubSpot                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-deal.ts)  |
| `delete-deal`  | Delete a deal record                                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-deal.ts)  |
| `get-deal`     | Get a deal by ID                                                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-deal.ts)     |
| `list-deals`   | List deal records from HubSpot CRM                                                                   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-deals.ts)   |
| `search-deals` | Search deals by criteria                                                                             | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/search-deals.ts) |
| `update-deal`  | Update a deal record in HubSpot CRM                                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-deal.ts)  |
| `deals`        | Sync deals with amount, close date, stage, owner, description, and associated companies and contacts | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/deals.ts)          |

### Forms

| Function name | Description | Type                                         | Source code                                                                                                        |
| ------------- | ----------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| `list-forms`  | List forms  | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-forms.ts) |

### Marketing

| Function name           | Description                 | Type                                         | Source code                                                                                                                   |
| ----------------------- | --------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `get-marketing-email`   | Get a marketing email by ID | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-marketing-email.ts)   |
| `list-marketing-emails` | List marketing emails       | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-marketing-emails.ts) |

### Marketing Emails

| Function name            | Description                         | Type                                           | Source code                                                                                                                    |
| ------------------------ | ----------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `clone-marketing-email`  | Clone an existing marketing email   | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/clone-marketing-email.ts)  |
| `create-marketing-email` | Create a marketing email in HubSpot | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-marketing-email.ts) |
| `delete-marketing-email` | Delete a marketing email            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-marketing-email.ts) |
| `update-marketing-email` | Update a marketing email            | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-marketing-email.ts) |
| `marketing-emails`       | Sync marketing emails from HubSpot  | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/marketing-emails.ts)         |

### Notes

| Function name | Description                                                                                                                                  | Type                                         | Source code                                                                                                         |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-note` | Create a HubSpot note with body, timestamp, owner, optional attachments, and an explicit association to a contact, company, deal, or ticket. | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-note.ts) |

### Owners

| Function name | Description                                                         | Type                                           | Source code                                                                                                       |
| ------------- | ------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `get-owner`   | Get an owner by ID                                                  | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-owner.ts) |
| `owners`      | Sync HubSpot owners with names, email, user IDs, and archive status | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/owners.ts)      |

### Pipelines

| Function name     | Description                                                       | Type                                         | Source code                                                                                                             |
| ----------------- | ----------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `fetch-pipelines` | List pipelines and stages for an object type, defaulting to deals | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/fetch-pipelines.ts) |

### Products

| Function name | Description                                                           | Type                                           | Source code                                                                                                    |
| ------------- | --------------------------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `products`    | Sync product records with pricing, SKU, quantity, and billing details | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/products.ts) |

### Properties

| Function name     | Description                                                      | Type                                         | Source code                                                                                                             |
| ----------------- | ---------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `create-property` | Create a custom CRM property for a specified HubSpot object type | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-property.ts) |

### Tasks

| Function name | Description                                                                                                                             | Type                                           | Source code                                                                                                         |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `create-task` | Create a HubSpot task with type, title, priority, assignee, due date, notes, and optional associations to contacts, companies, or deals | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-task.ts) |
| `delete-task` | Delete a HubSpot task by record ID                                                                                                      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-task.ts) |
| `update-task` | Update a HubSpot task's fields, owner, due date, and associations                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-task.ts) |
| `tasks`       | Sync tasks with type, title, priority, assignee, due date, notes, and related contacts, companies, and deals                            | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/tasks.ts)         |

### Tickets

| Function name     | Description                                                                                | Type                                           | Source code                                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `create-ticket`   | Create a support ticket in HubSpot CRM                                                     | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-ticket.ts)  |
| `delete-ticket`   | Delete a support ticket                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-ticket.ts)  |
| `get-ticket`      | Get a ticket by ID                                                                         | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/get-ticket.ts)     |
| `list-tickets`    | List support tickets                                                                       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/list-tickets.ts)   |
| `search-tickets`  | Search tickets by criteria                                                                 | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/search-tickets.ts) |
| `update-ticket`   | Update a support ticket                                                                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/update-ticket.ts)  |
| `service-tickets` | Sync service tickets with subject, content, owner, pipeline, stage, category, and priority | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/service-tickets.ts)  |

### Users

| Function name      | Description                                                          | Type                                           | Source code                                                                                                              |
| ------------------ | -------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `change-user-role` | Update a HubSpot user's role and team assignments                    | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/change-user-role.ts) |
| `create-user`      | Provision a HubSpot user with email, role, and team assignments      | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/create-user.ts)      |
| `delete-user`      | Delete a HubSpot provisioned user by ID                              | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-user.ts)      |
| `fetch-roles`      | List available user roles for a HubSpot enterprise account           | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/fetch-roles.ts)      |
| `whoami`           | Retrieve the current authenticated HubSpot user's ID and email       | [Action](/guides/functions/action-functions)   | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/whoami.ts)           |
| `users`            | Sync provisioned users with role IDs, primary team, and admin status | [Sync](/guides/functions/syncs/sync-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/syncs/users.ts)              |

### Workflows

| Function name       | Description                   | Type                                         | Source code                                                                                                               |
| ------------------- | ----------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `delete-a-workflow` | Delete an automation workflow | [Action](/guides/functions/action-functions) | [🔗 Github](https://github.com/NangoHQ/integration-templates/blob/main/integrations/hubspot/actions/delete-a-workflow.ts) |

***
