# HubSpot

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="/files/lHFJWByZdY9rdlklfRYl" 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="/files/T6rbRmcHF1zfzLugf5v1" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/mvxZsrSlmcBX12Xa0L3l" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/DyriW0gkPVJPGCle3BPB" 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="/files/ZdKGoeeXKX9tOYXNlVhQ" 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`

### 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="/files/ilIkW4rMhJUniuHWuLfS" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/IEPgHxLDvT6stQGVFvfi" alt=""><figcaption><p>Internal name is "firstname"</p></figcaption></figure>

***

## 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/integrations/marketing/integrating-hubspot-with-alhena-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
