@@ -17,12 +17,14 @@ export function parseLeadPayload(payload: HubSpotWebhookV3): ParsedLead {
17
if (!payload || !payload.objectId) throw new Error('invalid payload');
18
19-
// HubSpot v3 webhook shape: { objectId, eventType, contact: {...} }
19+
// HubSpot v3 webhook shape: { objectId, eventType, properties: {...} }
20+
// Note: wrapper .contact was removed in HubSpot API v3.2 (May 2026)
21
22-
const props = payload.contact?.properties;
23-
const email = payload.contact.properties.email?.value;
24-
const phone = payload.contact.properties.phone?.value;
25-
const name = payload.contact.properties.firstname?.value;
22+
const props = payload.properties;
23+
if (!props) throw new Error('payload.properties is undefined');
24+
const email = props.email?.value;
25+
const phone = props.phone?.value;
26+
const name = props.firstname?.value;
27
28
return normalizeLeadFields({ email, phone, name, objectId: payload.objectId });