Problem with HubSpot OAuth Scopes Falling Back to Defaults in n8n

Hi everyone,

I’ve set up an app in HubSpot that I’d like to connect with n8n. I created the credentials (HubSpot Developer API) via OAuth, but I’ve run into a problem:

I can only use the scopes that are predefined in n8n, since n8n doesn’t take over the installation link from HubSpot. Instead, it always falls back to the default settings.

This leads to a core problem: I cannot change the scopes!

My question: how can I adjust the scopes in n8n, or modify the installation link (which contains the scopes) so that n8n uses it?

Thanks a lot in advance!

Hey @CFS welcome to the community.
You can’t change the scopes directly in n8n.

For a self hosted n8n, you need to edit the code file for the HubSpot connection to add your custom scopes.

1 Like

The scopes are in the source code for the oAuth: n8n/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts at master · n8n-io/n8n · GitHub

So as @Baseman said, moving to a self hosted version and changing these in source would be your best bet.

What are the ones you need?
Best practice here would be to just use the HTTP request node, and call the API yourself based on their documentation.

POSSIBLE (HACK) SOLUTION

When you click on “Connect my account” in n8n Credentials window, it opens a pop-up to connect your account. That pop-up has a specific URL. Part of that URL is a parameter called scope. You could copy that URL, manipulate it, and then just use that URL to see if you can get connected.

This is what I’m refering to

&scope=crm.lists.write%20crm.objects.contacts.read%20crm.objects.contacts.write%20crm.objects.companies.read%20crm.objects.companies.write%20crm.objects.deals.read%20crm.objects.deals.write%20crm.objects.owners.read%20crm.schemas.companies.read%20crm.schemas.contacts.read%20crm.schemas.deals.read%20forms%20tickets

You could append a few things to that, using the same structure (mind the url encoding).

Thanks for the replys. To be honest, didnt expect that to be such a pain.

I mean creating a trigger on the event “New Ticket Created” in HubSpot shouldn’t be such an unusual case….

You are welcome @CFS kindly mark as the solution if it helped.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.