Use the HubSpot OAuth scopes model and private app tokens to implement least-privilege access for a CRM integration

domain: developers.hubspot.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enumerate the exact HubSpot API scopes your integration needs by reviewing the permissions table for each API endpoint you call
  2. For a server-to-server integration create a Private App in HubSpot and select only the required scopes at creation time
  3. Copy the private app token from the Auth tab and store it securely; use it as a Bearer token in the Authorization header
  4. For user-installed integrations implement the standard OAuth 2.0 authorization code flow, requesting only required scopes in the authorize URL
  5. Handle token refresh using the refresh token against the HubSpot token endpoint before the access token expires
  6. Periodically audit the scopes in use; remove scopes that are no longer needed to reduce the blast radius of a credential leak

Known gotchas

Related routes

Create and read associations between HubSpot CRM objects using Associations API v4
developers.hubspot.com · 5 steps · unrated
Search HubSpot CRM objects using the Search API with filters and pagination
developers.hubspot.com · 5 steps · unrated
Perform CRUD operations on HubSpot custom object records using the CRM Objects API
developers.hubspot.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans