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

# HubSpot

> Connect HubSpot to Triggr with a HubSpot service key and map your clients to companies.

Triggr maps your clients to HubSpot companies and works with CRM records such as contacts, companies, deals and custom objects.

You need Super Admin or the Developer tools access permission in HubSpot.

## Set up HubSpot

<Tabs>
  <Tab title="Service key">
    1. In HubSpot, go to **Development > Keys > Service keys** (or Settings > Integrations > Service Keys) and click Create service key.
    2. Click Add new scope, tick the scopes below and click Update.
    3. Click Create and confirm, then click Show and Copy. The key starts with `pat-`.
  </Tab>

  <Tab title="Private app token">
    Service keys are in public beta. If your account doesn't have them, use a private app; Triggr treats its token the same way.

    1. In HubSpot, go to **Development > Legacy apps**, click Create legacy app and choose Private.
    2. On the Scopes tab, click Add new scope, tick the scopes below and click Update.
    3. Click Create app, then Continue creating. On the Auth tab, click Show token, then Copy.
  </Tab>
</Tabs>

| Scope | Enables |
| - | - |
| `crm.objects.companies.read` | Required. Client mapping, and looking up and searching companies |
| `crm.objects.companies.write` | Creating, updating and deleting companies |
| `crm.objects.contacts.read` | Reading and searching contacts |
| `crm.objects.contacts.write` | Creating, updating and deleting contacts |
| `crm.objects.deals.read` | Reading and searching deals |
| `crm.objects.deals.write` | Creating, updating and deleting deals |
| `crm.objects.custom.read` | Reading and searching custom objects |
| `crm.objects.custom.write` | Creating, updating and deleting custom objects |

## Connect it in Triggr

<Steps>
  <Step title="Open the integration">
    Go to **Integrations > HubSpot** and click Configure on the Base Configuration card.

    <Frame>
      <img src="https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/integrations-common/base-configuration.png?fit=max&auto=format&n=nyuVXZ1rouDTTEvu&q=85&s=bb81acb082055015f91beda7b4876f35" alt="The Base Configuration card with Status Not Configured, Admin Consent Not Required and a Configure button." width="2272" height="330" data-path="images/integrations-common/base-configuration.png" />
    </Frame>
  </Step>

  <Step title="Enter the key">
    Paste the key or token into API Key, then click Save Configuration.

    <Frame>
      <img src="https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/hubspot/configure.png?fit=max&auto=format&n=nyuVXZ1rouDTTEvu&q=85&s=5f152f5533471db8d92b4a9ac96cc972" alt="The HubSpot configuration window with an API Key field, an Allow insecure TLS switch under Advanced, and a Save Configuration button." width="1344" height="898" data-path="images/hubspot/configure.png" />
    </Frame>
  </Step>
</Steps>

CRM record actions take the object type, such as `contacts`, or a custom object's type ID, such as `2-3465404`.

## Map your clients

On the Client Mapping card, click **Apply 100% Matches**, then choose the HubSpot company in Mapped to for anyone left. Triggr saves each match as the client's `hubspotId` variable.

<Frame caption="The Client Mapping card, shown here for ConnectWise Manage.">
  <img src="https://mintcdn.com/triggr/nyuVXZ1rouDTTEvu/images/integrations-common/client-mapping.png?fit=max&auto=format&n=nyuVXZ1rouDTTEvu&q=85&s=da797e78dc917005df8e55c6b6cb166b" alt="The Client Mapping card with All, Mapped and Unmapped filters, Acme Corp mapped to Acme Corp with a 75% suggested mapping, and Globex unmapped with a Select ConnectWise Manage clients dropdown." width="2272" height="702" data-path="images/integrations-common/client-mapping.png" />
</Frame>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication errors (401)">
    The key was rotated, expired or deleted, or pasted with spaces. Paste a fresh copy into API Key.
  </Accordion>

  <Accordion title="Permission errors (403 or MISSING_SCOPES)">
    Edit the key (or click Edit app for a private app) and add the missing scope.
  </Accordion>

  <Accordion title="Companies are missing from Client Mapping">
    Check the key has `crm.objects.companies.read` and the companies have a Name, then click Refresh.
  </Accordion>

  <Accordion title="Rotate the key">
    On the key's page in HubSpot, click Rotate, then paste the new key into Triggr. Rotate and expire later keeps the old key working for 7 days; Rotate and expire now stops it immediately.
  </Accordion>
</AccordionGroup>


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