# HubSpot Private App Setup

This guide explains how to generate API credentials for integrating HubSpot with Dapta. The process consists of two steps:

1. **Creating a Private App in HubSpot** to generate an API key.
2. **Creating a Credential in Dapta** and using it in the **Flow Builder**.

***

### 📌 **Prerequisites**

Before starting, make sure you have:

✅ **Admin access** to a HubSpot account.\
✅ **Permissions to create a Private App in HubSpot.**\
✅ **Access to Dapta with integration privileges and the Flow Builder module.**

***

### 🛠 **Step 1: Creating a Private App in HubSpot**

To integrate HubSpot with Dapta, you need to generate an API key by creating a **Private App** in HubSpot. Follow these steps:

#### 1️⃣ **Access the Private Apps Section**

1. Log in to your **HubSpot account**.
2. Click the **settings icon (⚙️)** in the top navigation bar.
3. In the left menu, navigate to **Integrations > Private Apps**.
4. Click **"Create a private app"**.\ <br>

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

#### 2️⃣ **Set Up the Private App**

1. In the **Basic Info** section:

   * Set the **App Name** to `Dapta Integration`.
   * (Optional) Add a **description** such as: *Allows Dapta to access HubSpot data for automation.*

   <div data-full-width="true"><figure><img src="/files/7OxtLsgkeAfn5hlQc6Xi" alt=""><figcaption></figcaption></figure></div>
2. Navigate to the **Scopes** tab.

   <figure><img src="/files/0vYur32JRZMaaZ4ofDhw" alt=""><figcaption></figcaption></figure>
3. Enable the following permissions:

   \
   Dapta requires specific scopes to ensure seamless integration with HubSpot. Below is the list of **recommended scopes** that enable essential CRM functionalities such as managing contacts, companies, and deals.\
   \
   ✅ crm.objects.contacts.read\
   ✅ crm.objects.contacts.write\
   ✅ crm.objects.companies.read\
   ✅ crm.objects.companies.write\
   ✅ crm.objects.deals.read\
   ✅ crm.objects.deals.write\
   ✅ crm.objects.owners.read\
   ✅ crm.lists.read\
   ✅ crm.lists.write\
   ✅ crm.schemas.contacts.write\
   ✅ crm.schemas.companies.write\
   ✅ crm.schemas.deals.write\
   ✅ crm.schemas.contacts.read\
   ✅ crm.schemas.companies.read\
   ✅ crm.schemas.deals.read\
   \
   **Note:** Depending on your specific use case, you may need to enable additional scopes to meet your integration needs.<br>
4. Once you've finished configuring the settings, go to the top of the page and click **Create app**.<br>

   <figure><img src="/files/8GMsIKqFVM8tMmeTvl55" alt=""><figcaption></figcaption></figure>
5. **Retrieve the API Key**<br>

   After creating the app, HubSpot will generate an **API key**.\
   **Copy this key immediately**, as HubSpot will not display it again after this step.\
   Store the API key securely, as it will be required in Dapta for authentication.<br>

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

{% hint style="success" %}
🚀 Now that you have your HubSpot API key, you can move on to **Step 2: Creating a Credential in Dapta**.
{% endhint %}


---

# 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.dapta.ai/integrations/hubspot-private-app-setup.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.
