> For the complete documentation index, see [llms.txt](https://alhena.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alhena.gitbook.io/docs/integrations/marketing/integrating-hubspot-with-alhena-ai.md).

# HubSpot

Capture leads from AI conversations and sync them to HubSpot CRM as contacts.

Automatically extract lead information from conversations and create or update contacts in HubSpot.

## Prerequisites

* A HubSpot account with admin access
* A HubSpot private app access token

## Getting Your API Token

1. In HubSpot, click the **Settings** icon (upper-right)
2. Go to **Integrations > Private Apps**

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FT5FQ9BTSSpQDJ1AR6pw3%2Fimage.png?alt=media&amp;token=9747d147-f7f2-43d7-b17e-044acd18bb1b" alt="" width="246"><figcaption></figcaption></figure>

3. Click **Create a private app**
4. Configure the app:
   * **App Name**: `Alhena AI` (or any name you prefer)
   * **Description**: Provides Alhena AI secure API access to HubSpot contacts

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FlYEZVUhh6TKJd5NEcb71%2Fimage.png?alt=media&amp;token=6f4ebf48-eb08-403d-a2a8-8a6e541c5657" alt=""><figcaption></figcaption></figure>

5. Under **Scopes**, select:
   * `crm.objects.contacts.read`
   * `crm.objects.contacts.write`

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FLJVSNiASDOf8nOccJuOB%2Fimage.png?alt=media&amp;token=cd5bbe32-f102-48de-a803-a28c571c8d2a" alt=""><figcaption></figcaption></figure>

6. Click **Create app**
7. Copy the access token from the modal that appears

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2F9K4VSpscFibCnuGNtfB9%2Fimage.png?alt=media&amp;token=1261ded7-5953-4856-b0f7-293581f073d5" alt=""><figcaption></figcaption></figure>

## Setup

### Step 1: Connect HubSpot

1. In Alhena, go to **Settings > Integrations**
2. Find **HubSpot** and click **Enable**
3. Paste your HubSpot access token
4. Click **Connect**

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FBeA5o6V5LLcqCM5dv3qP%2Fimage.png?alt=media&amp;token=48dd0a6b-5f99-4897-81f5-f68d482d9fad" alt=""><figcaption><p>HubSpot lead generation tool settings</p></figcaption></figure>

### Step 2: Configure Attributes

Choose which information to extract from conversations and map it to HubSpot contact properties:

1. Click **Add attribute**
2. Enter the **Attribute name** (must match the HubSpot internal property name, e.g., `firstname`, `email`, `phone`)
3. Add a **Description** to help the AI identify this information in conversations
4. Optionally add **Examples** of values

Default attributes (pre-configured):

* `email`
* `firstname`
* `lastname`

{% hint style="info" %}
These attributes tell Alhena what to extract and sync; they do not make the AI proactively request the information. Add a matching [lead-capture guideline](/docs/integrations/marketing.md#set-up-proactive-lead-capture), or ask [AI Help](/docs/features/ai-help.md) to draft one. Configure a HubSpot attribute for every value the guideline collects.
{% endhint %}

### Finding HubSpot Internal Property Names

To find the internal name for a HubSpot property:

1. In HubSpot, go to **Settings > Data Management > Properties**
2. Click on any property (e.g., First Name)

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FeVTEbhAwH09gOLBmJxFp%2Fimage.png?alt=media&amp;token=fff3b598-33fc-418f-803e-bc1743a6dd61" alt=""><figcaption></figcaption></figure>

3. Note the **Internal name** - this is what you use as the attribute name

<figure><img src="https://2864633804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKZ3bWFAIdLAqpW2uafZ4%2Fuploads%2FLJpntiJTjJaqrjzZfVSD%2Fimage.png?alt=media&amp;token=dd040a93-d02b-40a1-95df-3fa6c6b3d2ce" alt=""><figcaption><p>Internal name is "firstname"</p></figcaption></figure>

***

## Conversation Notes

On the HubSpot settings page, toggle **Enable Alhena conversation notes in HubSpot** to have Alhena automatically record each conversation as a note on the corresponding HubSpot lead. This toggle is available once HubSpot is connected.

***

## Enabled Agents

When you connect HubSpot, lead capture is enabled for the lead generation agent:

| Agent                     | Description                                                                 |
| ------------------------- | --------------------------------------------------------------------------- |
| **Lead generation agent** | Extracts configured attributes from conversations and syncs them to HubSpot |

You can configure this agent in **AI Settings > Agents**.

***

## Disconnecting

To disconnect HubSpot:

1. Go to **Settings > Integrations > HubSpot**
2. Click **Disconnect**
3. Confirm the disconnection
