
HubSpot
Connection to the HubSpot CRM API.
Connection
Private access token stored as HUBSPOT_ACCESS_TOKEN. Endpoint: api.hubapi.com.
Preview data
Read-only calls to preview what HubSpot returns.
Import companies → Customers
Fetches HubSpot companies linked to Closed Won deals and adds them to Customers. Matching is by name and HubSpot id; existing customers are skipped.
Import deals → Deals
Fetches all HubSpot deals and upserts them into Deals by HubSpot id. Stage IDs are mapped to human labels; Closed Won is taken from HubSpot's hs_is_closed_won flag only. Multi-year amounts are annualized into ARR. Running again refreshes existing deals in place.
Import products → Products
Fetches all HubSpot products and adds them to Products. Matching is done by SKU; existing SKUs are skipped.
Diagnostics
Runs an unfiltered deals/search sweep and reports what HubSpot actually returned — totals, pipeline / stage breakdown, missing data, and the raw pipeline and stage ids per deal. Nothing is written to the database.