agentskit.js
ToolsIntegrations

hubspot

HubSpot CRM — search contacts and create deals. Private app access token.

import { hubspot } from '@agentskit/tools/integrations'

const tools = hubspot({ accessToken: process.env.HUBSPOT_ACCESS_TOKEN! })

Bundled: hubspot(config) returns both sub-tools. Calls HubSpot CRM API v3 at https://api.hubapi.com.

#Sub-tools

NamePurpose
hubspot_search_contactsSearch contacts by email, name, or any property
hubspot_create_dealCreate a deal and optionally associate it with a contact

#Schema

#hubspot_search_contacts

ParameterTypeRequiredDescription
querystringyesSearch query — matches email, name, or any indexed property
limitnumbernoMax contacts to return (default 10)

Returns: id, email, name, company for each match.

#hubspot_create_deal

ParameterTypeRequiredDescription
dealnamestringyesDeal name
amountnumbernoDeal amount
pipelinestringnoPipeline ID
dealstagestringnoDeal stage ID
contactIdstringnoContact ID to associate with the deal

#Example — sales agent

import { createRuntime } from '@agentskit/runtime'
import { hubspot } from '@agentskit/tools/integrations'

const runtime = createRuntime({
  adapter,
  systemPrompt: 'You are a sales assistant. Search for the contact, then create a deal tied to them.',
  tools: hubspot({ accessToken: process.env.HUBSPOT_ACCESS_TOKEN! }),
})

await runtime.run('Find the contact alice@example.com and create a $5000 deal in the default pipeline.')

#Security

  • Env var required: HUBSPOT_ACCESS_TOKEN — a HubSpot private app token (Settings → Integrations → Private Apps).
  • Scopes required: crm.objects.contacts.read, crm.objects.deals.write. Grant only the scopes your agent uses.
  • HubSpot enforces rate limits of 100 requests per 10 seconds per private app. For high-volume agents, add a delay or batch operations.
  • Never use OAuth user tokens for server-side agents — use private app tokens which have no expiry.

Explore nearby

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page

Ask the docs

Ask anything about AgentsKit. Answers come from the docs corpus via OpenRouter free-tier models. Rate limited per IP.