How to create OAuth2 credentials for HubSpot
How to create OAuth2 credentials for HubSpot
In this guide, I will share the process for customising the auth config for HubSpot. So, let's begin.
Setting up HubSpot
In this section, we’ll go through the process of setting up HubSpot and creating a developer account.
NOTE: If you already have a HubSpot developer account, a public app, and access to the Client ID and Client Secret, you can skip to Step 3.
Step 1: Create a HubSpot developer account
Visit the HubSpot developer portal and create a new developer account.
A developer account is required because you’ll need to create a public app, which must be linked to a developer account to work with the HubSpot API.
Step 2: Create a Public App and Generate OAuth Credentials
Once your developer account is ready, you can create a public app and generate the OAuth Client ID and Client Secret.
Navigate to your app developer account.
Navigate to Apps in the main navigation bar.
In the top-right corner, click Create App.

Enter your app details, including name, description, logo, and support information. These details will be shown to users when they authenticate your app with their HubSpot account.

Now, you'll need the OAuth credentials. Click on the Auth tab and copy the Client ID and Client Secret.

Step 3: Set the Authorized Redirect URI
You’ll also need to configure the Authorized Redirect URI to point to Composio’s callback URL.
In the Redirect URLs section (just below the Client ID and Client Secret), add the following URL:
<https://backend.composio.dev/api/v3/toolkits/auth/callback>

That’s all you need to set up on the HubSpot side.
Creating the Auth Config in Composio
With your OAuth credentials ready, navigate to the Composio dashboard to configure the authentication settings for HubSpot.
Click on the Create Auth Config button to get a list of all the toolkits available.

In the sidebar that opens, choose HubSpot for the toolkit. Stick with all the default settings for now, as we'll configure it shortly.
Ensure the authentication is set to OAuth2 and not Bearer Token.

Also, make sure to check "Use your own developer authentication" because that's the main purpose.
Then, simply click Create HubSpot Auth Config.

Once you have the auth config for HubSpot set up, go to the Manage Auth Config tab, where you can fill in the auth config fields.

Paste the Client ID and Client Secret you just copied from HubSpot into their respective fields.

You can also customise the auth scopes if needed. Default scopes are already pre-filled for most apps.
Finally, set the Base URL to:
<https://api.hubapi.com>
This is the endpoint for all HubSpot API calls.
Once done, copy the auth config ID (which starts with ac_
) and use it in your application code via a secret manager.
Your custom HubSpot auth config is now ready to go! 🚀
In this guide, I will share the process for customising the auth config for HubSpot. So, let's begin.
Setting up HubSpot
In this section, we’ll go through the process of setting up HubSpot and creating a developer account.
NOTE: If you already have a HubSpot developer account, a public app, and access to the Client ID and Client Secret, you can skip to Step 3.
Step 1: Create a HubSpot developer account
Visit the HubSpot developer portal and create a new developer account.
A developer account is required because you’ll need to create a public app, which must be linked to a developer account to work with the HubSpot API.
Step 2: Create a Public App and Generate OAuth Credentials
Once your developer account is ready, you can create a public app and generate the OAuth Client ID and Client Secret.
Navigate to your app developer account.
Navigate to Apps in the main navigation bar.
In the top-right corner, click Create App.

Enter your app details, including name, description, logo, and support information. These details will be shown to users when they authenticate your app with their HubSpot account.

Now, you'll need the OAuth credentials. Click on the Auth tab and copy the Client ID and Client Secret.

Step 3: Set the Authorized Redirect URI
You’ll also need to configure the Authorized Redirect URI to point to Composio’s callback URL.
In the Redirect URLs section (just below the Client ID and Client Secret), add the following URL:
<https://backend.composio.dev/api/v3/toolkits/auth/callback>

That’s all you need to set up on the HubSpot side.
Creating the Auth Config in Composio
With your OAuth credentials ready, navigate to the Composio dashboard to configure the authentication settings for HubSpot.
Click on the Create Auth Config button to get a list of all the toolkits available.

In the sidebar that opens, choose HubSpot for the toolkit. Stick with all the default settings for now, as we'll configure it shortly.
Ensure the authentication is set to OAuth2 and not Bearer Token.

Also, make sure to check "Use your own developer authentication" because that's the main purpose.
Then, simply click Create HubSpot Auth Config.

Once you have the auth config for HubSpot set up, go to the Manage Auth Config tab, where you can fill in the auth config fields.

Paste the Client ID and Client Secret you just copied from HubSpot into their respective fields.

You can also customise the auth scopes if needed. Default scopes are already pre-filled for most apps.
Finally, set the Base URL to:
<https://api.hubapi.com>
This is the endpoint for all HubSpot API calls.
Once done, copy the auth config ID (which starts with ac_
) and use it in your application code via a secret manager.
Your custom HubSpot auth config is now ready to go! 🚀