Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(warehouse_sources): support hubspot api version 2026-09 (#112584)

Tom Owers00d4c278bb3e
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/settings.py
index 594139e9bc6a..65c5a765114c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/settings.py
@@ -14,10 +14,11 @@ STARTDATE = datetime(year=2000, month=1, day=1)
# Vendor API version labels. HubSpot moved to date-based versioning ("YYYY-MM"); the legacy
# "v3" pin keeps the historical /crm/v3/ (objects, properties) + /crm/v4/ (association
# batch-read) URL split. Under a date version the version segment moves to *after* the API
-# resource name, so /crm/v3/objects/... becomes /crm/objects/2026-03/... and
-# /crm/v4/associations/... becomes /crm/associations/2026-03/... .
+# resource name, so for 2026-09, /crm/v3/objects/... becomes /crm/objects/2026-09/... and
+# /crm/v4/associations/... becomes /crm/associations/2026-09/... .
HUBSPOT_API_VERSION_V3 = "v3"
HUBSPOT_API_VERSION_2026_03 = "2026-03"
+HUBSPOT_API_VERSION_2026_09 = "2026-09"
# Matches the leading "/crm/<v3|v4>/<resource>" of a CRM path, capturing the resource name
# (objects, properties, associations, pipelines, owners) so the version can be re-inserted after
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/source.py
index 552158a02783..c9b8359e24cd 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/source.py
@@ -41,6 +41,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.hubspot.se
DEFAULT_PROPS,
ENDPOINTS as HUBSPOT_ENDPOINTS,
HUBSPOT_API_VERSION_2026_03,
+ HUBSPOT_API_VERSION_2026_09,
HUBSPOT_API_VERSION_V3,
HUBSPOT_ENDPOINTS as HUBSPOT_ENDPOINT_CONFIGS,
HUBSPOT_METADATA_ENDPOINTS as HUBSPOT_METADATA_ENDPOINT_CONFIGS,
@@ -58,8 +59,8 @@ class HubspotSourceOldConfig(config.Config):
@SourceRegistry.register
class HubspotSource(ResumableSource[HubspotSourceConfig | HubspotSourceOldConfig, HubspotResumeConfig], OAuthMixin):
- supported_versions = (HUBSPOT_API_VERSION_V3, HUBSPOT_API_VERSION_2026_03)
- default_version = HUBSPOT_API_VERSION_2026_03
+ supported_versions = (HUBSPOT_API_VERSION_V3, HUBSPOT_API_VERSION_2026_03, HUBSPOT_API_VERSION_2026_09)
+ default_version = HUBSPOT_API_VERSION_2026_09
api_docs_url = "https://developers.hubspot.com/docs/api-reference/latest/overview"
lists_tables_without_credentials = True # static endpoint catalog — safe for public docs
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/test/test_source_routing.py b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/test/test_source_routing.py
index 2d515b1ac0c0..1b3e943055cc 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/test/test_source_routing.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/hubspot/test/test_source_routing.py
@@ -9,6 +9,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.hubspot.se
DEFAULT_PROPS,
ENDPOINTS,
HUBSPOT_API_VERSION_2026_03,
+ HUBSPOT_API_VERSION_2026_09,
HUBSPOT_API_VERSION_V3,
HUBSPOT_ENDPOINTS,
HUBSPOT_METADATA_ENDPOINTS,
@@ -327,14 +328,19 @@ def test_transient_http_error_is_retryable(error_msg: str) -> None:
class TestApiVersion:
def test_defaults_to_latest_date_version(self) -> None:
src = HubspotSource()
- assert src.default_version == HUBSPOT_API_VERSION_2026_03
- # A source with no pin (a newly created one) resolves to the 2026-03 default...
- assert src.resolve_api_version(None) == HUBSPOT_API_VERSION_2026_03
- # ...while a v3 pin is honored verbatim so existing sources stay on the legacy paths.
+ assert src.default_version == HUBSPOT_API_VERSION_2026_09
+ # A source with no pin (a newly created one) resolves to the 2026-09 default...
+ assert src.resolve_api_version(None) == HUBSPOT_API_VERSION_2026_09
+ # ...while older pins are honored verbatim so existing sources keep their paths.
assert src.resolve_api_version(HUBSPOT_API_VERSION_V3) == HUBSPOT_API_VERSION_V3
+ assert src.resolve_api_version(HUBSPOT_API_VERSION_2026_03) == HUBSPOT_API_VERSION_2026_03
- def test_both_versions_supported(self) -> None:
- assert set(HubspotSource().supported_versions) == {HUBSPOT_API_VERSION_V3, HUBSPOT_API_VERSION_2026_03}
+ def test_all_versions_supported(self) -> None:
+ assert set(HubspotSource().supported_versions) == {
+ HUBSPOT_API_VERSION_V3,
+ HUBSPOT_API_VERSION_2026_03,
+ HUBSPOT_API_VERSION_2026_09,
+ }
@pytest.mark.parametrize(
"path,api_version,expected",
@@ -360,6 +366,15 @@ class TestApiVersion:
# trailing separator would leave owners calling the legacy endpoint under a date pin.
("/crm/v3/owners", HUBSPOT_API_VERSION_2026_03, "/crm/owners/2026-03"),
("/crm/v3/owners", HUBSPOT_API_VERSION_V3, "/crm/v3/owners"),
+ ("/crm/v3/objects/contacts", HUBSPOT_API_VERSION_2026_09, "/crm/objects/2026-09/contacts"),
+ ("/crm/v3/properties/deals", HUBSPOT_API_VERSION_2026_09, "/crm/properties/2026-09/deals"),
+ (
+ "/crm/v4/associations/contacts/deals/batch/read",
+ HUBSPOT_API_VERSION_2026_09,
+ "/crm/associations/2026-09/contacts/deals/batch/read",
+ ),
+ ("/crm/v3/pipelines/deals", HUBSPOT_API_VERSION_2026_09, "/crm/pipelines/2026-09/deals"),
+ ("/crm/v3/owners", HUBSPOT_API_VERSION_2026_09, "/crm/owners/2026-09"),
],
)
def test_apply_crm_api_version(self, path: str, api_version: str, expected: str) -> None:
@@ -368,9 +383,10 @@ class TestApiVersion:
@pytest.mark.parametrize(
"pin,expected",
[
- (None, HUBSPOT_API_VERSION_2026_03),
+ (None, HUBSPOT_API_VERSION_2026_09),
(HUBSPOT_API_VERSION_V3, HUBSPOT_API_VERSION_V3),
(HUBSPOT_API_VERSION_2026_03, HUBSPOT_API_VERSION_2026_03),
+ (HUBSPOT_API_VERSION_2026_09, HUBSPOT_API_VERSION_2026_09),
],
)
def test_source_for_pipeline_threads_resolved_version(self, pin: str | None, expected: str) -> None: