Hi,
I am new here ![]()
I have a Notion form for interested contacts to subscribe to my hubspot newsletter. How can I change the subscription of a contact when he fills the form and a new contact is created in Hubspot?
Regards
Jonas
Hi,
I am new here ![]()
I have a Notion form for interested contacts to subscribe to my hubspot newsletter. How can I change the subscription of a contact when he fills the form and a new contact is created in Hubspot?
Regards
Jonas
Welcome to n8n, Jonas!
Youβll need to use HubSpotβs Communication Preferences API to update subscription types. Hereβs the exact workflow:
Workflow Structure:
Notion Trigger β HubSpot (Create/Update Contact) β HubSpot (Update Subscription)
Create or Update ContactemailfirstnamelastnameContactUpdate{{ $json.id }} (from previous node)hs_communication_subscription_opt_in_{SUBSCRIPTION_TYPE_ID}trueYou need the internal ID of your newsletter subscription:
https://app.hubspot.com/subscription-preferences/{PORTAL_ID}/types/{SUBSCRIPTION_TYPE_ID}SUBSCRIPTION_TYPE_IDIf you need more granular control:
HTTP Request Node:
Method: PUT
URL: https://api.hubapi.com/communication-preferences/v3/subscribe
Headers:
- Authorization: Bearer YOUR_ACCESS_TOKEN
- Content-Type: application/json
Body:
{
"emailAddress": "{{$json.email}}",
"subscriptionId": "YOUR_SUBSCRIPTION_TYPE_ID",
"legalBasis": "LEGITIMATE_INTEREST_CLIENT",
"legalBasisExplanation": "Subscribed via Notion form"
}
Legal Basis Options:
LEGITIMATE_INTEREST_CLIENT - Most common for B2BCONSENT - If they explicitly opted inNOT_APPLICABLE - For existing business relationshipsCommon Pitfall: Make sure your HubSpot API key has communication_preferences.write scope enabled.
If you have multiple newsletter types (e.g., Weekly Digest, Product Updates), you can add conditional logic:
Switch Node β Check Notion form field β Route to different subscription IDs
This is a common workflow pattern I implement for clients who need sophisticated marketing automation setups. The key is ensuring proper consent tracking and maintaining GDPR compliance with the legalBasis parameter.
Let me know if you need help with the specific subscription ID or setting up the authentication! Happy to walk you through it.
That is awesome! Thank you so much!
I had to change PUT to POST. It was working then ![]()
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.