---
title: HubSpot integration
description: Documentation on how to connect HubSpot with Pexip Engage
---

## Introduction

HubSpot is a CRM platform that brings together your sales, marketing, and customer service functions. Integrating Pexip Engage with Hubspot allows for a seamless flow of information. By syncing appointment and customer data to HubSpot, you can eliminate manual data entry, gain valuable insights, and provide a more personalized experience for your clients.

## How it works and setup

The HubSpot integration allows you to seamlessly connect your Pexip Engage instance with your HubSpot CRM.

You can find the HubSpot integration under **Integrations > Connections**. Click the **+** icon to create a new integration. You can configure and activate multiple HubSpot integrations to support different workflows.

![Integrations overview, displaying an active HubSpot integration.](@assets/images/docs/technical/hub-spot-integration/integrations-overview.png)

When you add a new HubSpot integration, you'll be prompted to authorize the connection through HubSpot's secure OAuth application flow. This grants Pexip Engage access to specific data in your HubSpot account, including:

- **Timeline:** View and manage activity history for your contacts. (`timeline`)
- **Contacts (Read/Write):** Access and update contact information within HubSpot.(`crm.objects.contacts.read`, `crm.objects.contacts.write`)
- **Contact Owners (Read):** Identify the assigned owner for each contact. (`crm.objects.owners.read`)
- **Contact Schemas (Write):** Manage and customize contact data fields in HubSpot. (`crm.schemas.contacts.write`)

![HubSpot application consent screen.](@assets/images/docs/technical/hub-spot-integration/hubspot-consent.png)

\
Once you approve the application in HubSpot, the connection is established and Pexip Engage can begin syncing data to your HubSpot instance.

On the integration detail page, it is possible to temporarily disable the integration, preventing any further data from being synced to HubSpot. Additionally, you can easily reconnect at any time to re-establish the existing connection whenever necessary.

## Persisted resources

In the following section, we will detail the resources that are persisted to your HubSpot instance when the Pexip Engage integration is active.

### Contacts

When an appointment is created, Pexip Engage first checks if either the participating customer(s) or employee(s) already exist as contact objects within your HubSpot instance. To determine whether a contact exists, we do an exact match filter on the email property.

- **Existing Contacts:** If a matching contact is found, Pexip Engage will **not** update their information in HubSpot. We prioritize the existing HubSpot data over new data.
- **New Contacts:** If no matching contact is found, a new contact object will be created in HubSpot with the following properties:
  - **Email:** The customer or employee's email address (if provided).
  - **First Name:** The customer or employee's first name (if provided).
  - **Last Name:** The customer or employee's last name (if provided).
  - **Phone:** The customer or employee's phone number (if provided).
  - **Company:** The customer's company name (if provided).
  - **Pexip Engage ID:** A custom property named `pexip_engage_id` containing a unique identifier for the customer or employee within Pexip Engage. The format of this string is `{type}-{id}`, so a customer with ID 5 will be labeled as `CUSTOMER-5`. This serves as an internal reference for synchronization purposes, but can also be used for synchronizing back to Pexip Engage in a 2-way integration.
  - **Pexip Engage Appointment:** A custom property named `pexip_engage_appointment` stores serialized JSON data about the customer's most recently synchronized appointment. This property applies only to customers, not agents. It always contains information about the last appointment event sent for that particular customer. The property doesn't track whether the customer has multiple scheduled appointments, nor does it take any specific actions based on the appointment's status.

While most of these fields are optional, Pexip Engage attempts to populate them with as much information as possible to ensure comprehensive customer profiles within HubSpot.

:::note
It is highly recommended to set the contact Pexip properties to read only. This prevents users from (accidentally) changing values that are used by integrations. You can enable this by navigating to `Settings` → `Data Management | Properties` and then click on the `Property Access` column of the Pexip properties. Setting this to “Allow everyone to view” is a safe choice.

![Hubspot property access](@assets/images/docs/technical/hub-spot-integration/hubspot-property-access.png)
:::

### Meetings

In addition to contact information, the Pexip Engage integration also persists appointment data as meetings within your HubSpot instance.

- **Meeting Creation:** Any appointment with a confirmed start and end date is automatically synced as a meeting object in HubSpot.
- **Appointment participants:** All customers and employees participating in the appointment are linked to the corresponding meeting object via a\
  meetingToContact association.
- **Meeting Ownership:** For the primary employee assigned to the appointment, Pexip Engage verifies their eligibility to become the meeting owner within HubSpot (see [HubSpot Developers Owners documentation](https://developers.hubspot.com/docs/api/crm/owners) for details). If eligible, the employee is designated as the meeting owner.
- **Meeting Status:** The appointment status in Pexip Engage is carefully mapped to the corresponding HubSpot meeting status options, including canceled, completed, no_show, rescheduled, and scheduled.
- **Additional Meeting Details:**
  - A link to the appointment's details page within Pexip Engage is stored for easy reference.
  - Internal notes associated with the appointment are saved as internal_meeting_notes in HubSpot.
  - The meeting location is determined based on the appointment type:
    - **Video Meetings:** The location is set to the video URL used for the call.
    - **Non-Video Meetings:** The location is set to the most specific available location data, either from the on-site meeting details or the employee's office location.
- **Meeting Updates:** Any subsequent modifications made to the appointment within Pexip Engage will be reflected in the corresponding meeting object within HubSpot.

### Timeline Events

The Pexip Engage integration leverages HubSpot's timeline functionality to create detailed event entries for each synchronized appointment. These event objects are persisted to the timeline of the associated customer contact.

The following properties are included within each persisted timeline event:

- `appointmentId`: The unique identifier for the appointment within Pexip Engage.
- `appointmentLocation`: The location where the appointment takes place (if applicable).
- `appointmentMeetingType`: The appointment meeting type (e.g., video, office, phone, on location).
- `appointmentOffice`: The name of the office associated with the appointment.
- `appointmentStartTime`: The start time of the appointment displayed in the HubSpot account time zone.
- `appointmentState`: The state of the Pexip Engage appointment (e.g. scheduled, cancelled, …).
- `appointmentSubjectId`: The primary ID of the Pexip Engage subject of the appointment.
- `appointmentSubject`: The name of the Pexip Engage subject of the appointment.
- `contactFirstName`: The first name of the primary employee involved in the appointment.
- `contactLastName`: The last name of the primary employee involved in the appointment.
- `customerFirstName`: The first name of the primary customer involved in the appointment (if provided).
- `customerLastName`: The last name of the primary customer involved in the appointment (if provided).
- `customerPhoneNumber`: The phone number of the primary customer involved in the appointment (if provided).
- `customerExternalId`: The external_id of the customer in Pexip Engage.
- `customerCompany`: The customer's company name (if provided).
- `eventTitle`: A descriptive title for the timeline event (populated based on appointment details).

#### Event title possibilities

The event title is derived from three parameters:

- **Actor:** Who performed the action (customer, agent, integration)
- **Action:** What happened to the appointment (canceled, accepted, rescheduled, …)
- **Appointment status:** What is the status of the appointment (scheduled, canceled, ...)

This results in the following event titles:

- **Action by the customer:**
  - `CANCELLED`: Customer cancelled appointment
  - `CREATED`: Customer created appointment
  - `INCOMING_REQUEST`: Customer requested time slot for appointment
  - `REQUEST_RESCHEDULE`: Customer requested employee to reschedule appointment
  - `RESCHEDULED`: Customer changed time slot for appointment
- **Action by the agent:**
  - `ACCEPT`: Agent accepted appointment request
  - `CANCELLED`: Agent cancelled appointment
  - `COMPLETED`: Agent completed appointment
  - `CREATED`: Agent created appointment
  - `NO_SHOW`: Agent marked the appointment as no show
  - `OUTGOING_INVITE`: Agent invited customer for an appointment
  - `REASSIGN`: Agent reassigned appointment to another agent
  - `REOPEN`: Agent reopened appointment
  - `REQUEST_RESCHEDULE`: Agent requested customer to reschedule appointment
  - `RESCHEDULED`: Agent changed time slot for appointment
- **Action by an integration:**
  - `CANCELLED`: Integration cancelled appointment
  - `CREATED`: Integration created appointment
  - `REQUEST_RESCHEDULE`: Integration requested to reschedule appointment
  - `RESCHEDULED`: Integration changed time slot for appointment
