Hello. I am testing some of HubSpot’s api endpoints and its letting me use a service key as the bearer token. Is this the correct way to do this and would i be allowed to later upload this to marketplace where i tell users we need an access key and that it would be stored securely? Or would this be rejected?
Hi @TForest and a big warm welcome to the HubSpot Community!
Great question, love that you’re asking!
I can confirm that Service keys as bearer tokens are a valid, documented auth method for making authenticated requests to your own HubSpot account (see the documentation here: Service keys). It works fine for testing/account-level operations.
However, for marketplace apps, I’d love to have the insights from our Top Experts: Hi @Anton, @evaldas and @Teun do you have suggestions to help @TForest, please?
If you are planning to build a marketplace app, then you should not be using service keys there.
This blog article has some good explanations on where/how to use service keys and reinforces the fact that service keys functionality should not be used for public apps.
As @Berangere shared, OAuth is the way to go for Marketplace apps.