## HubSpot integration HubSpot is a CRM platform that helps businesses manage contacts, companies, deals, and customer interactions. Integrating HubSpot with Frontegg allows your application to read and write CRM data — including contacts, companies, deals, quotes, and owners — on behalf of your users through OAuth 2.0 authentication. Prerequisites - A HubSpot account with developer access ### Connect HubSpot #### Step 1: Open the developer portal Go to [developers.hubspot.com](https://developers.hubspot.com/) and sign in with your HubSpot account. ![HubSpot developer portal homepage](/assets/hubspot-1.70470d4cc10b98b28d4cca98bedd7dec74b5ccb90dee0a3f6dc84c28b65b8f67.1ce25488.png) #### Step 2: Go to Legacy Apps Once signed in, you will be in your HubSpot developer account. In the left sidebar, navigate to **Development** → **Legacy Apps**. This page lists all existing applications in your account. ![HubSpot Legacy Apps list](/assets/hubspot-2.0b4402749e515c30bc5c28ad636eda2a8d97d2d7d249880aa09210f8966474ba.1ce25488.png) #### Step 3: Create a new app Click **Create legacy app** in the top right corner. In the dialog that appears, select **Public** (for apps that can be installed by any HubSpot account) and click **Next**. ![HubSpot Create Legacy App dialog](/assets/hubspot-3.b63ee6cd2e2e0f8c9c7768312126a2e5704da00c64ce6fae324cbb28768edd6d.1ce25488.png) #### Step 4: Fill in the app name On the **App Info** tab, enter a name for your application in the **Public app name** field (for example, "Frontegg Integration"). This name appears in HubSpot tools when users install your app. ![HubSpot app name form](/assets/hubspot-4.490a26901c55979828492723a802ff7226e093089277de9bc746aaa83811e576.1ce25488.png) #### Step 5: Configure auth settings Click the **Auth** tab to open the authentication configuration page. ![HubSpot Auth settings tab](/assets/hubspot-5.5fbd660f759b2f6cba8d917797e6f73c8fc6a6a60c233aa74df7567348c16743.1ce25488.png) #### Step 6: Add redirect URLs Scroll down to the **Redirect URLs** section. Enter the following redirect URLs, adding each one separately by typing the URL and clicking **+ Add redirect URL**: - `https://YOUR_MCP_GATEWAY_URL/integration-callback` ![HubSpot redirect URLs configuration](/assets/hubspot-6.fd158d662490ecb3780b97c2e12800a3c95c897f446ebec71d0a607cd1bc33a6.1ce25488.png) #### Step 7: Add OAuth scopes Scroll down to the **Scopes** section and click **Add new scope**. Select the required scopes from the list: | Scope | Description | | --- | --- | | `crm.objects.contacts.read` | Read contact records | | `crm.objects.contacts.write` | Create and update contact records | | `crm.objects.companies.read` | Read company records | | `crm.objects.companies.write` | Create and update company records | | `crm.objects.deals.read` | Read deal records | | `crm.objects.deals.write` | Create and update deal records | | `crm.objects.owners.read` | Read owner (user) records | | `crm.objects.quotes.read` | Read quote records | | `crm.objects.quotes.write` | Create and update quote records | | `crm.objects.line_items.read` | Read line item records | | `crm.objects.line_items.write` | Create and update line item records | | `crm.schemas.contacts.read` | Read contact property schemas | | `crm.schemas.companies.read` | Read company property schemas | | `crm.schemas.deals.read` | Read deal property schemas | | `crm.schemas.custom.read` | Read custom object schemas | Minimum required scopes For basic CRM functionality, you need: `crm.objects.contacts.read`, `crm.objects.companies.read`, `crm.objects.deals.read`. ![HubSpot scope selection dialog](/assets/hubspot-7.15458a581d7c06a5aa2cf441d3e192eb7551792c32935d498f52dd02c5826106.1ce25488.png) After selecting all required scopes, click **Update**. ![HubSpot scopes selected](/assets/hubspot-8.28b4e40c9e2ee048917471d9dd23cf8413429c3919eb50e6fce86429fb50e247.1ce25488.png) #### Step 8: Create the app Once all required details are set, click **Create app** at the bottom of the page. ![HubSpot Create app button enabled](/assets/hubspot-9.ce277c844b9604b139971dd70919a8f4ecd1a90167641d3970741a6a3a543064.1ce25488.png) #### Step 9: Copy your credentials After the app is created, the **Auth settings** page displays your app credentials: - **Client ID** — Your app's unique identifier used to initiate OAuth. - **Client secret** — Click **Show** to reveal the secret. Used to exchange authorization codes for access tokens. Copy both values and store them securely. Keep your credentials secure Never share or commit your Client secret to version control. ![HubSpot app credentials page](/assets/hubspot-10.c85dcabe2a9ce4f702a00f7d5c762283224fb0b6b2a419860bfffc3e3bdcdcef.1ce25488.png) ### Configure the Frontegg portal Once you have obtained your **Client ID** and **Client secret** from the steps above, enter them in the integration configuration page of the Frontegg portal: 1. Open the **Frontegg portal** and navigate to [ENVIRONMENT] → Integrations → HubSpot. 2. Enter the **Client ID** and **Client secret** in the corresponding fields. 3. Select the required **scopes**. 4. Click **Save**. ### Additional resources - [HubSpot API documentation](https://developers.hubspot.com/docs/guides/crm/understanding-the-crm) - [HubSpot OAuth guide](https://developers.hubspot.com/docs/api/working-with-oauth) - [HubSpot developers home](https://developers.hubspot.com/) - [How to get your Redirect URL](/agen-for-work/connectors/redirect-url)