> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qobra.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Hubspot

## Introduction

Qobra connects to Hubspot through an application, which needs to be installed
via an Oauth check.

The integration is used to synchronize tables from Hubspot, with their fields
and their content. The application supports both standard and custom objects
from the CRM. This integration is readonly and does not write anything in your
Hubspot.

## Access

### Oauth authentication & scopes

To connect your Hubspot to Qobra, you’ll need to go through an Oauth flow,
granting us access to several scopes:

* `crm.objects.companies.read`

* `crm.schemas.companies.read`

* `crm.objects.contacts.read`

* `crm.schemas.contacts.read`

* `crm.objects.deals.read`

* `crm.schemas.deals.read`

* `crm.objects.owners.read`

* `crm.objects.custom.read`

  (optional)

* `crm.schemas.custom.read`

  (optional)

* `crm.objects.goals.read`

  (optional)

* `e-commerce`

  (optional)

You’ll find more information about Hubspot application scopes
[here](https://developers.hubspot.com/docs/api/scopes).

## Synchronization

### Refresh Frequency

To ensure your Hubspot data is always up to date in Qobra, we maintain the following synchronization schedule:

* **Daily Full Refresh**: Every night, we perform a complete sync of all your Hubspot data
* **Bi-hourly Updates**: Every 2 hours throughout the day, we sync any recent changes
* **On-Demand Updates**: Need the latest data right away? Just click the refresh button in your integration settings

### Incremental synchronization

This integration is an incremental synchronization. This means that all
imports are based on each record last modified date, and that we only
refresh what has been modified in the system since the previous import.
When an import is launched, we thus refresh all records that have been
modified since the start of the last successful import.

Once we have refresh range, synchronization work is split and parallelized
in smaller tasks for performance enhancement. The synchronization tasks are
split according to the last modified date.

It is important to note that Qobra admin can manually trigger complete
synchronization in the application.

For Hubspot, we base this synchronization on the `lastModifiedDate`
field, present in each table.

### Supported tables

You’ll find here all tables supported by the Qobra integration.

| **Tables**                 | **Name field**           | **Currency field**           | **Jointures**           |
| -------------------------- | ------------------------ | ---------------------------- | ----------------------- |
| `Deals`                    | `dealname`               | `deal_currency_code`         | `Companies`, `Contacts` |
| `Companies`                | `name`                   |                              |                         |
| `Line Items`               | `name`                   | `hs_line_item_currency_code` | `Deals`                 |
| `Meetings`                 | `hs_meeting_title`       |                              | `Companies`, `Deals`    |
| `Calls`                    | `hs_call_title`          |                              |                         |
| `Emails`                   | `hs_email_subject`       |                              |                         |
| `Tasks`                    | `hs_task_subject`        |                              |                         |
| `Contacts`                 | `email`                  |                              | `Companies`, `Meetings` |
| `Goals` (optional)         | `hs_goal_name`           |                              |                         |
| `Custom tables` (optional) | `primaryDisplayProperty` |                              |                         |

### Supported types

You’ll find below the fields types supported by the Qobra integration,
and their mapping to Qobra types.

| **Hubspot type** | **Qobra type**     |
| ---------------- | ------------------ |
| `number`         | `amount`, `number` |
| `user`           | `user`             |
| `string`         | `string`           |
| `enumeration`    | `picklist`, `user` |
| `bool`           | `bool`             |
| `datetime`       | `date`             |
| `date`           | `date`             |

### Custom querying

With this integration, you can apply a custom query to your
table synchronization, to avoid synchronizing too much information,
consequently making synchronization quicker.

Custom queries are based on the hubspot API where conditions. For instance,
you could add a custom query like below to filter your Deal table on stage
field.

```json theme={null}
{
  "propertyName": "dealstage",
  "operator": "IN",
  "values": ["appointmentscheduled", "contractsent", "qualifiedtobuy"]
}
```

You'll find more information in Hubspot's documentation [here](https://developers.hubspot.com/docs/guides/api/crm/search#filter-search-results).

[Contact Qobra support](mailto:support@qobra.co) for more information.
