Guides / n8n × HubSpot / Migration

HubSpot deprecated endpoints: migrating legacy v1 and v2 calls to v3

The concrete path, identifier and payload changes between HubSpot's legacy CRM endpoints and the v3 object API, including the vid-to-id switch that quietly breaks stored record references.

Illustrated troubleshooting diagram for Fix HubSpot deprecated API endpoints: migrate legacy v1 and v2 calls to v3.
404 on a route that worked for years, such as /contacts/v1/contact/vid/12345/profile — or 400 "Invalid input JSON" after swapping the URL to v3 without changing the body shape.
Short answer: The v3 CRM API is not a renamed v1. Paths move to /crm/v3/objects/{objectType}, the identifier changes from vid to id, properties move from a flat list of name/value pairs to a single properties object, and reads no longer return every property by default — you must name them in a properties query parameter. Migrate one endpoint at a time against a test portal, and audit every stored HubSpot ID, because a persisted vid is not automatically a valid v3 id everywhere it is used.

The path mapping

Legacy HubSpot APIs were per-object and inconsistently shaped: contacts lived under /contacts/v1/, companies under /companies/v2/, deals under /deals/v1/. The v3 API collapses all of them into one uniform pattern at /crm/v3/objects/{objectType}, where objectType is contacts, companies, deals, tickets or the fully-qualified name of a custom object. The same operations exist for every object type, with the same request and response shape, which is the main practical benefit of migrating.

Common legacy routes and their v3 equivalents

Legacy routev3 equivalent
GET /contacts/v1/contact/vid/{vid}/profileGET /crm/v3/objects/contacts/{id}
POST /contacts/v1/contactPOST /crm/v3/objects/contacts
GET /contacts/v1/lists/all/contacts/allGET /crm/v3/objects/contacts
GET /companies/v2/companies/{id}GET /crm/v3/objects/companies/{id}
PUT /deals/v1/deal/{dealId}PATCH /crm/v3/objects/deals/{id}
POST /contacts/v1/contact/batch/POST /crm/v3/objects/contacts/batch/update

The payload shape changes, not only the URL

This is where a URL-only migration fails. Legacy contact writes took a properties array of {property, value} pairs; v3 takes a single properties object of plain key-value pairs. Legacy reads returned a properties map where every value was itself an object with a value key and change metadata; v3 returns flat values. Any downstream expression reading $json.properties.email.value has to become $json.properties.email.

The update verb changes too. Legacy deal updates used PUT with whole-record semantics; v3 uses PATCH and merges, so a field omitted from a v3 update is left alone rather than cleared. Code that relied on PUT clearing omitted fields will quietly stop clearing them.

# Legacy create
POST /contacts/v1/contact
{ "properties": [ { "property": "email", "value": "ada@example.com" },
                  { "property": "firstname", "value": "Ada" } ] }
# -> { "vid": 12345, ... }

# v3 create
POST /crm/v3/objects/contacts
{ "properties": { "email": "ada@example.com", "firstname": "Ada" } }
# -> { "id": "12345", "properties": { ... }, "createdAt": "..." }

# Reading a property in an n8n expression
# legacy: {{ $json.properties.email.value }}
# v3:     {{ $json.properties.email }}        <- undefined if you forget

v3 does not return every property by default

Legacy endpoints were generous: a contact read returned essentially everything. v3 returns a small default set and nothing else unless you ask. A migration that swaps the URL and the body shape correctly can still break, because a custom property the workflow has always read is simply absent from the response — with no error, just an undefined value flowing downstream.

Name every property the workflow needs in the properties query parameter, as a comma-separated list. Keep that list in one place rather than repeating it across nodes, so adding a field to the sync is one edit.

GET https://api.hubapi.com/crm/v3/objects/contacts/12345
    ?properties=email,firstname,lastname,hs_lead_status,custom_tier
Authorization: Bearer pat-na1-xxxx...

# Omit the parameter and custom_tier is absent from the response.
# Not an error — just missing, which is worse.

# Same for list reads:
GET /crm/v3/objects/contacts?limit=100&properties=email,custom_tier
# -> { "results": [...],
#      "paging": { "next": { "after": "12345" } } }
# v3 pages with an opaque `after` cursor, not a numeric offset.

Stored identifiers are the hidden migration cost

Any system holding HubSpot record references — a warehouse table, a mapping file, another CRM's external-ID field — stored them under the legacy naming. Contact vids map to v3 contact ids, but v3 returns the id as a string where legacy returned a number, so joins written against an integer column silently match nothing after a naive port.

Audit the stored references before cutover rather than after. Take a sample of a few hundred stored IDs, resolve each through the v3 read endpoint, and confirm the hit rate is 100%. A partial hit rate found in testing is a data task; the same partial hit rate found in production is a sync that has been dropping records for a week.

Migrate authentication and endpoint versions as two separate changes. Doing both at once makes a 401 and a 404 indistinguishable, and you will chase the credential while the route is the problem.

A migration sequence that stays reversible

Take one endpoint at a time and run it against a test portal first, comparing the v3 response field by field with the legacy response for the same record. Keep the legacy call in place behind a flag until the v3 path has produced identical output for a full cycle of real data, then remove it. Batch endpoints last: they carry the largest payloads and the most to go wrong, and by then the shape differences are already understood.

  • Path: /crm/v3/objects/{objectType}, uniform across every object.
  • Identifier: vid becomes id, and it arrives as a string.
  • Write body: properties array becomes a properties object.
  • Read body: property values are flat, not {value, versions}.
  • Reads return only the properties you name in ?properties=.
  • PUT whole-record semantics become PATCH merge semantics.

Filtered list reads become Search, with a much stricter limit

Legacy endpoints let you pull a broad list and filter it client-side without much thought, because they returned everything and the request count stayed low. The v3 equivalent of a filtered read is the Search endpoint, and moving to it changes the rate-limit picture completely: search is capped at 5 requests per second per account, combined across every object type, rather than the 100 or 190 per 10 seconds that govern ordinary reads.

That makes an otherwise sensible refactor — replacing a client-side filter with a server-side search — a common cause of new 429s immediately after a v3 migration, with nothing in the workflow's logic having changed. If the filtering can be done by reading a page of records and filtering locally, that is often both cheaper and faster than searching per item.

Search also paginates differently from a plain list read and has its own result ceiling, so a search-based backfill over a large object needs a strategy for walking past that ceiling — usually by partitioning the query on a date or ID range rather than by paging deeper.

POST https://api.hubapi.com/crm/v3/objects/contacts/search
Authorization: Bearer pat-na1-xxxx...

{
  "filterGroups": [ { "filters": [
    { "propertyName": "lastmodifieddate", "operator": "GTE",
      "value": "1757808000000" } ] } ],
  "properties": ["email", "custom_tier"],
  "limit": 100,
  "after": "0"
}

# Governed by 5 req/sec across ALL search endpoints combined.
# Pace search calls at 200 ms — twenty times more conservative
# than the general read limit requires.

Where these facts come from