HubSpot CRM Hub
HubSpot is the primary CRM for all RERI acquisition and disposition deal pipelines. This hub is the canonical reference for HubSpot integrations, webhook handler, dual-pipeline architecture, and all KB doc pointers. Read before modifying any deal, contact, pipeline, or HubSpot-related automation. Owned by the acquisitions and dispo workflows; all agent deal writes must route through hubspot-deal-ingest.
Quick reference
| Field | Value |
|---|---|
| Vendor | HubSpot |
| URL | https://app.hubspot.com / https://api.hubapi.com |
| Portal ID | 6193101 |
| KB doc | API |
| Auth method | Bearer (Private App Access Token) |
| Auth credential | op://Aurora/hubspot/api-key |
| Cred-proxy port | n/a (until B1-B6 ratified) |
| Webhook port | :18790 |
| Webhook handler | hubspot-handler (workspace/webhooks/hubspot-handler.js) |
| Webhook dedup table | processed_webhook_events (24h TTL) |
| Tunnel path | /webhook/hubspot |
| Outbound API base | https://api.hubapi.com |
| Rate limits | 10 concurrent requests; 100 events/batch |
| Rate-limit action | 429 → exp backoff (3 retries), Discord ops alert |
| Signature header | X-HubSpot-Signature (HMAC-SHA256: app_secret + request_body) |
| Cost | Varies by tier; ~$0 API calls; HubSpot subscription separate |
| Backup/recovery | HubSpot-owned (SaaS); Supabase bidirectional sync for deal state |
| Discord alert channel | ops |
| Drift cadence | weekly (security-audit-funnel.timer) |
| Status | production |
Pipelines
Acquisition Pipeline — ID 877963314
The acquisition pipeline tracks inbound wholesale deal leads from contract holders (CH). All deals sourced from investorlift, direct SMS/OpenPhone inbound, or manual intake land here first.
| Field | Value |
|---|---|
| Pipeline ID | 877963314 |
| Pipeline name | Acquisitions |
| Entry stage | New Lead |
| Deal-to-deal association | Links to dispo deal on acq approval |
| Stage sync | Bidirectional: HubSpot ↔ Supabase acquisition_deals table via stage-sync.js |
| Outreach trigger | smart-outreach-worker.js + unified-outreach-engine.js (Stage 1 via acquisitions-outreach) |
| Follow-up trigger | follow-up-scheduler.js + follow-up-engine.js (Stages 2-4 via acquisitions-followup) |
| Primary agent | _summary |
| Contact create | findContactByPhone() → createContact() in hubspot-deal-creator.js |
Key acquisition stages (from ACQUISITION_STAGES in hubspot-deal-creator.js):
- New Lead → Contacted → Under Review → LOI Sent → Under Contract → Closed / Dead
Compliance gates enforced before any HubSpot acq write:
gate-computer— prior contact checkcompliance-gate— TCPA quiet hours, opt-outblast-safety— daily blast capthread-context— de-duplicate active threadsresponse-generator— LLM quality gate
Disposition Pipeline — ID 816046
The dispo pipeline tracks outbound deal marketing to buyers and end-investors. Created automatically when an acquisition deal is approved, linked via deal-to-deal association.
| Field | Value |
|---|---|
| Pipeline ID | 816046 |
| Pipeline name | Wholesale Deals (Disposition) |
| Entry stage | New Dispo Deal |
| Creation source | createDispoDeal() in hubspot-deal-creator.js |
| Deal-to-deal link | associateDealToDeal() — acq_deal_id ↔ dispo_deal_id |
| Stage sync | syncAcqStageToDispo() mirrors acq stage transitions |
| Blast trigger | dispo-blast-engine.js (4-channel coordinator via dispo-blast) |
| Email trigger | dispo-email-sender.js → BetterFiles TC emails via betterfiles-dispo-emails |
| Primary agent | Atlas (dispo orchestrator) |
| Supporting agent | _summary |
Dispo stage flow: New Dispo Deal → Marketed → Showing → Under Contract → Closed / Back to Market
Components
workspace/webhooks/hubspot-handler.js— main webhook handler (port :18790); HMAC-SHA256 sig verify; Phase 2 workflow action handlers; deal router, TC assignment, deal evaluator, SMS consolidationworkspace/scripts/hubspot-deal-creator.js— universal deal creator (1006 lines, 11 exports);createDealFromParsed()is the single entry point for all sourcesworkspace/scripts/lib/hubspot-client.js— shared HubSpot API client (auth, retry, rate-limit)workspace/scripts/lib/stage-sync.js— bidirectional stage sync HubSpot ↔ Supabaseworkspace/integrations/hubspot/actions/deal-router.js— workflow action: route deal to pipelineworkspace/integrations/hubspot/actions/sms-consolidation.js— workflow action: consolidate SMS into CRMworkspace/integrations/hubspot/actions/tc-assignment.js— workflow action: assign TCworkspace/integrations/hubspot/actions/deal-evaluator.js— workflow action: LLM deal scoringworkspace/scripts/dispo-deal-enricher.js— enriches dispo deal from associated contactsworkspace/scripts/lib/gmail-label-matcher.js— auto-creates Gmail labels for new deals
How it’s used
- Trigger: Inbound webhook from HubSpot (
deal.propertyChange,deal.creation,contact.creation) → Express handler on :18790 → HMAC verify → route to action handler - Outbound write: Agent dispatches (Aurora, Acq, Atlas) →
createDealFromParsed()inhubspot-deal-creator.js→ dual-pipeline write (acq 877963314 + dispo 816046) + contact find-or-create + deal-to-deal association - Agents involved: _summary (ingest + stage), _summary (outreach dispatch), Atlas (dispo), _summary (TC email)
- Failure mode: Webhook HMAC mismatch → 401 discard; Stage sync failure → Supabase fallback write + Discord ops alert; Rate-limit 429 → 3-retry exp backoff
- Success criteria: Deal visible in both pipelines with correct stage, contact linked, deal-to-deal association present,
infra_config_changesrow written for any config mutation
HubSpot KB — 13 files (largest KB in fleet)
| File | Purpose |
|---|---|
| API | Core CRM objects, auth, rate limits, common operations |
| WEBHOOKS | Subscription types, HMAC-SHA256 sig, batch limits |
| ASSOCIATIONS-API | v4 associations, typeIds, deal↔contact↔deal links |
| CALLS-API | Call logging, recordings, transcripts |
| CALLING-SDK | Embed calling app in HubSpot UI, inbound caller ID |
| COMMUNICATIONS-API | Log SMS/WhatsApp/LinkedIn as CRM timeline activities |
| CONVERSATIONS-API | Threads, messages, live chat, inbox webhooks |
| ENGAGEMENTS-API | All engagement types: calls, emails, notes, tasks, meetings |
| TIMELINE-EVENTS-API | Custom app activities on timeline (app 33237015) |
| APPS-REGISTRY | Portal 6193101 app inventory (5 apps); OpenClaw Main PAT ID 30738541 |
| DEVELOPER-PLATFORM-2026 | 2026.03 platform migration, CLI commands, app-hsmeta.json |
| COMMISSION-FIELDS | Deal commission field schema |
| ENGAGEMENTS-API | Full engagement schema reference |
Cross-links
Agents that touch this
- _summary — deal ingestion, stage management, outreach dispatch
- _summary — inbound SMS routing, deal routing decisions
- _summary — TC email automation on dispo deals
- _summary — dispo blast coordination, buyer management
Skills that invoke this
- hubspot-deal-ingest — universal source-agnostic entry point; calls
createDealFromParsed(); handles dedup, contact find-or-create, dual-pipeline writes (877963314 + 816046). ALWAYS use this — never reimplement. - acquisitions-outreach — Stage 1 SMS via OpenPhone/SalesMsg after deal created in acq pipeline
- acquisitions-followup — Stages 2-4 cadence triggered by acq deal stage changes
- dispo-blast — 4-channel buyer blast triggered by dispo deal stage
- betterfiles-dispo-emails — TC email on dispo deal close
Plans that govern this
- openclaw-fragmentation-fix-2026-05-01 — governance/stage-sync stabilization
- supabase-substrate-proactive-intelligence-2026-05-01 — deal state substrate
- openclaw-self-improvement-layer-2026-05-03 — OSIL: GEPA scoring on acquisition deals
Feedback rules
- reference_hubspot_api_key_findings — HubSpot Communications object channel types, Calling SDK schema, association typeIds
- reference_hubspot_developer_platform — HubSpot Dev Platform 2025.2 migration, CLI commands, app-hsmeta.json schema
- feedback_no_assumptions — verify field names against live API; past bugs:
event.contact_phonedidn’t exist (wasevent.contact.number)
KB / source docs
- API — core auth + CRM object reference
- WEBHOOKS — webhook subscription types + sig verification
- ASSOCIATIONS-API — v4 association schema + typeIds
System maps
- data-flow — deal data flow from inbound to CRM
- integrations — integration dependency graph
- acq-agent — acquisition agent architecture
Related: Deal-source CRMs
Peer hubs in the deal-source CRM cluster:
- investorlift — marketplace pull; deals flow IL → HubSpot via hubspot-deal-ingest
- supabase — bidirectional deal state sync;
acquisition_dealsandil_dealstables
Related: Webhook/tunnel cluster
HubSpot is a primary webhook producer. See co-members:
- cloudflare — Tunnel + WAF; FUNNEL-REGISTRY.md governance; DocuSign IP allowlist 90-day rotation
- openphone-quo — SMS inbound from contact holders flows through Quo handler (:18792) then into HubSpot deal context
- salesmsg — SalesMsg SMS inbound (:18793) cross-references HubSpot deal for reply routing
- twilio — voice calls logged back to HubSpot as call engagements
Open issues / TODOs
- PF-C deferred split: If this hub exceeds 400 lines in Wave 2, split to
hubspot-acq.md+hubspot-dispo.mdwith this file becoming a redirect stub - OpenClaw BetterFiles OAuth redirect still on Tailscale — cutover to
webhook.reri.codeferred; see APPS-REGISTRY - Timeline Events API: app 33237015 has
timelinescope but Marketplace Tech Partner gating verification pending Phase 1 re-research - Granular Permission Migration: review at https://app.hubspot.com/developer-apps/33237015/auth
Recent activity
- 2026-05-03: hub created (Wave 1 W1-S3)