# HubSpot (Legacy)

## Overview

The **HubSpot Book** integrates with HubSpot, enabling you to manage contacts, deals, and other CRM data within your automations seamlessly.

## Prerequisites

1. **HubSpot Account**: You need to have an active HubSpot account. If you do not have one, you can sign up for a HubSpot trial account to get started.
2. **Access Token**: Obtain your HubSpot access token, which is used to securely access HubSpot via the API. You can generate this token in your HubSpot account settings under "Integrations" > "API Key". You may need to contact your company’s IT support for access tokens.

### Learning the HubSpot Book

1. Navigate to **Books → All Books.**
2. Search for **HubSpot** (Legacy) and click on it.
3. Click on **Add Connection.**
4. Add in the credentials when you are prompted:
   1. **HubSpot Access Token**: The access token for your HubSpot account. This token is used to authenticate API requests and can be generated in your HubSpot account settings.

## Fetching Data from Hubspot

### **Retrieving HubSpot's Contacts**

To fetch contacts from HubSpot:

```
connect to hubspot where
    the hubspot token is "example-token-123"
get hubspot's contacts
```

### **Retrieving HubSpot's Deals**

To fetch deals from HubSpot:

```
connect to hubspot where
    the hubspot token is "example-token-123"
get hubspot's deals as a csv
```

### **Retrieving HubSpot's Companies**

To fetch companies from HubSpot:

```
connect to hubspot where
    the hubspot token is "example-token-123"
get hubspot's companies as a csv
```

### **Retrieving HubSpot's Line Items**

To fetch line items from HubSpot:

```
connect to hubspot where
    the hubspot token is "example-token-123"
get hubspot's line items as a csv
```


---

# 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://docs.kognitos.com/legacy/legacy-experience/books/reference/hubspot-legacy.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.
