: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(salesloft): add opportunity stages, opportunity people and tags (#129998)
Tom Owers7645c3eb0b67
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex a3e49995f228..eb491208c250 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -10584,13 +10584,13 @@ Today (28): `account_stages`, `account_tiers`, `accounts`, `actions`, `cadence_mDiffed against: <https://developers.salesloft.com/docs/api/opportunities-index/>- [x] `opportunities` — core revenue object synced from the CRM; currently no way to tie cadence activity to pipeline (high)-- [ ] `opportunity_stages` — lookup resolving the stage id on every opportunity (high)+- [x] `opportunity_stages` — lookup resolving the stage id on every opportunity (high)- [x] `tasks` — the rep work queue — completion rates are a primary Salesloft metric (high)- [x] `activity_histories` — unified transition/activity timeline across people and accounts (high)- [x] `cadence_stats` — the vendor's headline cadence performance metric (opens, replies, conversions) (high)-- [ ] `tags` — lookup resolving tag ids attached to people, accounts and cadences (medium)-- [ ] `account_types` — lookup resolving the account_type id already carried on accounts (medium)-- [ ] `opportunity_people` — join table linking people to opportunities (medium)+- [x] `tags` — lookup resolving tag ids attached to people, accounts and cadences (medium)+- [ ] `account_types` — lookup resolving the account_type id already carried on accounts (medium); skipped: `GET /v2/account_types` returns only the distinct account type names for filter pickers, with no id, no pagination and results limited to the caller's readable accounts. Accounts carry the type as a plain string (`company_type`), so there is no id to resolve and the values are derivable from the `accounts` table+- [x] `opportunity_people` — join table linking people to opportunities (medium)- [ ] `calendar_events` — booked meetings and their outcomes beyond the meetings table (medium)- [ ] `conversations / conversations_calls` — conversation intelligence records for call analysis (medium)- [ ] `transcriptions` — call transcripts, the input for talk-track analysis (medium)diff --git a/products/warehouse_sources/sources/salesloft/canonical_descriptions.py b/products/warehouse_sources/sources/salesloft/canonical_descriptions.pyindex e2dab88a7a9e..c2222f9469cf 100644--- a/products/warehouse_sources/sources/salesloft/canonical_descriptions.py+++ b/products/warehouse_sources/sources/salesloft/canonical_descriptions.py@@ -313,6 +313,27 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {tags="Tags applied to the opportunity.",),},+ "opportunity_people": {+ "description": "A link between a person and an opportunity, such as a CRM opportunity contact role.",+ "docs_url": "https://developers.salesloft.com/docs/api/opportunity-people-index",+ "columns": _columns(+ person_id="Identifier of the Salesloft person.",+ opportunity_id="Identifier of the Salesloft opportunity.",+ opportunity_crm_id="Identifier of the opportunity in the CRM.",+ person_crm_id="Identifier of the person in the CRM.",+ crm_id="Identifier of the association object in the CRM, such as the opportunity contact role.",+ is_primary="Whether the person is the primary contact for the opportunity in the CRM.",+ ),+ },+ "opportunity_stages": {+ "description": "A stage that an opportunity can be in.",+ "docs_url": "https://developers.salesloft.com/docs/api/opportunity-stages-index",+ "columns": _columns(+ name="Name of the opportunity stage.",+ order="Sort order of the stage.",+ active="Whether the opportunity stage is active.",+ ),+ },"people": {"description": "An individual contact tracked in Salesloft.","docs_url": "https://developers.salesloft.com/docs/api/people-index",@@ -389,6 +410,14 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {completed_by="The user who completed the task.",),},+ "tags": {+ "description": "A tag that can be applied to people, accounts, cadences and other records.",+ "docs_url": "https://developers.salesloft.com/docs/api/tags-index",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "Name of the tag.",+ },+ },"team_templates": {"description": "An email template shared and managed at the team level.","docs_url": "https://developers.salesloft.com/docs/api/team-templates-index",diff --git a/products/warehouse_sources/sources/salesloft/settings.py b/products/warehouse_sources/sources/salesloft/settings.pyindex f8638eb148cb..ca668a71dc4f 100644--- a/products/warehouse_sources/sources/salesloft/settings.py+++ b/products/warehouse_sources/sources/salesloft/settings.py@@ -73,6 +73,8 @@ SALESLOFT_ENDPOINTS: dict[str, SalesloftEndpointConfig] = {"email_templates": _incremental("email_templates", "/email_templates"),"notes": _incremental("notes", "/notes"),"opportunities": _incremental("opportunities", "/opportunities", sort_by="updated_at"),+ "opportunity_people": _incremental("opportunity_people", "/opportunity_people"),+ "opportunity_stages": _incremental("opportunity_stages", "/opportunity_stages"),"people": _incremental("people", "/people"),"successes": _incremental("successes", "/successes"),"tasks": _incremental("tasks", "/tasks", sort_by="updated_at"),@@ -94,6 +96,7 @@ SALESLOFT_ENDPOINTS: dict[str, SalesloftEndpointConfig] = {"phone_number_assignments", "/phone_number_assignments", partition_key=None),"steps": _full_refresh("steps", "/steps"),+ "tags": _full_refresh("tags", "/tags", partition_key=None),"team_template_attachments": _full_refresh("team_template_attachments", "/team_template_attachments", partition_key=None),diff --git a/products/warehouse_sources/sources/salesloft/tests/test_salesloft.py b/products/warehouse_sources/sources/salesloft/tests/test_salesloft.pyindex 8619305fdc5e..022c0d3d4aac 100644--- a/products/warehouse_sources/sources/salesloft/tests/test_salesloft.py+++ b/products/warehouse_sources/sources/salesloft/tests/test_salesloft.py@@ -71,6 +71,8 @@ class TestIncrementalRequestShaping:("opportunities", "updated_at"),# Endpoints whose default sort key is already updated_at send no sort_by.("people", None),+ ("opportunity_stages", None),+ ("opportunity_people", None),],)def test_incremental_run_sorts_and_filters_on_updated_at(self, endpoint: str, expected_sort_by: str | None) -> None: