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

# HubSpot

> How to connect HubSpot to a ChatNorris agent with a service key, and what the agent syncs in your CRM: contacts, companies and Lead objects.

# HubSpot

With the HubSpot integration, the leads your ChatNorris agent confirms reach your CRM on their own, without leaving the chat or exporting anything by hand. When the agent has a visitor's email confirmed, depending on what you turn on:

* it creates or updates the visitor as a Contact in HubSpot;
* it finds or creates their company and associates it with the contact;
* it creates a Lead record associated with the contact.

ChatNorris never reads or changes any other data in your HubSpot account.

## Requirements

* A ChatNorris account on the **Standard** or **Premium** plan. You can see the plans at [chatnorris.ai/pricing](https://chatnorris.ai/pricing).
* At least one agent created in ChatNorris. If you don't have one yet, follow [Create an agent](https://docs.chatnorris.ai/en/guias/crear-agente-wizard.md).
* A HubSpot account where you can create a service key (or a Private App token you already have).
* For the **Create Lead object** capability, your HubSpot account must have the Leads tool available.
* The **Owner** or **Admin** role in your ChatNorris organization.

## Connect HubSpot

Each agent connects to one HubSpot account.

**1. Create the service key in HubSpot**

In HubSpot, go to **Development → Keys → Service keys** and create a new key. An existing Private App token also works.

**2. Grant the scopes**

The contact scopes are required. The company and lead scopes are only needed if you're going to turn on those capabilities in the Action:

| Scopes | What for |
| - | - |
| `crm.objects.contacts.read` and `crm.objects.contacts.write` | Required: **Sync contact**. |
| `crm.objects.companies.read` and `crm.objects.companies.write` | **Sync company**. |
| `crm.objects.leads.read` and `crm.objects.leads.write` | **Create Lead object**. |

Create the key and copy it.

**3. Open the agent's Integrations hub**

In ChatNorris, go to `My agents → [your agent] → Integrations` and choose **HubSpot**.

**4. Paste the key and connect**

Paste the key in **Service key** and click **Connect**. With **Test connection** you confirm that the key works before you use it in the Action.

The key is stored in ChatNorris and the hub only shows its last 4 characters. If you rotate it in HubSpot, use **Replace key** in the row's **···** menu: the connection stays the same and the Action is not affected.

## Configure the Action

Connecting HubSpot doesn't sync anything yet. To choose what the agent does in your CRM:

**1. Create the HubSpot Action**

Go to `My agents → [your agent] → Actions`, click **New action**, and choose **HubSpot**.

**2. Choose the capabilities**

Turn on the ones you want (see the table below). The three are independent, but hierarchical: **Sync company** and **Create Lead object** require **Sync contact** to be on.

**3. Turn on the Action and save**

With **Action enabled** on, click **Save**. From then on, this agent's confirmed leads reach HubSpot.

| Capability | What it does in HubSpot | HubSpot scopes |
| - | - | - |
| **Sync contact** | Creates or updates a Contact every time a visitor's email is confirmed. New contacts enter as a Lead with status **New**; existing ones are never overwritten. | `crm.objects.contacts.read` and `.write` |
| **Sync company** | Searches for the visitor's company by its exact name, creates it if it doesn't exist, and associates it with the contact. It uses the lead's Company property or, if it isn't there, its "Empresa"/"Company" custom field. | `crm.objects.companies.read` and `.write` |
| **Create Lead object** | Creates a Lead record associated with the contact, only once per lead. Requires your HubSpot account to have the Leads tool available. | `crm.objects.leads.read` and `.write` |

> [!NOTE]
>
> The sync repeats every time the agent has the visitor's email confirmed: HubSpot creates the contact or updates the existing one (it looks it up by email), so a phone or a name the visitor fills in later also reaches HubSpot, as long as that field is empty in the contact. Only the Lead object is created just once per lead.

## Disconnect

In `My agents → [your agent] → Integrations → HubSpot`, click **Disconnect** (it's also in the row's **···** menu). Lead sync is disabled: the HubSpot Action is turned off, but it isn't deleted and keeps its configuration. The key is deleted from ChatNorris. To sync again, connect HubSpot again and reactivate the Action.

If you only want to stop it for a while, turn off the integration's **Active** switch: the key is kept and the Action doesn't call HubSpot until you reactivate it.

## Frequently asked questions

> [accordion] Can I use a Private App token instead of a service key?
>
> Yes. An existing Private App token still works: paste it in the same **Service key** field. Check that it has the scopes of the capabilities you're going to turn on.

> [accordion] Does the sync overwrite the data I already have in HubSpot?
>
> No. If the contact already exists (ChatNorris looks it up by email), only the first name, last name and phone that are empty in HubSpot are filled in; if nothing is missing, the contact isn't touched. Its lifecycle stage and lead status don't change either, because it could be further along in your funnel. New contacts enter as a Lead with status **New**.

> [accordion] The Lead object isn't created
>
> Check that **Create Lead object** is on, that the key has the `crm.objects.leads.read` and `crm.objects.leads.write` scopes, and that your HubSpot account has the Leads tool available. The Lead object is created only once per lead.

> [accordion] Does connecting HubSpot use credits?
>
> No. Connecting and testing the integration has no cost in credits. See [AI models and credits](https://docs.chatnorris.ai/en/guias/modelos-ia-creditos.md).

> [accordion] Can I connect two HubSpot accounts to the same agent?
>
> No. Each provider supports only one connection per agent. If you need different accounts, use separate agents.


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