> For the complete documentation index, see [llms.txt](https://docs.appstrategy.com/apprules-r-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/marketing/hubspot.md).

# HubSpot

### &#x20;<a href="#authenticating-to-hubspot" id="authenticating-to-hubspot"></a>

### Authenticating to HubSpot <a href="#authenticating-to-hubspot" id="authenticating-to-hubspot"></a>

There are two authentication methods available for connecting to HubSpot data source: PrivateAppToken-based and OAuth Authentication.

Some tables in the HubspotV3 schema may not work with the OAuth mechanism. This API limitation restricts their usage only to the PrivateAppToken-based authentication. Specifically, each table in the data-model section will mention the supported authentication mechanism.

#### Private App Token <a href="#private-app-token" id="private-app-token"></a>

To connect using a Hubspot Private App Token, set the AuthScheme property to PrivateAppToken and OAuthAccessToken to the value of your application's access token, and you are ready to connect.

You can generate a HubSpot Private App Token by following the steps below:

1. In your HubSpot account, click the settings icon in the main navigation bar.
2. In the left sidebar menu, navigate to Integrations > Private Apps.
3. Click Create private app.
4. On the Basic Info tab, configure the details of your application (name, logo, and description).
5. On the Scopes tab, select Read or Write for each scope you want your private application to be able to access. This determines the data the driver has access to retrieve. Refer to the OAuthRequiredScopes and OAuthOptionalScopes properties for recommended scopes to select.
6. After you are done configuring your application, click create app in the top right.
7. Review the info about your application's access token, click Continue creating, and then Show token.
8. You can now set the retrieved token in the OAuthAccessToken property (OAuthAccessToken is used for Private App Access Tokens and OAuth Access Tokens).

You can set the AuthScheme to PrivateAppToken to enforce this Authentication scheme.

### Connection Properties

#### Server

| Property            | Default                  | Notes                                                             |
| ------------------- | ------------------------ | ----------------------------------------------------------------- |
| Portal Id           | —                        | Your Hub ID / Portal ID, shown in the top-right corner of HubSpot |
| Base URL            | `https://api.hubapi.com` | HubSpot API base URL                                              |
| Timeout             | `30`                     | Maximum seconds to wait for an API response                       |
| Page Size           | `100`                    | Records requested per API page (HubSpot's maximum is 100)         |
| Max Rows            | `-1`                     | Maximum rows returned for a single query; `-1` is unlimited       |
| Include Archived    | `false`                  | Include archived (soft-deleted) records in results                |
| Default Object Type | `contacts`               | Object used when the `FROM` clause is omitted                     |

#### Authentication

**Auth Scheme** selects the mechanism: `PrivateApp` (recommended, the default) or `OAuth`.

| Property            | Used by | Notes                                                                                         |
| ------------------- | ------- | --------------------------------------------------------------------------------------------- |
| OAuth Access Token  | both    | For `PrivateApp`, your `pat-…` token; for `OAuth`, the bearer access token                    |
| OAuth Client Id     | OAuth   | Client ID of your HubSpot OAuth app                                                           |
| OAuth Client Secret | OAuth   | Client secret of the same app                                                                 |
| OAuth Refresh Token | OAuth   | Used to obtain a new access token when the current one expires                                |
| Callback URL        | OAuth   | Redirect URI registered in the app settings. Default `https://localhost:33333/`               |
| OAuth Verifier      | OAuth   | Verifier code from the authorization URL, for headless flows where no browser can be launched |

#### Schema

| Property               | Default | Notes                                                               |
| ---------------------- | ------- | ------------------------------------------------------------------- |
| Browsable Schemas      | —       | Comma-separated object types to expose as tables; empty exposes all |
| Include Custom Objects | `true`  | Include custom CRM object types in metadata                         |
| Include Associations   | `true`  | Surface association virtual join tables in metadata                 |

#### Network

Proxy: **Proxy Auto Detect** (default `false`), **Proxy Server**, **Proxy Port** (default `80`), **Proxy User**, **Proxy Password**, **Proxy Exceptions** (semicolon-separated bypass list), **Proxy Auth Scheme** (`BASIC` default, `DIGEST`, `NTLM`, `NEGOTIATE`, `NONE`).

Firewall: **Firewall Type** (`NONE` default, `TUNNEL`, `SOCKS4`, `SOCKS5`), **Firewall Server**, **Firewall Port**, **Firewall User**, **Firewall Password**.

**SSL Server Cert** — `*` to accept any certificate (not for production), or a specific certificate.

#### Logging

| Property  | Default | Notes                                   |
| --------- | ------- | --------------------------------------- |
| Log Level | `0`     | `0` disabled, `1`–`5` increasing detail |
| Log File  | —       | Leave empty for the default path        |

#### &#x20;<a href="#private-app-token" id="private-app-token"></a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.appstrategy.com/apprules-r-documentation/platform/platform-features/system-settings/data-sources/connection-settings/marketing/hubspot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
