# HubSpot

**What is HubSpot?**

The HubSpot node in StackAI enables seamless integration with HubSpot CRM, allowing you to automate, query, and manage your sales, marketing, and customer data directly within your workflow. This node connects to HubSpot’s powerful CRM features, making it easy to retrieve, create, or update contacts, deals, pipelines, and more.

***

**How to use it?**

To use the HubSpot node, add it to your StackAI workflow and select the desired action. Each action corresponds to a specific HubSpot operation, such as searching for deals, retrieving contact information, or creating new records. Configure the required inputs and connection settings, then connect the node to other workflow components to automate your business processes.

***

**Example of Usage**

Suppose you want to search for deals in your HubSpot CRM based on specific criteria. You would select the "Search Deals" action, provide the necessary search parameters, and connect the output to a reporting or notification node.

***

**Most Commonly Used Actions in HubSpot**

Below are the most frequently used actions available in the HubSpot node, along with their input, configuration, and output details:

***

#### 1. Search Deals

**Description:** Retrieve a list of deals from HubSpot CRM based on search criteria.

* **Inputs:**
  * `filters` (Required): Array of filter objects specifying search conditions (e.g., propertyName, operator, value).
  * `sorts` (Optional): Array of property names to sort results.
  * `limit` (Optional): Maximum number of results to return.
  * `after` (Optional): Pagination cursor for additional results.
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `results`: Array of deal objects matching the search criteria.
  * `total`: Total number of deals found.

**Example:**

```json
{
  "filters": [
    { "propertyName": "dealstage", "operator": "EQ", "value": "appointmentscheduled" }
  ],
  "limit": 5
}
```

***

#### 2. Get Full Deal Data

**Description:** Retrieve detailed information for a specific deal.

* **Inputs:**
  * `deal_id` (Required): The unique ID of the deal.
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `deal`: Full deal object with all properties.

**Example:**

```json
{
  "deal_id": "123456789"
}
```

***

#### 3. Get Contact with History

**Description:** Retrieve a contact’s details along with their historical changes.

* **Inputs:**
  * `contact_id` (Required): The unique ID of the contact.
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `contact`: Contact object with history.

**Example:**

```json
{
  "contact_id": "987654321"
}
```

***

#### 4. Create Deal

**Description:** Create a new deal in HubSpot CRM.

* **Inputs:**
  * `properties` (Required): Object containing deal properties (e.g., dealname, amount, pipeline, dealstage).
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `deal`: The newly created deal object.

**Example:**

```json
{
  "properties": {
    "dealname": "New Enterprise Deal",
    "amount": "50000",
    "pipeline": "default",
    "dealstage": "appointmentscheduled"
  }
}
```

***

#### 5. Create Contact

**Description:** Add a new contact to HubSpot CRM.

* **Inputs:**
  * `properties` (Required): Object containing contact properties (e.g., email, firstname, lastname).
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `contact`: The newly created contact object.

**Example:**

```json
{
  "properties": {
    "email": "jane.doe@example.com",
    "firstname": "Jane",
    "lastname": "Doe"
  }
}
```

***

#### 6. Get Pipeline

**Description:** Retrieve information about a specific pipeline.

* **Inputs:**
  * `pipeline_id` (Required): The unique ID of the pipeline.
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `pipeline`: Pipeline object with details.

**Example:**

```json
{
  "pipeline_id": "default"
}
```

***

#### 7. List Pipelines

**Description:** List all pipelines in your HubSpot account.

* **Inputs:** None.
* **Configurations:**
  * `connection_id` (Required): Your HubSpot connection ID.
* **Outputs:**
  * `pipelines`: Array of pipeline objects.

***

**Summary Table**

| Action                | Required Inputs | Required Configurations | Outputs        |
| --------------------- | --------------- | ----------------------- | -------------- |
| Search Deals          | filters         | connection\_id          | results, total |
| Get Full Deal Data    | deal\_id        | connection\_id          | deal           |
| Get Contact w/History | contact\_id     | connection\_id          | contact        |
| Create Deal           | properties      | connection\_id          | deal           |
| Create Contact        | properties      | connection\_id          | contact        |
| Get Pipeline          | pipeline\_id    | connection\_id          | pipeline       |
| List Pipelines        | None            | connection\_id          | pipelines      |

Showing 1-7 of 7 items

***

**Best Practices**

* Always provide the required `connection_id` to authenticate with your HubSpot account.
* Ensure all required input fields are filled to avoid errors.
* Use the outputs to connect to downstream nodes for further automation, such as notifications, reporting, or data enrichment.

***

**Example of Usage**

To automatically add a new contact when a user submits a form, use the "Create Contact" action, map the form fields to the required properties, and connect the output to a notification or CRM update node.

***

This guide helps you leverage the HubSpot node in StackAI to automate and streamline your CRM workflows efficiently.
