Same scopes for different accounts


Hi there,
I have to perform the same Oauth flow for all my users. As the Hubspot’s docs says:

Only paid Marketing subscriptions will have API access to the scopes and tools listed below for Marketing accounts. Marketing Free accounts will not have API access to any of the Marketing-only scopes

so my question is: how can I use the same permissions for both free and paid Hubspot user?

For example I’m using the automation and contacts scopes but automation is available only for paid user but I can’t know which plan the user has so I can’t change the scope dinamilly.

Moreover if I establish the Oauth flow with the scopes automation and contacts and the user is not a paid user Hubspot returns the following error:

You do not have the correct role to grant these permissions. Please contact your administrator.

How can I solve?



@mirkods You will need to get a list ahead of time of who are they paying users. There isn’t a way to dynamically determine who is a paying user or not on the fly. The other option would be to get the error back and then handle it by making a request to just the contacts scope as a second attempt.


Hi @pmanca thanks for your response.
Unfortunately I can’t get a list of paid users because we at Stamplay handle a lot of users accounts, something like Zapier and IFTTT so I don’t know my users.



@mirkods I would then add the call into a try catch block so you can then handle the error and try again with the a new call that just contains the free users scopes.