How can I edit the subscription type a contact is subscribed to?

Hi,

I am new here :smiley:

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:

Solution: Update HubSpot Subscription Status

Workflow Structure:

Notion Trigger β†’ HubSpot (Create/Update Contact) β†’ HubSpot (Update Subscription)

Step 1: Create/Update Contact in HubSpot

  1. Add HubSpot node
  2. Operation: Create or Update Contact
  3. Map your Notion form fields:
    • Email β†’ email
    • First Name β†’ firstname
    • Last Name β†’ lastname

Step 2: Update Subscription Type

  1. Add another HubSpot node
  2. Resource: Contact
  3. Operation: Update
  4. Contact ID: {{ $json.id }} (from previous node)
  5. Click Add Field β†’ Custom Properties
  6. Add this specific field:
    • Property Name: hs_communication_subscription_opt_in_{SUBSCRIPTION_TYPE_ID}
    • Value: true

Finding Your Subscription Type ID:

You need the internal ID of your newsletter subscription:

  1. Go to HubSpot β†’ Settings β†’ Marketing β†’ Email β†’ Subscriptions
  2. Click on your newsletter subscription type
  3. Look at the URL: https://app.hubspot.com/subscription-preferences/{PORTAL_ID}/types/{SUBSCRIPTION_TYPE_ID}
  4. Copy that SUBSCRIPTION_TYPE_ID

Alternative: Using HTTP Request Node (More Control)

If 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"
}

Important Notes:

Legal Basis Options:

  • LEGITIMATE_INTEREST_CLIENT - Most common for B2B
  • CONSENT - If they explicitly opted in
  • NOT_APPLICABLE - For existing business relationships

Common Pitfall: Make sure your HubSpot API key has communication_preferences.write scope enabled.

Pro Tip for Multiple Subscription Types:

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.

1 Like

That is awesome! Thank you so much!

I had to change PUT to POST. It was working then :folded_hands:t2:

2 Likes