: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(exports): add activity logging for data exports (#63971)
Yasen91abe10dbb18
diff --git a/frontend/src/lib/components/ActivityLog/describers.tsx b/frontend/src/lib/components/ActivityLog/describers.tsxindex 55ab22bb8dc7..f612efb879a8 100644--- a/frontend/src/lib/components/ActivityLog/describers.tsx+++ b/frontend/src/lib/components/ActivityLog/describers.tsx@@ -14,6 +14,7 @@ import { batchExportActivityDescriber } from 'scenes/data-pipelines/batch-exportimport { batchImportActivityDescriber } from 'scenes/data-pipelines/batch-imports/activityDescriptions'import { dataWarehouseSavedQueryActivityDescriber } from 'scenes/data-warehouse/saved_queries/activityDescriptions'import { experimentActivityDescriber } from 'scenes/experiments/experimentActivityDescriber'+import { exportedAssetActivityDescriber } from 'scenes/exports/activityDescriptions'import { flagActivityDescriber } from 'scenes/feature-flags/activityDescriptions'import { groupActivityDescriber } from 'scenes/groups/activityDescriptions'import { hogFunctionActivityDescriber } from 'scenes/hog-functions/misc/activityDescriptions'@@ -55,6 +56,8 @@ export const describerFor = (logItem?: ActivityLogItem): Describer | undefined =return batchExportActivityDescribercase ActivityScope.BATCH_IMPORT:return batchImportActivityDescriber+ case ActivityScope.EXPORTED_ASSET:+ return exportedAssetActivityDescribercase ActivityScope.DASHBOARD:return dashboardActivityDescribercase ActivityScope.FEATURE_FLAG:diff --git a/frontend/src/scenes/exports/activityDescriptions.test.tsx b/frontend/src/scenes/exports/activityDescriptions.test.tsxnew file mode 100644index 000000000000..68c8933e8777--- /dev/null+++ b/frontend/src/scenes/exports/activityDescriptions.test.tsx@@ -0,0 +1,83 @@+import { render } from '@testing-library/react'++import { ActivityLogDetail, ActivityLogItem } from 'lib/components/ActivityLog/humanizeActivity'++import { initKeaTests } from '~/test/init'+import { ActivityScope } from '~/types'++import { exportedAssetActivityDescriber } from './activityDescriptions'++function makeDetail(name: string | null, exportFormat?: string): ActivityLogDetail {+ return {+ merge: null,+ trigger: null,+ name,+ changes: exportFormat+ ? [{ type: ActivityScope.EXPORTED_ASSET, action: 'exported', field: 'export_format', after: exportFormat }]+ : [],+ }+}++function makeLogItem(overrides: Partial<ActivityLogItem> & { detail: ActivityLogItem['detail'] }): ActivityLogItem {+ return {+ user: { first_name: 'Max', last_name: 'Hog', email: '[email protected]' },+ activity: 'exported',+ created_at: '2026-03-01T00:00:00Z',+ scope: ActivityScope.EXPORTED_ASSET,+ item_id: 'abc-123',+ ...overrides,+ }+}++function describeText(logItem: ActivityLogItem, asNotification?: boolean): string {+ const { description } = exportedAssetActivityDescriber(logItem, asNotification)+ if (!description) {+ return ''+ }+ const { container } = render(<>{description}</>)+ return container.textContent ?? ''+}++describe('exported asset activity descriptions', () => {+ beforeEach(() => {+ // The describer returns JSX containing <Link> components which rely on kea-router+ initKeaTests()+ })++ it('describes a dashboard export with its format', () => {+ const text = describeText(makeLogItem({ detail: makeDetail('Weekly metrics', 'image/png') }))+ expect(text).toBe('Max Hog exported Weekly metrics as a png')+ })++ it('describes a SQL query export', () => {+ const text = describeText(makeLogItem({ detail: makeDetail('SQL query results', 'text/csv') }))+ expect(text).toBe('Max Hog exported SQL query results as a csv')+ })++ it('prefixes with "your" when rendered as a notification', () => {+ const text = describeText(makeLogItem({ detail: makeDetail('Weekly metrics', 'image/png') }), true)+ expect(text).toBe('Max Hog exported your Weekly metrics as a png')+ })++ it('falls back gracefully when name and format are missing', () => {+ const text = describeText(makeLogItem({ detail: makeDetail(null) }))+ expect(text).toBe('Max Hog exported an export as an export')+ })++ it('uses the raw format when it has no slash', () => {+ const text = describeText(makeLogItem({ detail: makeDetail('an export', 'csv') }))+ expect(text).toBe('Max Hog exported an export as a csv')+ })++ it('returns no description for a non-export scope', () => {+ const { description } = exportedAssetActivityDescriber(+ makeLogItem({ scope: ActivityScope.INSIGHT, detail: makeDetail('x') })+ )+ expect(description).toBeNull()+ })++ it('delegates unknown activities to the default describer', () => {+ const text = describeText(makeLogItem({ activity: 'deleted', detail: makeDetail('Weekly metrics') }))+ expect(text).not.toContain('exported')+ })+})diff --git a/frontend/src/scenes/exports/activityDescriptions.tsx b/frontend/src/scenes/exports/activityDescriptions.tsxnew file mode 100644index 000000000000..ea9609f11909--- /dev/null+++ b/frontend/src/scenes/exports/activityDescriptions.tsx@@ -0,0 +1,35 @@+import {+ ActivityLogItem,+ HumanizedChange,+ defaultDescriber,+ userNameForLogItem,+} from 'lib/components/ActivityLog/humanizeActivity'+import { Link } from 'lib/lemon-ui/Link'+import { urls } from 'scenes/urls'++export function exportedAssetActivityDescriber(logItem: ActivityLogItem, asNotification?: boolean): HumanizedChange {+ if (logItem.scope !== 'ExportedAsset') {+ console.error('exported asset describer received a non-export activity')+ return { description: null }+ }++ if (logItem.activity === 'exported') {+ const exportFormat = logItem.detail.changes?.[0]?.after+ let formatLabel = 'an export'+ if (typeof exportFormat === 'string') {+ formatLabel = `a ${exportFormat.split('/')[1] || exportFormat}`+ }++ return {+ description: (+ <>+ <strong className="ph-no-capture">{userNameForLogItem(logItem)}</strong> exported{' '}+ {asNotification ? 'your ' : ''}+ <Link to={urls.exports()}>{logItem.detail.name || 'an export'}</Link> as {formatLabel}+ </>+ ),+ }+ }++ return defaultDescriber(logItem, asNotification)+}diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 40e70dcbe6db..f2ab82e143c8 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -5725,6 +5725,7 @@ export enum ActivityScope {ANNOTATION = 'Annotation',BATCH_EXPORT = 'BatchExport',BATCH_IMPORT = 'BatchImport',+ EXPORTED_ASSET = 'ExportedAsset',FEATURE_FLAG = 'FeatureFlag',PERSON = 'Person',PERSONAL_API_KEY = 'PersonalAPIKey',diff --git a/posthog/models/activity_logging/activity_log.py b/posthog/models/activity_logging/activity_log.pyindex 36adf013ecf6..e0cc6bcd8317 100644--- a/posthog/models/activity_logging/activity_log.py+++ b/posthog/models/activity_logging/activity_log.py@@ -62,6 +62,7 @@ ActivityScope = Literal["UserGroup","BatchExport","BatchImport",+ "ExportedAsset","Integration","Annotation","Tag",diff --git a/products/exports/backend/api/exports.py b/products/exports/backend/api/exports.pyindex 92cf3c3a6954..cd6e8de3be5f 100644--- a/products/exports/backend/api/exports.py+++ b/products/exports/backend/api/exports.py@@ -280,7 +280,7 @@ class ExportedAssetSerializer(serializers.ModelSerializer):instance.refresh_from_db()insight_id = instance.insight_iddashboard_id = instance.dashboard_id- if insight_id and not dashboard_id: # we don't log dashboard activity ¯\_(ツ)_/¯+ if insight_id and not dashboard_id: # logged against the insight's own activity historytry:# nosemgrep: idor-lookup-without-team (insight_id validated as team-owned in validate())insight: Insight = Insight.objects.select_related("team__organization").get(id=insight_id)@@ -314,8 +314,63 @@ class ExportedAssetSerializer(serializers.ModelSerializer):insight_id=insight_id,)pass+ elif user is not None:+ # Dashboard, session recording, heatmap and SQL/HogQL query exports aren't tied to a+ # single insight's history, so they go under a dedicated ExportedAsset scope — making+ # every data export auditable. Insight-only exports are logged above (Insight scope) and+ # never reach here, so we never write two activity rows for one export. System/synthetic+ # exports (user is None, e.g. open-graph image renders) are intentionally not logged.+ self._log_exported_asset_activity(instance, user)return instance+ def _log_exported_asset_activity(self, instance: ExportedAsset, user: User) -> None:+ log_activity(+ organization_id=instance.team.organization_id,+ team_id=instance.team_id,+ user=user,+ was_impersonated=is_impersonated_session(self.context["request"]) if "request" in self.context else False,+ item_id=instance.id,+ scope="ExportedAsset",+ activity="exported",+ detail=Detail(+ name=self._describe_exported_asset(instance),+ type=instance.export_type,+ changes=[+ Change(+ type="ExportedAsset",+ action="exported",+ field="export_format",+ after=instance.export_format,+ )+ ],+ ),+ )++ @staticmethod+ def _describe_exported_asset(instance: ExportedAsset) -> str:+ """Human-readable name of what was exported, for the activity log entry."""+ context = instance.export_context or {}+ export_type = instance.export_type+ if export_type == "dashboard":+ return instance.dashboard.name if instance.dashboard and instance.dashboard.name else "a dashboard"+ if export_type == "insight":+ # Reachable only when an insight export is also tied to a dashboard (the insight-only+ # path is logged under the Insight scope above); name it after the insight either way.+ if instance.insight:+ return instance.insight.name or instance.insight.derived_name or "an insight"+ return "an insight"+ if export_type == "recording":+ session_recording_id = context.get("session_recording_id")+ return f"session recording {session_recording_id}" if session_recording_id else "a session recording"+ if export_type == "heatmap":+ heatmap_url = context.get("heatmap_url")+ return f"heatmap {heatmap_url}" if heatmap_url else "a heatmap"+ if context.get("source"):+ return "SQL query results"+ if context.get("filename"):+ return str(context["filename"])+ return "an export"+def _start_export_workflow(self, instance: ExportedAsset, team: Team, user: User | None, force_async: bool = False) -> None:diff --git a/products/exports/backend/api/test/test_exports.py b/products/exports/backend/api/test/test_exports.pyindex 466f5c8793e7..43e0404c02a7 100644--- a/products/exports/backend/api/test/test_exports.py+++ b/products/exports/backend/api/test/test_exports.py@@ -20,6 +20,7 @@ from rest_framework import statusfrom posthog.hogql.errors import QueryErrorfrom posthog.errors import CHQueryErrorTooManySimultaneousQueries+from posthog.models.activity_logging.activity_log import ActivityLogfrom posthog.models.filters.filter import Filterfrom posthog.models.team import Teamfrom posthog.models.user import User@@ -268,6 +269,64 @@ class TestExports(APIBaseTest):mock_calculate.assert_called_once()+ @patch("products.exports.backend.api.exports.ExportedAssetSerializer._start_export_workflow")+ def test_logs_exported_asset_activity_for_sql_export(self, _mock_exporter_task) -> None:+ response = self.client.post(+ f"/api/projects/{self.team.id}/exports",+ {+ "export_format": "text/csv",+ "export_context": {"source": {"kind": "HogQLQuery", "query": "select 1"}},+ },+ format="json",+ )+ self.assertEqual(response.status_code, status.HTTP_201_CREATED)+ asset_id = response.json()["id"]++ logs = ActivityLog.objects.filter(scope="ExportedAsset", item_id=str(asset_id))+ self.assertEqual(logs.count(), 1)+ log = logs.first()+ assert log is not None+ assert log.detail is not None+ self.assertEqual(log.activity, "exported")+ self.assertEqual(log.team_id, self.team.id)+ self.assertEqual(log.user_id, self.user.id)+ self.assertEqual(log.detail["name"], "SQL query results")+ self.assertEqual(log.detail["changes"][0]["after"], "text/csv")++ @patch("products.exports.backend.api.exports.ExportedAssetSerializer._start_export_workflow")+ def test_logs_exported_asset_activity_for_dashboard_export(self, _mock_exporter_task) -> None:+ response = self.client.post(+ f"/api/projects/{self.team.id}/exports",+ {"export_format": "image/png", "dashboard": self.dashboard.id},+ )+ self.assertEqual(response.status_code, status.HTTP_201_CREATED)+ asset_id = response.json()["id"]++ logs = ActivityLog.objects.filter(scope="ExportedAsset", item_id=str(asset_id))+ self.assertEqual(logs.count(), 1)+ log = logs.first()+ assert log is not None+ assert log.detail is not None+ self.assertEqual(log.detail["name"], self.dashboard.name)++ @patch("products.exports.backend.tasks.image_exporter._export_to_png")+ @patch("products.exports.backend.api.exports.ExportedAssetSerializer._start_export_workflow")+ def test_insight_export_does_not_create_duplicate_exported_asset_activity(+ self, _mock_exporter_task, _mock_export_to_png+ ) -> None:+ response = self.client.post(+ f"/api/projects/{self.team.id}/exports",+ {"export_format": "image/png", "insight": self.insight.id},+ )+ self.assertEqual(response.status_code, status.HTTP_201_CREATED)+ asset_id = response.json()["id"]++ # Insight exports are recorded once under the Insight scope, never duplicated under ExportedAsset.+ self.assertFalse(ActivityLog.objects.filter(scope="ExportedAsset", item_id=str(asset_id)).exists())+ self.assertTrue(+ ActivityLog.objects.filter(scope="Insight", item_id=str(self.insight.id), activity="exported").exists()+ )+def test_errors_if_missing_related_instance(self) -> None:response = self.client.post(f"/api/projects/{self.team.id}/exports", {"export_format": "image/png"})self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)diff --git a/products/platform_features/frontend/generated/api.schemas.ts b/products/platform_features/frontend/generated/api.schemas.tsindex c57d4b3e2173..90d4dac63b76 100644--- a/products/platform_features/frontend/generated/api.schemas.ts+++ b/products/platform_features/frontend/generated/api.schemas.ts@@ -961,6 +961,7 @@ export type ActivityLogListParams = {* * `UserGroup` - UserGroup* * `BatchExport` - BatchExport* * `BatchImport` - BatchImport+ * * `ExportedAsset` - ExportedAsset* * `Integration` - Integration* * `Annotation` - Annotation* * `Tag` - Tag@@ -1040,6 +1041,7 @@ export const ActivityLogListScope = {UserGroup: 'UserGroup',BatchExport: 'BatchExport',BatchImport: 'BatchImport',+ ExportedAsset: 'ExportedAsset',Integration: 'Integration',Annotation: 'Annotation',Tag: 'Tag',@@ -1106,6 +1108,7 @@ export const ActivityLogListScope = {* * `UserGroup` - UserGroup* * `BatchExport` - BatchExport* * `BatchImport` - BatchImport+ * * `ExportedAsset` - ExportedAsset* * `Integration` - Integration* * `Annotation` - Annotation* * `Tag` - Tag@@ -1173,6 +1176,7 @@ export const ActivityLogListScopesItem = {UserGroup: 'UserGroup',BatchExport: 'BatchExport',BatchImport: 'BatchImport',+ ExportedAsset: 'ExportedAsset',Integration: 'Integration',Annotation: 'Annotation',Tag: 'Tag',diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 1a48fe02e2d7..0a8e924b8d10 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -54282,6 +54282,7 @@ export namespace Schemas {* * `UserGroup` - UserGroup* * `BatchExport` - BatchExport* * `BatchImport` - BatchImport+ * * `ExportedAsset` - ExportedAsset* * `Integration` - Integration* * `Annotation` - Annotation* * `Tag` - Tag@@ -54362,6 +54363,7 @@ export namespace Schemas {UserGroup: 'UserGroup',BatchExport: 'BatchExport',BatchImport: 'BatchImport',+ ExportedAsset: 'ExportedAsset',Integration: 'Integration',Annotation: 'Annotation',Tag: 'Tag',@@ -54428,6 +54430,7 @@ export namespace Schemas {* * `UserGroup` - UserGroup* * `BatchExport` - BatchExport* * `BatchImport` - BatchImport+ * * `ExportedAsset` - ExportedAsset* * `Integration` - Integration* * `Annotation` - Annotation* * `Tag` - Tag@@ -54496,6 +54499,7 @@ export namespace Schemas {UserGroup: 'UserGroup',BatchExport: 'BatchExport',BatchImport: 'BatchImport',+ ExportedAsset: 'ExportedAsset',Integration: 'Integration',Annotation: 'Annotation',Tag: 'Tag',diff --git a/services/mcp/src/generated/platform_features/api.ts b/services/mcp/src/generated/platform_features/api.tsindex 1a819d4a8b59..1699aa88df5c 100644--- a/services/mcp/src/generated/platform_features/api.ts+++ b/services/mcp/src/generated/platform_features/api.ts@@ -137,6 +137,7 @@ export const ActivityLogListQueryParams = /* @__PURE__ */ zod.object({'UserGroup','BatchExport','BatchImport',+ 'ExportedAsset','Integration','Annotation','Tag',@@ -167,7 +168,7 @@ export const ActivityLogListQueryParams = /* @__PURE__ */ zod.object({]).optional().describe(- 'Filter by a single activity scope, e.g. "FeatureFlag", "Insight", "Dashboard", "Experiment".\n\n* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig'+ 'Filter by a single activity scope, e.g. "FeatureFlag", "Insight", "Dashboard", "Experiment".\n\n* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `ExportedAsset` - ExportedAsset\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig'),scopes: zod.array(@@ -209,6 +210,7 @@ export const ActivityLogListQueryParams = /* @__PURE__ */ zod.object({'UserGroup','BatchExport','BatchImport',+ 'ExportedAsset','Integration','Annotation','Tag',@@ -238,7 +240,7 @@ export const ActivityLogListQueryParams = /* @__PURE__ */ zod.object({'SignalScoutConfig',]).describe(- '* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig'+ '* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `ExportedAsset` - ExportedAsset\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig')).optional()diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/activity-log-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/activity-log-list.jsonindex b100d59e6469..e3715ff69352 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/activity-log-list.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/activity-log-list.json@@ -19,7 +19,7 @@"type": "number"},"scope": {- "description": "Filter by a single activity scope, e.g. \"FeatureFlag\", \"Insight\", \"Dashboard\", \"Experiment\".\n\n* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig",+ "description": "Filter by a single activity scope, e.g. \"FeatureFlag\", \"Insight\", \"Dashboard\", \"Experiment\".\n\n* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `ExportedAsset` - ExportedAsset\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig","enum": ["Cohort","FeatureFlag",@@ -57,6 +57,7 @@"UserGroup","BatchExport","BatchImport",+ "ExportedAsset","Integration","Annotation","Tag",@@ -90,7 +91,7 @@"scopes": {"description": "Filter by multiple activity scopes, comma-separated. Values must be valid ActivityScope enum values. E.g. \"FeatureFlag,Insight\".","items": {- "description": "* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig",+ "description": "* `Cohort` - Cohort\n* `FeatureFlag` - FeatureFlag\n* `Person` - Person\n* `Group` - Group\n* `Insight` - Insight\n* `Plugin` - Plugin\n* `PluginConfig` - PluginConfig\n* `HogFunction` - HogFunction\n* `HogFlow` - HogFlow\n* `DataManagement` - DataManagement\n* `EventDefinition` - EventDefinition\n* `PropertyDefinition` - PropertyDefinition\n* `Notebook` - Notebook\n* `Endpoint` - Endpoint\n* `EndpointVersion` - EndpointVersion\n* `Dashboard` - Dashboard\n* `Replay` - Replay\n* `Experiment` - Experiment\n* `ExperimentHoldout` - ExperimentHoldout\n* `ExperimentSavedMetric` - ExperimentSavedMetric\n* `Survey` - Survey\n* `EarlyAccessFeature` - EarlyAccessFeature\n* `SessionRecordingPlaylist` - SessionRecordingPlaylist\n* `Comment` - Comment\n* `Team` - Team\n* `Project` - Project\n* `ErrorTrackingIssue` - ErrorTrackingIssue\n* `DataWarehouseSavedQuery` - DataWarehouseSavedQuery\n* `LegalDocument` - LegalDocument\n* `Organization` - Organization\n* `OrganizationDomain` - OrganizationDomain\n* `OrganizationMembership` - OrganizationMembership\n* `Role` - Role\n* `UserGroup` - UserGroup\n* `BatchExport` - BatchExport\n* `BatchImport` - BatchImport\n* `ExportedAsset` - ExportedAsset\n* `Integration` - Integration\n* `Annotation` - Annotation\n* `Tag` - Tag\n* `TaggedItem` - TaggedItem\n* `Subscription` - Subscription\n* `PersonalAPIKey` - PersonalAPIKey\n* `ProjectSecretAPIKey` - ProjectSecretAPIKey\n* `OAuthApplication` - OAuthApplication\n* `User` - User\n* `Action` - Action\n* `AlertConfiguration` - AlertConfiguration\n* `Threshold` - Threshold\n* `AlertSubscription` - AlertSubscription\n* `ExternalDataSource` - ExternalDataSource\n* `ExternalDataSchema` - ExternalDataSchema\n* `Evaluation` - Evaluation\n* `LLMTrace` - LLMTrace\n* `WebAnalyticsFilterPreset` - WebAnalyticsFilterPreset\n* `CustomerProfileConfig` - CustomerProfileConfig\n* `Log` - Log\n* `LogsAlertConfiguration` - LogsAlertConfiguration\n* `LogsExclusionRule` - LogsExclusionRule\n* `DashboardWidget` - DashboardWidget\n* `ProductTour` - ProductTour\n* `Ticket` - Ticket\n* `InstanceSetting` - InstanceSetting\n* `SignalScoutConfig` - SignalScoutConfig","enum": ["Cohort","FeatureFlag",@@ -128,6 +129,7 @@"UserGroup","BatchExport","BatchImport",+ "ExportedAsset","Integration","Annotation","Tag",