Docs / Sources

HubSpot

Import HubSpot contacts, company details and existing enrichment values through your own HubSpot app.

Matches onUnverified email
HistoryAll contacts and companies
Also doesCRM facts, sinks
You'll needYour own HubSpot app

Connect HubSpot

HubSpot uses a reviewed Activepieces piece inside Datum. You authorize it through an OAuth app in your HubSpot developer account. You retain control of the client secret and tokens. A source connection requests only read access to contacts and companies.

  1. Create a HubSpot app

    Create an app in your HubSpot developer account. Add crm.objects.contacts.read and crm.objects.companies.read as required scopes. Record the client ID and secret.

  2. Open Sources

    Open Sources → Connect a source → HubSpot. Register the redirect URI from What to do in your HubSpot app.

    The redirect URI combines your Datum address with /connect/piece%3Ahubspot/callback.

    Enter OAuth client ID. Enter OAuth client secret. Enter the number from your HubSpot address in HubSpot account ID. Generate at least 32 random characters, for example with openssl rand -hex 32. Enter the result in Webhook URL secret.

  3. Authorize it

    Press Connect as a workspace owner. Approve the app on HubSpot’s consent page. Press Verify after the panel displays Authorization received. Verify to check access.

    Datum saves the connection and opens the consent page in a new tab. Only a workspace owner can authorize it.

  4. Register the webhook

    Open the HubSpot row’s menu on Sources. Select Webhook URL. Protect this URL like a password. Set it as the webhook target in your HubSpot app. Subscribe to contact.creation, contact.propertyChange, contact.associationChange, company.creation and company.propertyChange. Name each required property in its property-change subscription.

    Datum generates a missing URL secret when you select Prepare webhook, including for older connections. Datum keeps the existing secrets and OAuth credentials. The webhook URL ends with this secret. When the instance has Event Gateway, Prepare webhook returns its protected gateway URL. Update the HubSpot app’s webhook target to switch an existing direct connection. Without Event Gateway, the URL points directly to Datum.

  5. Import history

    Press Run now on the source’s page. Alternatively, run the following command from your terminal or agent. Datum reads all contacts, followed by all companies:

    ocmgr ingest <connectionId>
  6. Check the result

    Check the Verify result. Check HubSpot source facts on the source’s Overview after importing. Check Show all HubSpot fields on a member’s profile.

    Verification runs the piece separately to test contact and company reads. It imports no records.

Data Datum imports

Contacts Email address, name, company and job title, as profile fields on the contact’s account
CRM facts Contact and company properties HubSpot already holds, such as location, LinkedIn, role, seniority, industry, headcount and website
Activity None. A contact changing in HubSpot is not community activity
Not collected Datum discards property values from webhook payloads before storage. It rereads each record instead

Datum treats every HubSpot address as unverified. HubSpot contacts cannot link automatically to other accounts. Possible matches enter your review queue.

Datum labels CRM facts with HubSpot as their source and the date of collection. These facts do not affect identity matching or overwrite manually entered values. Company facts attach to an organization only through an exact domain match. HubSpot’s headcount and industry remain source facts. They do not replace Datum’s member counts.

How Datum updates records

Webhooks identify changed records, which Datum rereads from HubSpot. Late notifications therefore cannot overwrite newer data. A running worker reconciles contacts and companies every 15 minutes. A daily full pass collects changes that webhooks missed. Datum never applies HubSpot deletions or merges automatically.

Your own enrichment properties

HubSpot Data Enrichment, other tools and people can supply CRM properties. Datum reads existing values without starting paid enrichment or creating CRM records. Map a custom property by its internal name:

  1. Open Sources → HubSpot → Settings.
  2. Under Enrichment properties, expand Contact properties or Company properties.
  3. Change the fields you need. A blank field restores the standard property.
  4. Press Save and verify.
  5. Run an import to refresh facts. This does not change destination mappings.

A new connection can set the same mappings in Enrichment property mappings when you connect it. REST, MCP and the CLI use the same configuration:

ocmgr connection update <connectionId> \
  --config '{"hubspotProperties":{"contact":{"role":"community_role"},"company":{"employees":"enriched_employee_count"}}}'
ocmgr ingest <connectionId> --cursor null

Unspecified mappings retain their defaults. Run ocmgr connection discover <connectionId> to list them.

Troubleshooting

Datum rejects webhook deliveries

Webhook URL secret requires at least 32 characters. Datum rejects shorter secrets from older releases, and Verify reports the problem.

Set a new secret with ocmgr connection update <connectionId> --secret secret=$(openssl rand -hex 32). Register the current address from Webhook URL in HubSpot.

CRM sync still reports missing write permissions

Add crm.objects.contacts.write, crm.schemas.contacts.write, crm.objects.companies.write and crm.schemas.companies.write as optional scopes in your HubSpot app, then deploy the app update. For an installed app, also open HubSpot Connected Apps → Approved apps → Manage access → Data Permissions. Turn on the optional scopes and choose Save changes. Scopes that are off appear locked on the consent page.

After you create the sink, reconnect the source from Datum:

  1. Select the write scopes on the HubSpot consent page.
  2. Connect the app.
  3. Press Verify on the sink again.

Connections that are only sources continue to ask for read access only.

Company facts are missing

The connection predates the request for company read access. Add crm.objects.companies.read to your HubSpot app. Reconnect from the source’s menu. Run the import again.

From your terminal or agent

ocmgr connection create --kind piece:hubspot --config '{"hubspotPortalId":"<account-id>"}' \
  --secret clientId=<client-id> --secret clientSecret=<client-secret> --json
ocmgr connection connect <connectionId> --json
ocmgr connection verify <connectionId> --json
ocmgr crm list --connection <connectionId> --type company --include-data --json

See connect_connection and list_crm_assertions for every parameter.

FAQ

Can Datum write to HubSpot too?

Yes. A sink can use the same connection with HubSpot write scopes. Add those scopes to your app as optional scopes. Grant them with ocmgr connection connect <connectionId> --for sinks.

A source connection alone never requests write scopes. See CRM and warehouse sinks.

Why do some members have no role or seniority?

HubSpot enrichment fills these properties only for eligible business addresses. Some accounts lack particular properties. Source facts list properties that HubSpot did not return. A missing value means HubSpot supplied no value, not that the person lacks that attribute.

What happens to HubSpot data when I erase a member?

Erasure clears the member’s contact facts and prevents later HubSpot reads from restoring them. Company facts remain because they describe organizations.