Connectors HubSpot

HubSpot

API

The HubSpot connector is an API connector that imports contacts, companies, deals, and notes from HubSpot CRM. It produces structural claims about relationships and deal status, plus extracts claims from note bodies via text extraction.

How it works

Claim patterns

Contacts

SubjectPredicateObject
(email, contact)works_at(company, company)
(email, contact)has_role(jobtitle, role)
(email, contact)has_stage(lifecyclestage, stage)

Companies

SubjectPredicateObject
(name, company)in_industry(industry, industry)
(name, company)has_domain(domain, domain)
(name, company)has_size(employees, size)

Deals

SubjectPredicateObject
(dealname, deal)has_stage(stage_name, stage)
(dealname, deal)has_amount($amount, currency)
(dealname, deal)in_pipeline(pipeline, pipeline)
(dealname, deal)closes_on(date, date)

Notes

SubjectPredicateObject
(note:id, note)associated_with(entity, contact/company/deal)

All structural claims have confidence 1.0. Note body extraction produces additional claims at extraction-mode confidence.

1 Create a HubSpot Private App

Go to Settings → Integrations → Private Apps in your HubSpot account. Create a new private app and grant the following scopes:

2 Install the requests package

$ pip install requests

3 Connect

import os
conn = db.connect("hubspot",
    token=os.environ["HUBSPOT_TOKEN"],
)
result = conn.run(db)
Parameter Required Default Description
token Yes HubSpot private app token (pat-...)
objects No ["contacts", "companies", "deals", "notes"] Which object types to fetch
max_items No 500 Max items per object type
extraction No heuristic Text extraction mode for note bodies: heuristic, smart, llm, or none
pipeline No All Filter deals to specific pipeline
save No False Encrypt and persist token

Basic usage

conn = db.connect("hubspot",
    token=os.environ["HUBSPOT_TOKEN"],
)
result = conn.run(db)
print(f"Ingested {result.claims_ingested} claims")

Contacts and deals only

conn = db.connect("hubspot",
    token=os.environ["HUBSPOT_TOKEN"],
    objects=["contacts", "deals"],
    pipeline="default",
    max_items=1000,
)
result = conn.run(db)

With LLM extraction and save

conn = db.connect("hubspot",
    token=os.environ["HUBSPOT_TOKEN"],
    extraction="llm",
    save=True,
)
result = conn.run(db)

Notes only (sales intelligence)

conn = db.connect("hubspot",
    token=os.environ["HUBSPOT_TOKEN"],
    objects=["notes"],
    extraction="llm",
)
result = conn.run(db)

Related Connectors