Use HubSpot's GraphQL API to query CRM records with nested associations in a single request, reducing round-trips compared to the REST CRM search API

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

This API has logged drift

hubspot.com has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when hubspot.com drifts again →

In-depth guide

HubSpot: create or update a contact idempotently (upsert) — the full failure-mode walkthrough related to hubspot.com, checked against official docs, with linked verified routes.

Steps

  1. Obtain a private app access token with CRM object read scopes for the object types you intend to query
  2. POST to https://api.hubapi.com/collector/graphql with Content-Type: application/json and a GraphQL query body selecting a CRM object (e.g. contacts) with property fields and an associations block for a related object (e.g. companies)
  3. Include 'after' cursor variables in the query for pagination of both the primary object list and the nested association list
  4. Parse the response JSON under 'data.CRM.contact_collection' (or the relevant object collection path), iterating 'items' and their nested 'associations' collections
  5. Implement cursor-based pagination by extracting 'paging.next.after' from the response and re-issuing the query with the updated cursor

Known gotchas

Related routes

Use HubSpot GraphQL API to query nested CRM records and associations in a single request
developers.hubspot.com · 6 steps · unrated
Use the HubSpot CRM Search API with nested filter groups to perform complex multi-condition queries across objects
developers.hubspot.com · 6 steps · unrated
Use the HubSpot CRM Search API with nested filterGroups to query records matching complex multi-condition criteria and paginate results
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