> For the complete documentation index, see [llms.txt](https://docs.spara.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.spara.com/integrations/crm-integrations/hubspot-crm.md).

# HubSpot (CRM)

How Spara syncs lead data with HubSpot CRM, creates Contacts, and imports Contacts with Import Rules.

Spara integrates with HubSpot to keep your CRM in sync with lead activity. Once connected, Spara can write conversation data and field values to HubSpot Contacts (Push), and import existing HubSpot Contacts into Spara as Leads (Import).

For step-by-step setup instructions, see [Connecting HubSpot](https://docs.spara.com/integrations/crm-integrations/connecting-hubspot.md).

<figure><img src="https://4072969777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FreCGkFdsmuPJzGP9ZgGA%2Fuploads%2Fgit-blob-a8825aac0dd22079cb476e677ca0046d9e8bde8d%2FHubSpot%20Integration%20Settings.png?alt=media" alt=""><figcaption><p>The HubSpot integration settings page, showing sync, writing, and import settings.</p></figcaption></figure>

| HubSpot Object | Spara writes to HubSpot | Spara reads from HubSpot              |
| -------------- | ----------------------- | ------------------------------------- |
| Contact        | Any mapped property     | Any mapped property                   |
| Company        | *None* (read-only)      | Firmographics; see Company Data below |
| Owner          | *None* (read-only)      | Name and email; see Owner Data below  |
| Deal           | *None* (read-only)      | Deal fields; see Deal Data below      |

## Sync Contacts

The **Sync Contacts** toggle at the top of the Contacts tab turns Contact sync on or off:

* **On**: HubSpot Contacts linked to a Spara Lead sync both ways according to each field's write rule (see [#fields-synced-to-from-crm](#fields-synced-to-from-crm "mention")). Spara pushes conversation insights and field values into those Contacts, and pulls their changes back.
* **Off**: Nothing syncs between Spara and HubSpot Contacts in either direction, and the settings below it don't apply.

## Writing to HubSpot Contacts

While sync is on, the **Writing to HubSpot Contacts** panel sets which HubSpot Contacts Spara can update or create:

* **Create & update**: Spara updates the Contact linked to a Spara Lead, or one that matches by email address, and creates a new Contact when none matches.
* **Update only**: Spara updates linked and matching Contacts, but never creates new ones. Use this when you want HubSpot record creation to stay under your team's control.

With **Create & update**, you can also add a **Create condition**. Spara creates a new Contact only when the lead matches the condition, for example once a company name is known. The condition uses the same filters as Workflows. Only admins can edit it. An email address is always required. A lead that doesn't match yet is retried as soon as the missing information is captured. Matching and updating existing Contacts are not affected.

### How the sync operates

Spara's sync is event-driven, not scheduled:

* **A Contact is created or matched as soon as Spara knows an email address.** The first time an email is captured, whether in chat, on a call, or via a webform, Spara looks for a matching Contact (by stored HubSpot ID first, then email address) and, depending on your settings, updates it or creates a new one. Unless you set a create condition, Spara does not wait for other fields like name or company to be gathered first.
* **Property updates push immediately.** Every time a mapped Spara field changes (a new answer in conversation, a booked meeting, an enrichment result), Spara writes it to HubSpot right away.
* **Conversation transcripts push shortly after the conversation goes quiet.** Transcript syncs are batched, so HubSpot receives one consolidated update a few minutes after the last message rather than one write per message.
* **Import Rules run every few minutes.** New HubSpot Contacts matching your Import Rules are imported as Spara Leads continuously.
* **Linked Contacts stay in sync.** While Contact sync is on, HubSpot Contacts already linked to a Spara Lead have their changes pulled every few minutes according to your write rules, whether or not they match your Import Rules.
* **Deal data syncs nightly.**

### Email logging

Emails Spara exchanges with a lead are logged on the matched Contact as HubSpot email engagements. Logging is on by default; an admin can turn it off with the **Log emails** toggle on the Contacts tab of the [**HubSpot settings page**](https://app.spara.co/settings/integrations/hubspot/manage), for example when HubSpot is connected only to read Companies and Owners alongside another CRM. Emails are not logged while Contact sync is off, and emails sent while logging is off are not logged later if it is turned back on.

{% hint style="info" %}
**Common CRM integration concerns**

The behaviors above are the defaults. Each has a control or workaround, covered in full in [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md):

* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#use-data-from-crm-objects-spara-doesnt-support): map fields from custom or other unsupported objects onto Spara's core objects (Enterprise).
* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#require-fields-before-a-crm-record-is-created): add a **Create condition** under **Writing to HubSpot Contacts** so Spara holds Contact creation until more than an email is known.
* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#keep-spara-from-overwriting-crm-data): set the Spara → CRM write rule to **Set if empty** or **Read-only**, or turn off **Sync Contacts**.
* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#write-to-accounts-opportunities-or-other-objects): route data through Webhooks, the API workflow step, or the Web API.
* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#log-spara-activity-in-your-crm): sync transcripts to a Contact property (emails are logged as engagements automatically), or build activity records from Webhooks.
* [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md#control-which-crm-records-enter-spara): Import Rules filter on any Contact property; configured with your Spara team.
  {% endhint %}

## Import Rules

Import Rules control which existing HubSpot Contacts are imported into Spara as new Leads. This is useful for leads that exist in HubSpot but have not yet interacted with a Spara agent. Spara can import them so your agents and workflows can proactively reach out. Import Rules can filter on any HubSpot Contact property; by default, Spara only imports Contacts that have an email address. The **Import Contacts** toggle turns importing on or off.

Import Rules only decide which Contacts become new Spara Leads. They don't affect how Contacts already linked to a Spara Lead sync; that is controlled by the **Sync Contacts** toggle in [#sync-contacts](#sync-contacts "mention").

{% hint style="info" %}
Import Rules are configured by your Spara customer success representative.
{% endhint %}

## Recognizing returning visitors

If your site runs the HubSpot tracking code, Spara recognizes visitors HubSpot already knows. When a visitor opens the Spara chat, Spara reads HubSpot's `hubspotutk` cookie and looks up the matching HubSpot Contact. If the Contact has an email, Spara fills in their email, name, company and any mapped fields and links the Lead to that Contact, so the agent doesn't ask for information you already have.

This turns on automatically once HubSpot is connected to Spara.

* Only visitors HubSpot has already identified, for example through a HubSpot form, are recognized. Anonymous visitors go through the normal conversation.
* Anything the visitor has already provided to Spara is never overwritten.
* If you use Spara's cookie consent integration, the cookie isn't read until the visitor consents.

This is the reverse of [Setting Up HubSpotUTK Cookie Tracking](https://docs.spara.com/integrations/crm-integrations/setting-up-hubspotutk-cookie-tracking.md), which tells HubSpot about emails Spara captures.

## Fields synced to/from CRM

Field mappings are edited on each field in the [**Data Model**](https://app.spara.co/data-model). Open a field and use its **HubSpot sync** section, which has a slot for each HubSpot object the field can map to: **Contact** for Lead fields, **Company** for Account fields, and **Owner** for Owner fields. Save your edits with the page's **Save changes** prompt.

Each slot defines:

* **HubSpot field**: the HubSpot property the Spara field maps to
* **HubSpot → Spara**: how Spara writes the HubSpot value into the Spara field
* **Spara → HubSpot**: how Spara writes the Spara value into the HubSpot property

Each direction has its own write rule:

* **Overwrite**: replace any existing value
* **Set if empty**: write only when the receiving field is empty
* **Read-only**: never write in this direction

Company and Owner mappings are pull-only (**Pulled from HubSpot**). When HubSpot marks a property read-only (such as calculated properties), or the Spara field is [Data Model](https://docs.spara.com/build/data-model.md#what-is-a-read-only-field), **Spara → HubSpot** is locked to **Read-only**. Likewise, **HubSpot → Spara** is locked to **Read-only** for fields Spara sets itself, such as GCLID, UTM parameters, and conversation summaries and transcripts.

The field page flags mapping problems in plain language, such as a mapping that syncs nothing because both directions are **Read-only**, mismatched types, or picklist values HubSpot would reject. See [Data Model](https://docs.spara.com/build/data-model.md#crm-field-mappings) for the full list, and for **Suggest fields**, which suggests HubSpot Contact mappings from the Data Model page.

The Email field is always mapped automatically and cannot be removed. You can map as many additional fields as needed. Field mappings apply in both directions, each according to its own write rule.

### Reviewing mappings in HubSpot settings

Each tab in the HubSpot settings page (Contacts, Accounts, Owners) shows a read-only **Fields synced to/from CRM** list (**Fields synced from CRM** for Accounts and Owners). Fields with mapping problems are listed first, each row opens its field in the Data Model, and **Manage in Data Model** takes you to the Data Model page. If that object's sync is off, the list says so, since those mappings don't run.

## Company Data

When company syncing is enabled, Spara reads the Company associated with each matched Contact, including name, domain, website, industry, employee count, annual revenue, and city. Synced companies appear on the [Accounts](https://docs.spara.com/pipeline/accounts.md) page, and their fields are available in workflow conditions and agent personalization.

Company data is read-only: Spara never creates or updates HubSpot Companies.

## Owner Data

When owner syncing is enabled, Spara reads the assigned owner from matching HubSpot Contact records. If an owner is found and active, their details are available in Spara, including name and email, and appear in the lead's detail view and on the [Owners](https://docs.spara.com/pipeline/owners.md) page.

Owner data is available as fields in workflow conditions and agent personalization, so you can reference a lead's assigned rep by name in emails, chat messages, or routing logic.

## Deal Data

Spara reads HubSpot Deal data nightly to power pipeline and revenue reporting in [Analytics](https://docs.spara.com/pipeline/analytics.md), including which deals Spara-engaged leads influenced. Spara reads each Deal's name, amount, stage, close date, currency, and open/closed/won status. Deal data is read-only: Spara never creates or updates HubSpot Deals.

## Limitations

* **Writes are Contact-only.** Companies, Owners, and Deals are read-only. Spara cannot update them when it learns something new. HubSpot Lead objects are not synced; Spara Leads map to HubSpot Contacts.
* **Records are created as soon as an email is known.** To wait for more, add a **Create condition** under [#writing-to-hubspot-contacts](#writing-to-hubspot-contacts "mention").
* **HubSpot's required properties must be mapped.** If your portal requires properties when a Contact is created (for example **Legal basis for processing contact's data** under HubSpot's GDPR settings, or properties marked required on the Contact object), HubSpot refuses any Contact that lacks them. Map a Spara fact to each required property, or stop requiring it in HubSpot. Until then, each affected Lead shows a **Couldn't create this record** entry in the sync log naming the properties, and Spara still updates the Contact once HubSpot has one for that email (for example from a form submission).
* **Spara Events are not synced as structured activity.** Conversation transcripts sync through a mapped Contact property, and emails Spara exchanges with a lead are logged as HubSpot email engagements (an admin can turn this off with **Log emails** on the Contacts tab of the HubSpot settings page), but individual events (page visits, calls, meetings) are not written as HubSpot activities.
* **Unsupported objects require custom mapping.** Fields from HubSpot objects Spara doesn't model can be mapped onto Spara's Lead, Account, and Owner objects by Spara's engineering team, available for Enterprise customers.

For practical workarounds, see [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md).

## Sync Logs

The **Logs** tab on the [**HubSpot settings page**](https://app.spara.co/settings/integrations/hubspot/manage) shows every sync between Spara and HubSpot, newest first. Each entry records what happened (a contact created or updated, fields that didn't sync, a sync skipped because of your settings, or a connection problem like an expired token) along with the Lead it affected, the HubSpot record, and how many fields synced.

<figure><img src="https://4072969777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FreCGkFdsmuPJzGP9ZgGA%2Fuploads%2Fgit-blob-db930a71a8f69b8f3a33ebb0f130c8dc167e7bb7%2FHubSpot%20Sync%20Logs.png?alt=media" alt=""><figcaption><p>The Sync Logs tab, showing each sync's status, direction, Lead, HubSpot record, and field counts.</p></figcaption></figure>

Filter the list by status (**Synced**, **Needs attention**, or **Failed**), direction, or timeframe. Search covers the technical detail behind each entry as well as its summary, so you can look up a HubSpot error code or a property name and find every record hitting the same problem.

Select an entry to see its details:

* A plain-language explanation of what happened, and what to do about it, with a link to the setting that fixes it
* The Lead and the HubSpot record involved
* Every field the sync moved, shown as the Spara field, the HubSpot property it maps to, and the value
* For any field HubSpot rejected, the reason HubSpot gave. For example, a property that no longer exists, or a value that isn't one of its defined options

Each Lead also has a **CRM sync** row in its details showing that Lead's most recent sync outcome, which opens the same view. That answers "did this Lead reach HubSpot?" without leaving the Lead.

## FAQ

### How does Spara match a Lead to a HubSpot Contact?

Spara matches by stored HubSpot Contact ID first, then by email address. As soon as a lead provides their email in a conversation, Spara attempts to find a matching Contact and begin syncing.

### Will Spara overwrite existing data in HubSpot?

By default, yes. New field mappings use **Overwrite** in both directions. Set **Spara → HubSpot** to **Set if empty** to protect existing HubSpot data, or to **Read-only** so Spara never writes that property.

### Can Spara update HubSpot Companies or Deals?

No. Spara only writes to Contacts. If you need Spara data written to other objects, use [Developer: Webhooks](https://docs.spara.com/developers/spara-api/webhooks) with your own automation. See [Working Around CRM Sync Limitations](https://docs.spara.com/integrations/crm-integrations/crm-sync-workarounds.md).

### What happens if HubSpot is disconnected?

Syncing stops immediately. Your field mappings are preserved so you can resume with the same configuration after reconnecting. To reconnect, go to [**Settings > Integrations**](https://app.spara.co/settings/integrations) and click **Authorize** on the HubSpot card.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.spara.com/integrations/crm-integrations/hubspot-crm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
