Can I use Service Keys for Marketplace Apps in HubSpot?

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?

Thanks.

Hi @TForest and a big warm welcome to the HubSpot Community! :orange_heart:

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?

In the meantime, I’d like to share this documentation that can help: Working with OAuth - HubSpot docs

Thanks so much and enjoy the day!

Bérangère

Hi @TForest,

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.

Hope this helps!