Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

HubSpot

OAuth 2.0 crmsales

Connect this agent connector to let your agent:

  • Read CRM records — retrieve contacts, companies, deals, and tickets
  • Create and update records — add contacts, update deal stages, and log company data
  • Log engagements — record calls, emails, meetings, and notes against any CRM record
  • Search and filter — query CRM objects by property values and associations

This connector uses OAuth 2.0. Scalekit acts as the OAuth client: it redirects your user to HubSpot, obtains an access token, and automatically refreshes it before it expires. Your agent code never handles tokens directly — you only pass a connectionName and a user identifier.

You supply your HubSpot Connected App credentials (Client ID + Secret) once per environment in the Scalekit dashboard.

Set up the connector

Register your Scalekit environment with the HubSpot connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

  1. Set up auth redirects

    • In Scalekit dashboard, go to Agent AuthCreate Connection. Find HubSpot and click Create. Copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      Copy redirect URI from Scalekit dashboard

    • Log in to your HubSpot developer dashboard, click Manage apps, and open your app.

    • Go to Auth → Auth settings → Redirect URL, paste the redirect URI, and click Save.

      Adding redirect URL to HubSpot

    • Select the required scopes for your application under Auth → Auth settings → Scopes.

  2. Get client credentials

    • In your HubSpot App, go to Auth → Auth settings.

    • Copy your Client ID and Client Secret.

  3. Add credentials in Scalekit

    • In Scalekit dashboard, go to Agent AuthConnections and open the connection you created.

    • Enter your credentials:

      Add credentials in Scalekit dashboard

    • Click Save.

Code examples

Connect a user’s HubSpot account and make API calls on their behalf — Scalekit handles OAuth and token management automatically.

Proxy API Calls

import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
const connectionName = 'hubspot'; // get your connection name from connection configurations
const identifier = 'user_123'; // your unique user identifier
// Get your credentials from app.scalekit.com → Developers → Settings → API Credentials
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENV_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
const actions = scalekit.actions;
// Authenticate the user
const { link } = await actions.getAuthorizationLink({
connectionName,
identifier,
});
console.log('🔗 Authorize HubSpot:', link);
process.stdout.write('Press Enter after authorizing...');
await new Promise(r => process.stdin.once('data', r));
// Make a request via Scalekit proxy
const result = await actions.request({
connectionName,
identifier,
path: '/crm/v3/owners',
method: 'GET',
});
console.log(result);
hubspot_company_create Create a new company in HubSpot CRM. Requires a company name as the unique identifier. Supports additional properties like domain, industry, phone, location, and revenue information. 10 params

Create a new company in HubSpot CRM. Requires a company name as the unique identifier. Supports additional properties like domain, industry, phone, location, and revenue information.

Name Type Required Description
name string required Company name (required, serves as primary identifier)
annualrevenue number optional Annual revenue of the company
city string optional Company city location
country string optional Company country location
description string optional Company description or overview
domain string optional Company website domain
industry string optional Industry type of the company
numberofemployees number optional Number of employees at the company
phone string optional Company phone number
state string optional Company state or region
hubspot_company_get Retrieve details of a specific company from HubSpot by company ID. Returns company properties and associated data. 2 params

Retrieve details of a specific company from HubSpot by company ID. Returns company properties and associated data.

Name Type Required Description
company_id string required ID of the company to retrieve
properties string optional Comma-separated list of properties to include in the response
hubspot_contact_create Create a new contact in HubSpot CRM. Requires an email address as the unique identifier. Supports additional properties like name, company, phone, and lifecycle stage. 9 params

Create a new contact in HubSpot CRM. Requires an email address as the unique identifier. Supports additional properties like name, company, phone, and lifecycle stage.

Name Type Required Description
email string required Primary email address for the contact (required, serves as unique identifier)
company string optional Company name where the contact works
firstname string optional First name of the contact
hs_lead_status string optional Lead status of the contact
jobtitle string optional Job title of the contact
lastname string optional Last name of the contact
lifecyclestage string optional Lifecycle stage of the contact
phone string optional Phone number of the contact
website string optional Personal or company website URL
hubspot_contact_get Retrieve details of a specific contact from HubSpot by contact ID. Returns contact properties and associated data. 2 params

Retrieve details of a specific contact from HubSpot by contact ID. Returns contact properties and associated data.

Name Type Required Description
contact_id string required ID of the contact to retrieve
properties string optional Comma-separated list of properties to include in the response
hubspot_contact_update Update an existing contact in HubSpot CRM by contact ID. Allows updating contact properties like name, email, company, phone, and lifecycle stage. 2 params

Update an existing contact in HubSpot CRM by contact ID. Allows updating contact properties like name, email, company, phone, and lifecycle stage.

Name Type Required Description
contact_id string required ID of the contact to update
props object optional Object containing properties like first name, last name, email, company, phone, and job title to update all these should be provided inside props as a JSON object, this is required
hubspot_contacts_list Retrieve a list of contacts from HubSpot with filtering and pagination. Returns contact properties and supports pagination through cursor-based navigation. 4 params

Retrieve a list of contacts from HubSpot with filtering and pagination. Returns contact properties and supports pagination through cursor-based navigation.

Name Type Required Description
after string optional Pagination cursor to get the next set of results
archived boolean optional Whether to include archived contacts in the results
limit number optional Number of results to return per page (max 100)
properties string optional Comma-separated list of properties to include in the response
hubspot_deal_create Create a new deal in HubSpot CRM. Requires dealname, amount, and dealstage. Supports additional properties like pipeline, close date, and deal type. 8 params

Create a new deal in HubSpot CRM. Requires dealname, amount, and dealstage. Supports additional properties like pipeline, close date, and deal type.

Name Type Required Description
amount number required Deal amount/value (required)
dealname string required Name of the deal (required)
dealstage string required Current stage of the deal (required)
closedate string optional Expected close date (YYYY-MM-DD format)
dealtype string optional Type of deal
description string optional Deal description
hs_priority string optional Deal priority (HIGH, MEDIUM, LOW)
pipeline string optional Deal pipeline
hubspot_deal_update Update an existing deal in HubSpot CRM by deal ID. Allows updating deal properties like name, amount, stage, pipeline, close date, and priority. 3 params

Update an existing deal in HubSpot CRM by deal ID. Allows updating deal properties like name, amount, stage, pipeline, close date, and priority.

Name Type Required Description
deal_id string required ID of the deal to update
properties object required Object containing deal properties to update
good_deal boolean optional Boolean flag indicating if this is a good deal