Design note — HubSpot connector (hubspot)
Target registry item: C7 (catalog row only — available: false, wave 4, demand-driven; playbook §4.3 "CRM / client records", OB-GAP-3). Status: design note only — NOT built. The catalog row enumerates the two fields below so the surface can say "not yet available"; posting any payload is refused 409 provider_not_available. Built only when a tenant declares demand (docs/OPEN_ITEMS.md row). CDoD points 1–14 tracked in docs/reports/ONBOARDING_CONNECTORS_STATE.md.
Auth
Read-only, merchant-owned (D2/D11). A HubSpot private app is created inside the customer's own HubSpot account by a super admin (vendor docs, fetched 2026-10-12: private apps now live under Development → Legacy apps and remain supported); its scopes are chosen on the Scopes tab, and the Auth tab shows the access token (sent as a Bearer header). HubSpot recommends rotating the token every six months and allows up to 20 private apps per account. The token begins with a three-letter private-app prefix and a hyphen; the card describes that shape in words and never shows an example.
Vault-only per (tenant, provider); no environment fallback; vault error 503; absence merchant_credentials_not_configured.
Fields (catalog row)
| key | label | secret | required | pattern | help |
|---|---|---|---|---|---|
private_app_token |
Private app access token | yes | yes | — | HubSpot → Development → Legacy apps (private apps) → your app → Auth tab → Show token. Create the app with read scopes only. Never echoed; masked hint only. |
portal_id |
Portal (Hub) ID | no | yes | ^\d+$ |
The numeric Hub ID shown in the account menu (top-right) and in the HubSpot URL. Digits only. Test connection checks it matches the token's account. |
Scopes
Read scopes only: crm.objects.deals.read, crm.objects.companies.read, and — only where the consent posture below admits it — crm.objects.contacts.read. Never any write scope. Test connection reads the token's granted scopes from HubSpot's token-info endpoint and refuses write scopes with scope_too_wide.
Data topics
Deals (amount, stage, pipeline, close date, source — aggregated to counts and amounts by stage × day) and companies (organization-level). Contacts (email, name, phone, lifecycle stage) are person-level.
Consent posture
Per topic: deal and company aggregates are the de-personalised remainder on the aggregate path. Contact-level fields flow only under a consent-registry grant with a per-subject basis; HubSpot's own legal-basis property is a vendor-side declaration and maps to the ingest gate's closed vocabulary (consent | contract | explicit | legitimate_interest) only through an explicit, tested mapping — never assumed. Without a basis the mapper drops contact fields before persistence (fail-closed evaluate_consent). The deny-list (health, sexuality, religion, financial distress, minors) is applied at ingest to free-text CRM properties. Posture test pins both directions.
Mapper target
System-of-record adapter (C2 door) → MAPPERS["hubspot"] → ingest_gate → mizoki_unified_data. No new store; no writeback (no property writes, no timeline events).
Failure modes → test-connection verdicts
| Failure | Verdict / fix |
|---|---|
portal_id not digits |
422 invalid_field_format. |
| 401 | token_invalid → rotate the token in the private app. |
Token's Hub ID ≠ portal_id |
portal_mismatch → the token belongs to a different account. |
| 403 missing scope | scope_missing naming the read scope to add. |
| Token carries write scopes | scope_too_wide. |
| Vault read error | 503 fail-closed. |
Flag
HUBSPOT_SYNC default OFF; available: false until CDoD point 14.
Owner / operator gates
- Owner: whether contact-level CRM data is ingested for any tenant (consent-registry grant model) — the aggregate deals path needs no such ruling.
- Operator: none; there is no platform credential (a HubSpot public/marketplace app would be a separate, owner-ruled item).
Vendor references
- HubSpot Developers — Private apps (developers.hubspot.com/docs/api/private-apps): fetched 2026-10-12; source for the Legacy apps location, Auth tab token, Hub ID via the token-info endpoint, rotation guidance and the 20-app limit.
- HubSpot Developers — Scopes reference (developers.hubspot.com/docs/guides/apps/authentication/scopes): URL as recorded; not re-fetched from this sandbox on 2026-10-12.