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

# HubSpot

> Provider ID: `HubSpot`

## Getting Started

You can connect to the HubSpot API using a service key or an OAuth app. For connecting a single HubSpot account, we recommend using a service key.

### Service Key Setup

<Steps>
  <Step title="Create a HubSpot Service Key">
    In your HubSpot account, navigate to **Development** > **Keys** > **Service keys**. Click **Create service key**, enter a name, then click **Add new scope** to select the scopes required by your workflows (e.g. `crm.objects.contacts.read`).

    <Note>
      You must be a Super Admin or have the Developer tools access permission to create and manage service keys.
    </Note>
  </Step>

  <Step title="Configure the HubSpot Integration in Strata">
    Select HubSpot in the [Strata Integration Catalog](https://app.connectstrata.com/integrations/catalog). Enter your HubSpot service key.
  </Step>
</Steps>

### OAuth App Setup

<Steps>
  <Step title="Install the HubSpot CLI">
    [Install the HubSpot CLI](https://developers.hubspot.com/docs/developer-tooling/local-development/hubspot-cli/install-the-cli) and authenticate it with your account using the `hs account auth` command. Make sure you're using v7.6.0 or later.
  </Step>

  <Step title="Create a HubSpot App">
    Run `hs project create` in your terminal and select **App** when prompted. Choose **OAuth** as the authentication type and select the [scopes](https://developers.hubspot.com/docs/reference/api/other-resources/scopes) required by your workflows.

    In your app's `app-hsmeta.json`, add the Strata OAuth callback URL to the `redirectUrls` array:

    ```text theme={null}
    https://connect.connectstrata.com/oauth/callback
    ```

    Upload your project to HubSpot by running `hs project upload`.
  </Step>

  <Step title="Get your Client ID and Client Secret">
    Run `hs project open` to navigate to your project in HubSpot. Click the name of your app, then open the **Auth** tab. Copy the **Client ID** and **Client secret** under *Client credentials*.
  </Step>

  <Step title="Configure the HubSpot Integration in Strata">
    Select HubSpot in the [Strata Integration Catalog](https://app.connectstrata.com/integrations/catalog). Enter your HubSpot app's client ID, client secret, and required scopes.

    <Note>
      The scopes in the Strata dashboard should match the scopes you configured in your HubSpot app.
    </Note>
  </Step>
</Steps>
