IR

IR HubSpot Backend

This is the “brain” for the IR HubSpot integration app. It holds all secrets, validates inbound HubSpot v3 signatures, and makes outbound CRM calls using per-portal OAuth tokens. The HubSpot project (UI cards/settings) talks to these endpoints via hubspot.fetch.

Endpoints

Authentication

The cards and settings endpoints require a valid X-HubSpot-Signature-v3 header plus a X-HubSpot-Request-Timestamp within a 5-minute window, and a ?portalId that resolves to a configured portal — unsigned/direct browser requests get 401 (expected). The oauth routes instead use the standard authorization-code flow, guarded by the one-time state cookie.

Auth model