# Set up Contact Synchronization from HubSpot CRM

Once HubSpot CRM (Customer Relationship Management, the system where your sales and support teams keep contact records) is connected to your phone system, you can have Cloud Voice pull selected HubSpot contacts into a phonebook of its own. The sync runs one way, from HubSpot into Cloud Voice, so extension users see who is calling without leaving their phone or app.

## Prerequisites

You have already [integrated Cloud Voice with HubSpot CRM](/pbx/integrations/hubspot/integrate-cloud-voice-cloud-voice-with-hubspot-crm/).

## Turn on contact synchronization

1. Sign in to the Cloud Voice management portal and go to **Integrations > CRM**.
2. On the CRM integration page, switch on **Synchronize Contacts Automatically**.
3. Open the **Synchronize Contacts From** drop-down list and choose which type or types of HubSpot contact you want to bring across.

   ![Contact-type drop-down for selecting which HubSpot records to synchronize](/images/pbx/sync-contacts-type.png)

4. In the **Synchronize to Phonebook** drop-down list, pick the phonebook that will hold the synced contacts. You can select an existing phonebook or create a new one.

   :::note
   The destination phonebook must be empty. Contacts can only sync into a phonebook that has no entries yet.
   :::

   ![Phonebook drop-down for choosing where synced contacts are stored](/images/pbx/sync-to-phonebook.png)

5. Decide how Cloud Voice should look up contacts by setting the **Always Query CRM** option.

   
   ![Cloud Voice, the Always Query CRM toggle on the CRM integration page](/images/pbx/always-query-crm.png)

   - **Enabled**: Cloud Voice queries HubSpot in real time for contact details, and extension users can search CRM contacts directly from the dial pad in the Cloud Voice App.
   - **Disabled**: Cloud Voice only queries HubSpot when no match is found in your company contacts.

   :::caution
   - Real-time queries add to your HubSpot API usage, so keep an eye on your quota if you enable this option.
   - Real-time search does not work while masked numbers are turned on in your system preferences.
   :::

6. Click **Save**.

## What happens after syncing

The phonebook you chose is marked with a CRM label so you can tell it apart from your other phonebooks.

![The CRM label that marks a synced phonebook](/images/pbx/crm-tag.png)

![A phonebook list showing the CRM-linked phonebook with its label](/images/pbx/phone-book-sync.png)

From then on, whenever an extension user receives a call from one of the selected HubSpot contact types, or dials out to one, Cloud Voice looks up the number and copies the matching contact's details from HubSpot into the linked phonebook.

:::note
Synchronization runs one way, from HubSpot into Cloud Voice. The linked phonebook and everything synced into it are read-only.
:::

:::caution[Some contacts won't sync?]
Contacts with missing details can fail to sync. Confirm that each contact has the following fields filled in, then run the directory synchronization again:

- Either the **First name** or the **Last name** field.
- The **Phone number** field.
:::
