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(dashboards): let mcp set dashboard breakdown and other filter overrides (#123832)

Sam Pennington00e64f8d26e0
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 68f70402989a..059614260606 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -652,6 +652,9 @@ SPECTACULAR_SETTINGS = {
# Matches the shared alerts skeleton's PlatformAlert.State.
"BillingAlertConfigurationStateEnum": "products.billing_alerts.backend.models.BillingAlertConfiguration.State",
"LogsPatternsSourceEnum": ["stored_patterns", "body_mining"],
+ # Dashboard filters and data catalog metric runs both take the query schema's IntervalType,
+ # a plain enum no class can carry.
+ "IntervalTypeEnum": ["second", "minute", "hour", "day", "week", "month", "quarter", "year"],
# The anomaly and explain bodies keep this name; the metrics query clause's own
# aggregation adds 'none' and is named by its MetricQueryAggregation class.
"AggregationEnum": ["sum", "avg", "count", "min", "max", "p95", "rate", "increase", "histogram_quantile"],
diff --git a/products/dashboards/backend/api/test/test_dashboard_openapi.py b/products/dashboards/backend/api/test/test_dashboard_openapi.py
index 01d8432c6b6a..829dd270ffff 100644
--- a/products/dashboards/backend/api/test/test_dashboard_openapi.py
+++ b/products/dashboards/backend/api/test/test_dashboard_openapi.py
@@ -1,11 +1,22 @@
from drf_spectacular.generators import SchemaGenerator
from rest_framework import serializers
+from posthog.schema import DashboardFilter
+
from products.dashboards.backend.api.test.dashboard_openapi_test_helpers import (
dashboard_patch_runtime_openapi_field_names,
)
from products.dashboards.backend.widget_specs.openapi import PatchedDashboardOpenApiSerializer
+# DashboardFilter keys that agents do not set through the dashboard-update MCP tool.
+DASHBOARD_FILTERS_OPENAPI_EXCLUDED_FIELDS: frozenset[str] = frozenset(
+ {
+ "explicitDate", # date picker display flag, not a filter
+ "metricFilters", # metrics tiles only
+ "metricVariables", # metrics tiles only
+ }
+)
+
def _patched_dashboard_openapi_component_properties(schema: dict) -> frozenset[str]:
for component in schema.get("components", {}).get("schemas", {}).values():
@@ -100,6 +111,9 @@ class TestDashboardPatchOpenApiContract:
filters_field = openapi_fields["filters"]
assert isinstance(filters_field, serializers.Serializer)
filters_fields = frozenset(filters_field.fields.keys())
- assert {"date_from", "date_to", "properties"}.issubset(filters_fields), (
- f"Dashboard filters schema must expose date_from/date_to/properties. Got: {sorted(filters_fields)}."
+ missing = frozenset(DashboardFilter.model_fields) - DASHBOARD_FILTERS_OPENAPI_EXCLUDED_FIELDS - filters_fields
+ assert not missing, (
+ "The MCP schema strips filter keys it does not declare, so an undocumented DashboardFilter key is "
+ f"silently dropped. Missing: {sorted(missing)}. Add it to DashboardFiltersOpenApiSerializer or to "
+ "DASHBOARD_FILTERS_OPENAPI_EXCLUDED_FIELDS with a reason."
)
diff --git a/products/dashboards/backend/widget_specs/openapi.py b/products/dashboards/backend/widget_specs/openapi.py
index 1a07bb29e24e..ef80f53d4c96 100644
--- a/products/dashboards/backend/widget_specs/openapi.py
+++ b/products/dashboards/backend/widget_specs/openapi.py
@@ -8,6 +8,8 @@ from drf_spectacular.utils import PolymorphicProxySerializer, extend_schema_fiel
from pydantic import BaseModel
from rest_framework import serializers
+from posthog.schema import BreakdownFilter, CompareFilter, IntervalType
+
from products.dashboards.backend.constants import (
DASHBOARD_GRID_COLUMN_COUNT,
MAX_GROUP_KEY_LENGTH,
@@ -378,6 +380,16 @@ class DashboardPatchTileOpenApiSerializer(serializers.Serializer):
widget = DashboardPatchWidgetOpenApiSerializer(required=False, help_text="Nested widget row updates.")
+@extend_schema_field(BreakdownFilter) # type: ignore[arg-type]
+class DashboardBreakdownFilterField(serializers.JSONField):
+ pass
+
+
+@extend_schema_field(CompareFilter) # type: ignore[arg-type]
+class DashboardCompareFilterField(serializers.JSONField):
+ pass
+
+
class DashboardFiltersOpenApiSerializer(serializers.Serializer):
"""OpenAPI-only shape for a dashboard's filters object (agents/MCP).
@@ -400,6 +412,31 @@ class DashboardFiltersOpenApiSerializer(serializers.Serializer):
required=False,
help_text="Dashboard-level property filters applied to every tile (PostHog property filter group).",
)
+ breakdown_filter = DashboardBreakdownFilterField(
+ required=False,
+ allow_null=True,
+ help_text=(
+ "Dashboard-level breakdown applied to every tile that supports one, replacing the tile's own breakdown. "
+ 'Example: {"breakdown_type": "event", "breakdown": "$browser"}. Null clears it.'
+ ),
+ )
+ # nosemgrep: choices-need-a-class -- generated query schema enum, ENUM_NAME_OVERRIDES pins IntervalTypeEnum
+ interval = serializers.ChoiceField(
+ choices=[interval.value for interval in IntervalType],
+ required=False,
+ allow_null=True,
+ help_text="Time granularity forced onto every tile that supports one. Null means each tile keeps its own.",
+ )
+ compareFilter = DashboardCompareFilterField(
+ required=False,
+ allow_null=True,
+ help_text="Period comparison forced onto every tile that supports one. Null means each tile keeps its own.",
+ )
+ filterTestAccounts = serializers.BooleanField(
+ required=False,
+ allow_null=True,
+ help_text="True forces test accounts out of every tile, false forces them in, null keeps each tile's setting.",
+ )
class BreakdownColorConfigSerializer(serializers.Serializer):
@@ -463,7 +500,7 @@ class PatchedDashboardOpenApiSerializer(serializers.Serializer):
pinned = serializers.BooleanField(required=False)
filters = DashboardFiltersOpenApiSerializer(
required=False,
- help_text="Dashboard-level filters (date range and properties) applied across all tiles as the source of truth.",
+ help_text="Dashboard-level filters (date range, properties, breakdown, interval, comparison) applied across all tiles as the source of truth.",
)
breakdown_colors = serializers.ListField(
child=BreakdownColorConfigSerializer(),
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 84d3f9f2f236..f628e58169f6 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -587,6 +587,88 @@ export type PatchedPatchedDashboardOpenApiApiGroups = { [key: string]: Dashboard
*/
export type PatchedPatchedDashboardOpenApiApiGroupTitles = { [key: string]: string } | null
+export type BreakdownTypeApi = (typeof BreakdownTypeApi)[keyof typeof BreakdownTypeApi]
+
+export const BreakdownTypeApi = {
+ Cohort: 'cohort',
+ Person: 'person',
+ Event: 'event',
+ EventMetadata: 'event_metadata',
+ Element: 'element',
+ Group: 'group',
+ Session: 'session',
+ Hogql: 'hogql',
+ DataWarehouse: 'data_warehouse',
+ DataWarehousePersonProperty: 'data_warehouse_person_property',
+ RevenueAnalytics: 'revenue_analytics',
+} as const
+
+export type MultipleBreakdownTypeApi = (typeof MultipleBreakdownTypeApi)[keyof typeof MultipleBreakdownTypeApi]
+
+export const MultipleBreakdownTypeApi = {
+ Person: 'person',
+ Event: 'event',
+ EventMetadata: 'event_metadata',
+ Element: 'element',
+ Group: 'group',
+ Session: 'session',
+ Hogql: 'hogql',
+ Cohort: 'cohort',
+ RevenueAnalytics: 'revenue_analytics',
+ DataWarehouse: 'data_warehouse',
+ DataWarehousePersonProperty: 'data_warehouse_person_property',
+} as const
+
+export interface BreakdownApi {
+ group_type_index?: number | null
+ histogram_bin_count?: number | null
+ normalize_url?: boolean | null
+ property: string | number
+ type?: MultipleBreakdownTypeApi | null
+}
+
+export interface BreakdownFilterApi {
+ breakdown?: string | (string | number)[] | number | null
+ breakdown_group_type_index?: number | null
+ breakdown_hide_other_aggregation?: boolean | null
+ breakdown_histogram_bin_count?: number | null
+ breakdown_limit?: number | null
+ breakdown_normalize_url?: boolean | null
+ breakdown_path_cleaning?: boolean | null
+ breakdown_type?: BreakdownTypeApi | null
+ breakdowns?: BreakdownApi[] | null
+}
+
+/**
+ * * `second` - second
+ * * `minute` - minute
+ * * `hour` - hour
+ * * `day` - day
+ * * `week` - week
+ * * `month` - month
+ * * `quarter` - quarter
+ * * `year` - year
+ */
+export type IntervalTypeEnumApi = (typeof IntervalTypeEnumApi)[keyof typeof IntervalTypeEnumApi]
+
+export const IntervalTypeEnumApi = {
+ Second: 'second',
+ Minute: 'minute',
+ Hour: 'hour',
+ Day: 'day',
+ Week: 'week',
+ Month: 'month',
+ Quarter: 'quarter',
+ Year: 'year',
+} as const
+
+export interface CompareFilterApi {
+ /** Whether to compare the current date range to a previous date range. */
+ compare?: boolean | null
+ /** The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago. */
+ compare_to?: string | null
+}
+
/**
* OpenAPI-only shape for a dashboard's filters object (agents/MCP).
*
@@ -607,6 +689,26 @@ export interface DashboardFiltersOpenApiApi {
date_to?: string | null
/** Dashboard-level property filters applied to every tile (PostHog property filter group). */
properties?: unknown
+ /** Dashboard-level breakdown applied to every tile that supports one, replacing the tile's own breakdown. Example: {"breakdown_type": "event", "breakdown": "$browser"}. Null clears it. */
+ breakdown_filter?: BreakdownFilterApi | null
+ /** Time granularity forced onto every tile that supports one. Null means each tile keeps its own.
+ *
+ * * `second` - second
+ * * `minute` - minute
+ * * `hour` - hour
+ * * `day` - day
+ * * `week` - week
+ * * `month` - month
+ * * `quarter` - quarter
+ * * `year` - year */
+ interval?: IntervalTypeEnumApi | null
+ /** Period comparison forced onto every tile that supports one. Null means each tile keeps its own. */
+ compareFilter?: CompareFilterApi | null
+ /**
+ * True forces test accounts out of every tile, false forces them in, null keeps each tile's setting.
+ * @nullable
+ */
+ filterTestAccounts?: boolean | null
}
export interface _DashboardPatchTileLayoutBoxOpenApiApi {
@@ -1319,7 +1421,7 @@ export interface PatchedPatchedDashboardOpenApiApi {
name?: string | null
description?: string
pinned?: boolean
- /** Dashboard-level filters (date range and properties) applied across all tiles as the source of truth. */
+ /** Dashboard-level filters (date range, properties, breakdown, interval, comparison) applied across all tiles as the source of truth. */
filters?: DashboardFiltersOpenApiApi
/**
* Colors pinned to specific breakdown values across the dashboard's tiles. A list of entries, not an object keyed by breakdown value. Send an empty list to clear them.
@@ -1477,70 +1579,11 @@ export const InsightVizNodeApiKind = {
InsightVizNode: 'InsightVizNode',
} as const
-export type BreakdownTypeApi = (typeof BreakdownTypeApi)[keyof typeof BreakdownTypeApi]
-
-export const BreakdownTypeApi = {
- Cohort: 'cohort',
- Person: 'person',
- Event: 'event',
- EventMetadata: 'event_metadata',
- Element: 'element',
- Group: 'group',
- Session: 'session',
- Hogql: 'hogql',
- DataWarehouse: 'data_warehouse',
- DataWarehousePersonProperty: 'data_warehouse_person_property',
- RevenueAnalytics: 'revenue_analytics',
-} as const
-
-export type MultipleBreakdownTypeApi = (typeof MultipleBreakdownTypeApi)[keyof typeof MultipleBreakdownTypeApi]
-
-export const MultipleBreakdownTypeApi = {
- Person: 'person',
- Event: 'event',
- EventMetadata: 'event_metadata',
- Element: 'element',
- Group: 'group',
- Session: 'session',
- Hogql: 'hogql',
- Cohort: 'cohort',
- RevenueAnalytics: 'revenue_analytics',
- DataWarehouse: 'data_warehouse',
- DataWarehousePersonProperty: 'data_warehouse_person_property',
-} as const
-
-export interface BreakdownApi {
- group_type_index?: number | null
- histogram_bin_count?: number | null
- normalize_url?: boolean | null
- property: string | number
- type?: MultipleBreakdownTypeApi | null
-}
-
-export interface BreakdownFilterApi {
- breakdown?: string | (string | number)[] | number | null
- breakdown_group_type_index?: number | null
- breakdown_hide_other_aggregation?: boolean | null
- breakdown_histogram_bin_count?: number | null
- breakdown_limit?: number | null
- breakdown_normalize_url?: boolean | null
- breakdown_path_cleaning?: boolean | null
- breakdown_type?: BreakdownTypeApi | null
- breakdowns?: BreakdownApi[] | null
-}
-
export interface CalendarHeatmapFilterApi {
/** When true and the series math is `dau`/`unique_users`, each user contributes to the (day-of-week, hour) bucket of their session's first event only — matching the web overview session-start attribution. When false (default), the user contributes to every bucket they have any event in. No effect on `total` math (event counts are unchanged either way). */
bucketBySessionStart?: boolean | null
}
-export interface CompareFilterApi {
- /** Whether to compare the current date range to a previous date range. */
- compare?: boolean | null
- /** The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago. */
- compare_to?: string | null
-}
-
export interface EventPropertyFilterApi {
key: string
label?: string | null
diff --git a/products/dashboards/frontend/generated/api.zod.ts b/products/dashboards/frontend/generated/api.zod.ts
index 72c3e3c2d521..a2da5372f35e 100644
--- a/products/dashboards/frontend/generated/api.zod.ts
+++ b/products/dashboards/frontend/generated/api.zod.ts
@@ -655,1257 +655,9 @@ export const DashboardsUpdateBody = /* @__PURE__ */ zod
})
.describe('Serializer mixin that handles tags for objects.')
-export const dashboardsPartialUpdateBodyNameMax = 400
-
-export const dashboardsPartialUpdateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
-export const dashboardsPartialUpdateBodyGroupsTitleMax = 200
-
-export const dashboardsPartialUpdateBodyGroupTitlesMaxOne = 200
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMin = 0
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMax = 11
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneYMin = 0
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneWMax = 12
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneXMin = 0
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneXMax = 11
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneYMin = 0
-
-export const dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneWMax = 12
-
-export const dashboardsPartialUpdateBodyTilesItemGroupKeyMax = 100
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneNotebookShortIdOneMax = 128
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoLimitDefault = 25
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoLimitMax = 50
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemKeyMax = 400
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemLabelOneMax = 400
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueOneItemOneMax = 4000
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueOneMax = 100
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueTwoMax = 4000
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneMax = 20
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeLimitDefault = 10
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeLimitMax = 25
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeOrderByDefault = `occurrences`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeOrderDirectionDefault = `DESC`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeStatusDefault = `active`
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourLimitDefault = 10
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourLimitMax = 25
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourOrderByDefault = `start_time`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourOrderDirectionDefault = `DESC`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveLimitDefault = 10
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveLimitMax = 25
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveOrderByDefault = `created_at`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveOrderDirectionDefault = `DESC`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveStatusDefault = `all`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneSevenLimitDefault = 10
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneSevenLimitMax = 25
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightLimitDefault = 50
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightLimitMax = 100
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightOrderByDefault = `latest`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightWrapLinesDefault = false
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightTimezoneDefault = `UTC`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineLimitDefault = 10
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineLimitMax = 25
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineStatusDefault = `all`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineChannelDefault = `all`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineAssigneesMax = 100
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSearchDefault = ``
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSearchMax = 200
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSavedViewIdOneMax = 12
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneGroupByOneMax = 200
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemLabelMax = 40
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemMetricNameMax = 200
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemQuantileOneExclusiveMin = 0
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemQuantileOneExclusiveMax = 1
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemKeyMax = 200
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemOpDefault = `eq`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemValueMax = 400
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersMax = 5
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsMax = 6
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderByColumnDefault = 0
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderByColumnMin = 0
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderDirectionDefault = `DESC`
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneLimitDefault = 25
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneLimitMax = 100
-
-export const dashboardsPartialUpdateBodyTilesItemWidgetOneNameMax = 400
-
-export const dashboardsPartialUpdateBodyDeleteInsightsDefault = false
-
export const DashboardsPartialUpdateBody = /* @__PURE__ */ zod
- .object({
- name: zod.string().max(dashboardsPartialUpdateBodyNameMax).nullish(),
- description: zod.string().optional(),
- pinned: zod.boolean().optional(),
- filters: zod
- .object({
- date_from: zod
- .string()
- .nullish()
- .describe(
- "Dashboard-level start of the date range, e.g. '-30d', '-7d', or an ISO date. Applies to all tiles."
- ),
- date_to: zod
- .string()
- .nullish()
- .describe(
- "Dashboard-level end of the date range, e.g. '-1d' or an ISO date. Null\/omitted means up to now."
- ),
- properties: zod
- .unknown()
- .optional()
- .describe(
- 'Dashboard-level property filters applied to every tile (PostHog property filter group).'
- ),
- })
- .describe(
- "OpenAPI-only shape for a dashboard's filters object (agents\/MCP).\n\nDocuments the dashboard-level filters that act as the single source of truth for the\ndashboard's tiles. Runtime persistence reads the raw ``filters`` dict from the request body, so\nextra keys are accepted, but these are the ones agents should set."
- )
- .optional()
- .describe(
- 'Dashboard-level filters (date range and properties) applied across all tiles as the source of truth.'
- ),
- breakdown_colors: zod
- .array(
- zod.object({
- breakdownValue: zod
- .string()
- .describe('The breakdown value this color applies to, as it appears in the chart legend.'),
- colorToken: zod
- .string()
- .regex(dashboardsPartialUpdateBodyBreakdownColorsItemColorTokenRegExp)
- .nullable()
- .describe(
- 'Palette slot to color the value with, as `preset-1` upwards. Not a CSS color: a hex value is rejected. Null leaves the value on its default color.'
- ),
- breakdownType: zod
- .string()
- .nullish()
- .describe(
- 'Breakdown type the value came from, such as `event`, `person`, `session`, or `cohort`.'
- ),
- breakdownProperty: zod
- .string()
- .nullish()
- .describe(
- 'Breakdown property the color is scoped to, so the color applies only to tiles that break down by that property. Omit to apply it under every property.'
- ),
- source: zod
- .union([
- zod.enum(['auto', 'manual']).describe('\* `auto` - auto\n\* `manual` - manual'),
- zod.null(),
- ])
- .optional()
- .describe(
- '`manual` for a color a person picked, `auto` for one the dashboard assigned.\n\n\* `auto` - auto\n\* `manual` - manual'
- ),
- })
- )
- .nullish()
- .describe(
- "Colors pinned to specific breakdown values across the dashboard's tiles. A list of entries, not an object keyed by breakdown value. Send an empty list to clear them."
- ),
- data_color_theme_id: zod.number().nullish().describe('ID of the color theme used for chart visualizations.'),
- tags: zod.array(zod.string()).optional(),
- quick_filter_ids: zod
- .array(zod.string())
- .nullish()
- .describe('List of quick filter IDs associated with this dashboard.'),
- grid_spacing: zod
- .enum(['tight', 'condensed', 'standard', 'relaxed', 'wide'])
- .describe(
- '\* `tight` - tight\n\* `condensed` - condensed\n\* `standard` - standard\n\* `relaxed` - relaxed\n\* `wide` - wide'
- )
- .optional()
- .describe(
- 'Named tile density preset. Use tight, condensed, standard, relaxed, or wide.\n\n\* `tight` - tight\n\* `condensed` - condensed\n\* `standard` - standard\n\* `relaxed` - relaxed\n\* `wide` - wide'
- ),
- layout_compaction: zod
- .enum(['vertical', 'horizontal', 'stable'])
- .describe('\* `vertical` - vertical\n\* `horizontal` - horizontal\n\* `stable` - stable')
- .optional()
- .describe(
- 'How tiles rearrange after a move or resize. vertical stacks tiles upward, horizontal stacks tiles to the left, and stable preserves positions while moving colliding tiles.\n\n\* `vertical` - vertical\n\* `horizontal` - horizontal\n\* `stable` - stable'
- ),
- group_display: zod
- .enum(['sections', 'tabs'])
- .describe('\* `sections` - sections\n\* `tabs` - tabs')
- .optional()
- .describe(
- 'How tile groups show. sections shows each group as a band that opens and closes. tabs shows one group at a time, and tiles outside any group get their own first tab.\n\n\* `sections` - sections\n\* `tabs` - tabs'
- ),
- groups: zod
- .record(
- zod.string(),
- zod.object({
- title: zod
- .string()
- .max(dashboardsPartialUpdateBodyGroupsTitleMax)
- .optional()
- .describe(
- 'Heading for the group. When it is blank or omitted, the heading shows the number of tiles.'
- ),
- collapsed: zod
- .boolean()
- .optional()
- .describe(
- 'Whether the group starts closed. Defaults to false. When a viewer opens or closes the group, their browser keeps that choice and it wins over this default. A closed group loads its tiles when a viewer opens it.'
- ),
- color: zod
- .union([
- zod
- .enum(['blue', 'purple', 'green', 'yellow', 'orange', 'red'])
- .describe(
- '\* `blue` - Blue\n\* `purple` - Purple\n\* `green` - Green\n\* `yellow` - Yellow\n\* `orange` - Orange\n\* `red` - Red'
- ),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Color of a dot before the group heading. Null or omitted shows no dot.\n\n\* `blue` - Blue\n\* `purple` - Purple\n\* `green` - Green\n\* `yellow` - Yellow\n\* `orange` - Orange\n\* `red` - Red'
- ),
- })
- )
- .nullish()
- .describe(
- "Settings for tile groups, keyed by the tiles' group_key. Each group shows as a band of its tiles under a heading that viewers can open and close. Viewers who do not have bands yet see only the group title above its tiles. A write replaces the whole map. Send an empty object or null to remove all group settings."
- ),
- group_titles: zod
- .record(zod.string(), zod.string().max(dashboardsPartialUpdateBodyGroupTitlesMaxOne))
- .nullish()
- .describe(
- 'Deprecated: use groups. Titles for tile groups, keyed by group_key. A write replaces all titles and keeps the other group settings. Send an empty object or null to clear titles. Do not send it with groups.'
- ),
- tiles: zod
- .array(
- zod.object({
- id: zod.number().optional().describe('Dashboard tile ID to update.'),
- layouts: zod
- .object({
- sm: zod
- .object({
- x: zod
- .number()
- .min(dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMin)
- .max(dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneXMax)
- .describe('Column position in the dashboard grid (0-indexed).'),
- y: zod
- .number()
- .min(dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneYMin)
- .describe('Row position in the dashboard grid (0-indexed).'),
- w: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemLayoutsOneSmOneWMax)
- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),
- h: zod.number().min(1).describe('Height in grid rows.'),
- })
- .describe(
- "Layout for the standard (desktop) breakpoint. The grid is 12 columns wide. A write replaces the tile's whole layout and the dashboard reads desktop placement from this box, so send it whenever you send layouts."
- ),
- xs: zod
- .object({
- x: zod
- .number()
- .min(dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneXMin)
- .max(dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneXMax)
- .describe('Column position in the dashboard grid (0-indexed).'),
- y: zod
- .number()
- .min(dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneYMin)
- .describe('Row position in the dashboard grid (0-indexed).'),
- w: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemLayoutsOneXsOneWMax)
- .describe('Width in grid columns. The desktop grid is 12 columns wide.'),
- h: zod.number().min(1).describe('Height in grid rows.'),
- })
- .optional()
- .describe(
- 'Layout for the small (mobile) breakpoint, on a 1-column grid. The dashboard derives this layout from the sm order and heights, so a stored xs box does not change what renders.'
- ),
- })
- .optional()
- .describe(
- "Grid position and size per breakpoint. Works for every tile type, including insight tiles. A write replaces the tile's whole layout, so send a complete sm box rather than the one value you want to change. Boxes are stored as sent and overlaps are not resolved, so send sm boxes that do not overlap, and include every tile you move in the same request."
- ),
- show_description: zod
- .boolean()
- .optional()
- .describe(
- "Whether to show the tile's description underneath its title on the dashboard. Works for every tile type. The description itself is unaffected and still comes from the tile's insight, text, or widget content — this only toggles whether it renders on the dashboard."
- ),
- group_key: zod
- .string()
- .max(dashboardsPartialUpdateBodyTilesItemGroupKeyMax)
- .nullish()
- .describe(
- "Key that puts this tile in a group with the other tiles that have the same key on this dashboard. Set the group's title and style in the dashboard's groups. Null or an empty string removes the tile from its group."
- ),
- badge: zod
- .union([
- zod
- .enum(['winner', 'cheeky-hog'])
- .describe('\* `winner` - Winner\n\* `cheeky-hog` - Cheeky hog'),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Badge on the tile. winner shows a crown in the top left corner, for example to mark the best tile in a group. cheeky-hog shows a hedgehog when a person hovers over the tile. Null removes the badge. More than one tile in a group can have the winner badge.\n\n\* `winner` - Winner\n\* `cheeky-hog` - Cheeky hog'
- ),
- widget: zod
- .object({
- id: zod
- .uuid()
- .optional()
- .describe('Existing widget row ID when updating a widget tile via dashboard PATCH.'),
- widget_type: zod
- .enum([
- 'activity_events_list',
- 'canvas_app',
- 'conversations_recent_tickets',
- 'error_tracking_list',
- 'experiment_results',
- 'experiments_list',
- 'logs_list',
- 'metrics_table',
- 'notebook_widget',
- 'session_replay_list',
- 'survey_results',
- ])
- .describe(
- '\* `activity_events_list` - Activity Events List\n\* `canvas_app` - Canvas App\n\* `conversations_recent_tickets` - Conversations Recent Tickets\n\* `error_tracking_list` - Error Tracking List\n\* `experiment_results` - Experiment Results\n\* `experiments_list` - Experiments List\n\* `logs_list` - Logs List\n\* `metrics_table` - Metrics Table\n\* `notebook_widget` - Notebook Widget\n\* `session_replay_list` - Session Replay List\n\* `survey_results` - Survey Results'
- )
- .optional()
- .describe(
- 'Widget type identifier (cannot be changed on update).\n\n\* `activity_events_list` - Activity Events List\n\* `canvas_app` - Canvas App\n\* `conversations_recent_tickets` - Conversations Recent Tickets\n\* `error_tracking_list` - Error Tracking List\n\* `experiment_results` - Experiment Results\n\* `experiments_list` - Experiments List\n\* `logs_list` - Logs List\n\* `metrics_table` - Metrics Table\n\* `notebook_widget` - Notebook Widget\n\* `session_replay_list` - Session Replay List\n\* `survey_results` - Survey Results'
- ),
- config: zod
- .union([
- zod.object({
- notebookShortId: zod
- .union([
- zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneNotebookShortIdOneMax
- ),
- zod.null(),
- ])
- .optional()
- .describe('Source notebook short ID.'),
- snapshotId: zod
- .union([zod.uuid(), zod.null()])
- .optional()
- .describe(
- "Immutable notebook widget snapshot. Add one from a notebook widget's menu."
- ),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional(),
- filterTestAccounts: zod.union([zod.boolean(), zod.null()]).optional(),
- widgetFilters: zod
- .union([
- zod.record(
- zod.string(),
- zod.object({
- filterId: zod.string().min(1),
- propertyName: zod.string().min(1),
- optionId: zod.string().min(1),
- operator: zod.enum([
- 'exact',
- 'is_not',
- 'icontains',
- 'not_icontains',
- 'starts_with',
- 'not_starts_with',
- 'ends_with',
- 'not_ends_with',
- 'regex',
- 'not_regex',
- 'gt',
- 'gte',
- 'lt',
- 'lte',
- 'is_set',
- 'is_not_set',
- 'is_date_exact',
- 'is_date_before',
- 'is_date_after',
- 'between',
- 'not_between',
- 'min',
- 'max',
- 'in',
- 'not_in',
- 'is_cleaned_path_exact',
- 'is_cleaned_path_not_exact',
- 'flag_evaluates_to',
- 'semver_eq',
- 'semver_neq',
- 'semver_gt',
- 'semver_gte',
- 'semver_lt',
- 'semver_lte',
- 'semver_tilde',
- 'semver_caret',
- 'semver_wildcard',
- 'icontains_multi',
- 'not_icontains_multi',
- ]),
- value: zod
- .union([zod.string(), zod.array(zod.string()), zod.null()])
- .optional(),
- })
- ),
- zod.null(),
- ])
- .optional(),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoLimitDefault
- )
- .describe('Maximum number of events to return.'),
- eventName: zod
- .union([zod.string().min(1), zod.null()])
- .optional()
- .describe(
- 'Limit the feed to a single event name. Omit or null for all events.'
- ),
- properties: zod
- .union([
- zod
- .array(
- zod.object({
- key: zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemKeyMax
- ),
- label: zod
- .union([
- zod
- .string()
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemLabelOneMax
- ),
- zod.null(),
- ])
- .optional(),
- operator: zod.enum([
- 'exact',
- 'is_not',
- 'icontains',
- 'not_icontains',
- 'starts_with',
- 'not_starts_with',
- 'ends_with',
- 'not_ends_with',
- 'regex',
- 'not_regex',
- 'gt',
- 'gte',
- 'lt',
- 'lte',
- 'is_set',
- 'is_not_set',
- 'is_date_exact',
- 'is_date_before',
- 'is_date_after',
- 'between',
- 'not_between',
- 'min',
- 'max',
- 'in',
- 'not_in',
- 'is_cleaned_path_exact',
- 'is_cleaned_path_not_exact',
- 'flag_evaluates_to',
- 'semver_eq',
- 'semver_neq',
- 'semver_gt',
- 'semver_gte',
- 'semver_lt',
- 'semver_lte',
- 'semver_tilde',
- 'semver_caret',
- 'semver_wildcard',
- 'icontains_multi',
- 'not_icontains_multi',
- ]),
- type: zod.enum(['event', 'person']),
- value: zod
- .union([
- zod
- .array(
- zod.union([
- zod
- .string()
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueOneItemOneMax
- ),
- zod.number(),
- zod.boolean(),
- ])
- )
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueOneMax
- ),
- zod
- .string()
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneItemValueTwoMax
- ),
- zod.number(),
- zod.boolean(),
- zod.null(),
- ])
- .optional(),
- })
- )
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneTwoPropertiesOneMax
- ),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Event and person property filters, matching Activity > Explore events.'
- ),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional(),
- filterTestAccounts: zod.union([zod.boolean(), zod.null()]).optional(),
- widgetFilters: zod
- .union([
- zod.record(
- zod.string(),
- zod.object({
- filterId: zod.string().min(1),
- propertyName: zod.string().min(1),
- optionId: zod.string().min(1),
- operator: zod.enum([
- 'exact',
- 'is_not',
- 'icontains',
- 'not_icontains',
- 'starts_with',
- 'not_starts_with',
- 'ends_with',
- 'not_ends_with',
- 'regex',
- 'not_regex',
- 'gt',
- 'gte',
- 'lt',
- 'lte',
- 'is_set',
- 'is_not_set',
- 'is_date_exact',
- 'is_date_before',
- 'is_date_after',
- 'between',
- 'not_between',
- 'min',
- 'max',
- 'in',
- 'not_in',
- 'is_cleaned_path_exact',
- 'is_cleaned_path_not_exact',
- 'flag_evaluates_to',
- 'semver_eq',
- 'semver_neq',
- 'semver_gt',
- 'semver_gte',
- 'semver_lt',
- 'semver_lte',
- 'semver_tilde',
- 'semver_caret',
- 'semver_wildcard',
- 'icontains_multi',
- 'not_icontains_multi',
- ]),
- value: zod
- .union([zod.string(), zod.array(zod.string()), zod.null()])
- .optional(),
- })
- ),
- zod.null(),
- ])
- .optional(),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeLimitDefault
- )
- .describe('Maximum number of issues to return.'),
- orderBy: zod
- .enum([
- 'last_seen',
- 'first_seen',
- 'occurrences',
- 'users',
- 'sessions',
- 'severity',
- ])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeOrderByDefault
- )
- .describe('Issue ranking column.'),
- orderDirection: zod
- .enum(['ASC', 'DESC'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeOrderDirectionDefault
- )
- .describe('Sort direction for orderBy.'),
- status: zod
- .enum([
- 'archived',
- 'active',
- 'resolved',
- 'pending_release',
- 'suppressed',
- 'all',
- ])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneThreeStatusDefault
- )
- .describe('Issue status filter.'),
- assignee: zod
- .union([
- zod.object({
- id: zod.union([zod.string(), zod.number()]),
- type: zod.enum(['user', 'role']),
- }),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Filter by assignee ({type: user|role, id}). Omit for any assignee.'
- ),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional(),
- filterTestAccounts: zod.union([zod.boolean(), zod.null()]).optional(),
- widgetFilters: zod
- .union([
- zod.record(
- zod.string(),
- zod.object({
- filterId: zod.string().min(1),
- propertyName: zod.string().min(1),
- optionId: zod.string().min(1),
- operator: zod.enum([
- 'exact',
- 'is_not',
- 'icontains',
- 'not_icontains',
- 'starts_with',
- 'not_starts_with',
- 'ends_with',
- 'not_ends_with',
- 'regex',
- 'not_regex',
- 'gt',
- 'gte',
- 'lt',
- 'lte',
- 'is_set',
- 'is_not_set',
- 'is_date_exact',
- 'is_date_before',
- 'is_date_after',
- 'between',
- 'not_between',
- 'min',
- 'max',
- 'in',
- 'not_in',
- 'is_cleaned_path_exact',
- 'is_cleaned_path_not_exact',
- 'flag_evaluates_to',
- 'semver_eq',
- 'semver_neq',
- 'semver_gt',
- 'semver_gte',
- 'semver_lt',
- 'semver_lte',
- 'semver_tilde',
- 'semver_caret',
- 'semver_wildcard',
- 'icontains_multi',
- 'not_icontains_multi',
- ]),
- value: zod
- .union([zod.string(), zod.array(zod.string()), zod.null()])
- .optional(),
- })
- ),
- zod.null(),
- ])
- .optional(),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourLimitDefault
- )
- .describe('Maximum number of recordings to return.'),
- orderBy: zod
- .enum([
- 'start_time',
- 'activity_score',
- 'recording_duration',
- 'duration',
- 'click_count',
- 'console_error_count',
- ])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourOrderByDefault
- )
- .describe('Recording ranking column.'),
- orderDirection: zod
- .enum(['ASC', 'DESC'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFourOrderDirectionDefault
- )
- .describe('Sort direction for orderBy.'),
- savedFilterId: zod
- .union([zod.string(), zod.null()])
- .optional()
- .describe(
- 'short_id of a saved session replay filter to refine the recordings shown. When set, the saved filter owns the date range and property filters; only orderBy, orderDirection, and limit still apply. Combine with collectionId to filter within a collection.'
- ),
- collectionId: zod
- .union([zod.string(), zod.null()])
- .optional()
- .describe(
- 'short_id of a session replay collection to scope the widget to its pinned recordings. Combine with savedFilterId or property filters to narrow within the collection; orderBy, orderDirection, and limit still apply.'
- ),
- }),
- zod.object({
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveLimitDefault
- )
- .describe('Maximum number of experiments to return.'),
- orderBy: zod
- .enum(['created_at', 'name', 'start_date'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveOrderByDefault
- )
- .describe('Experiment list sort column.'),
- orderDirection: zod
- .enum(['ASC', 'DESC'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveOrderDirectionDefault
- )
- .describe('Sort direction for orderBy.'),
- status: zod
- .enum(['draft', 'running', 'paused', 'exposure_frozen', 'stopped', 'all'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneFiveStatusDefault
- )
- .describe('Experiment status filter.'),
- createdBy: zod
- .union([zod.number(), zod.null()])
- .optional()
- .describe('Filter by creator (user id). Omit for any creator.'),
- }),
- zod.object({
- experimentId: zod
- .union([zod.number(), zod.null()])
- .optional()
- .describe(
- 'Experiment to show results for. Null until the user picks one in the widget settings.'
- ),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional()
- .describe("Null or omitted means all time (the survey's full lifetime)."),
- surveyId: zod
- .union([zod.string(), zod.null()])
- .optional()
- .describe(
- 'Survey to show performance stats and recent responses for. Null until the user picks one.'
- ),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneSevenLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneSevenLimitDefault
- )
- .describe('Maximum number of recent responses to return.'),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional(),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightLimitDefault
- )
- .describe('Maximum number of log lines to return.'),
- orderBy: zod
- .enum(['latest', 'earliest'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightOrderByDefault
- )
- .describe('Sort by newest (latest) or oldest (earliest) first.'),
- severityLevels: zod
- .array(zod.enum(['trace', 'debug', 'info', 'warn', 'error', 'fatal']))
- .optional()
- .describe(
- 'Only show logs at these severity levels. Empty shows all levels.'
- ),
- serviceNames: zod
- .array(zod.string())
- .optional()
- .describe('Only show logs from these services. Empty shows all services.'),
- wrapLines: zod
- .boolean()
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightWrapLinesDefault
- )
- .describe(
- 'Wrap long log lines instead of truncating them to a single row.'
- ),
- timezone: zod
- .enum(['UTC', 'local'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneEightTimezoneDefault
- )
- .describe(
- "Render log timestamps in UTC or in each viewer's local timezone."
- ),
- savedViewId: zod
- .union([zod.string(), zod.null()])
- .optional()
- .describe(
- 'short_id of a saved logs view to use as the source. When set, the saved view owns the date range, severity, service, and property filters; only orderBy and limit still apply.'
- ),
- }),
- zod.object({
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineLimitDefault
- )
- .describe('Maximum number of tickets to return.'),
- status: zod
- .enum(['new', 'open', 'pending', 'on_hold', 'resolved', 'all'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineStatusDefault
- )
- .describe('Ticket status filter.'),
- priorities: zod
- .array(zod.enum(['low', 'medium', 'high', 'critical']))
- .optional()
- .describe(
- 'Only show tickets with these priorities. Empty shows all priorities.'
- ),
- channel: zod
- .enum(['widget', 'email', 'slack', 'teams', 'github', 'all'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineChannelDefault
- )
- .describe('Ticket channel filter.'),
- assignees: zod
- .array(
- zod.union([
- zod.enum(['me', 'unassigned']),
- zod.object({
- id: zod.union([zod.string(), zod.number()]),
- type: zod.enum(['user', 'role']),
- }),
- ])
- )
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineAssigneesMax)
- .optional()
- .describe(
- "Only show tickets assigned to these users or roles. 'me' means the requesting user and 'unassigned' means tickets without an assignment. Empty shows all assignees."
- ),
- search: zod
- .string()
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSearchMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSearchDefault
- )
- .describe(
- 'Search requester name or email, ticket subject, message text, or ticket number.'
- ),
- savedViewId: zod
- .union([
- zod
- .string()
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneNineSavedViewIdOneMax
- ),
- zod.null(),
- ])
- .optional()
- .describe(
- 'short_id of a saved Support view to use as the source. When set, the saved view owns the ticket filters; the widget still sorts by most recently updated and applies its limit.'
- ),
- }),
- zod.object({
- canvasId: zod
- .union([zod.uuid(), zod.null()])
- .optional()
- .describe(
- 'Canvas to render in the tile. Null until the user picks one in the widget settings.'
- ),
- }),
- zod.object({
- dateRange: zod
- .union([
- zod.object({
- date_from: zod
- .union([
- zod.enum([
- '-1M',
- '-30M',
- '-1h',
- '-3h',
- '-24h',
- '-7d',
- '-14d',
- '-30d',
- '-90d',
- ]),
- zod.null(),
- ])
- .optional(),
- }),
- zod.null(),
- ])
- .optional(),
- groupBy: zod
- .union([
- zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneGroupByOneMax
- ),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Label that makes one row per value, e.g. `http.route`. Null until the user sets it.'
- ),
- columns: zod
- .array(
- zod.object({
- label: zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemLabelMax
- )
- .describe('Column header, e.g. `Requests\/s`.'),
- metricName: zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemMetricNameMax
- )
- .describe('Name of the metric this column reads.'),
- aggregation: zod
- .enum([
- 'rate',
- 'increase',
- 'sum',
- 'avg',
- 'min',
- 'max',
- 'histogram_quantile',
- ])
- .describe(
- 'How each time bucket of a row is computed. `rate` and `increase` read counters.'
- ),
- quantile: zod
- .union([
- zod
- .number()
- .gt(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemQuantileOneExclusiveMin
- )
- .lt(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemQuantileOneExclusiveMax
- ),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Required for `histogram_quantile`, e.g. 0.95 for p95.'
- ),
- filters: zod
- .array(
- zod.object({
- key: zod
- .string()
- .min(1)
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemKeyMax
- )
- .describe(
- 'Label key to filter on, e.g. `http.response.status_code`.'
- ),
- op: zod
- .enum(['eq', 'neq', 'regex', 'not_regex'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemOpDefault
- )
- .describe('How the label value is compared.'),
- value: zod
- .string()
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersItemValueMax
- )
- .describe(
- 'Label value, or a regular expression for `regex` and `not_regex`.'
- ),
- })
- )
- .max(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsItemFiltersMax
- )
- .optional()
- .describe(
- 'Label filters for this column only, e.g. 5xx status codes for an errors column.'
- ),
- })
- )
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneColumnsMax)
- .optional()
- .describe(
- "One metric per column. Each row shows the column's average over the date range and a sparkline."
- ),
- interval: zod
- .union([
- zod.enum(['minute', 'minute_5', 'minute_15', 'hour', 'day']),
- zod.null(),
- ])
- .optional()
- .describe(
- 'Time between the points of the full charts that open from a row. Null picks one from the date range. The table sparklines always use at most 30 points.'
- ),
- orderByColumn: zod
- .number()
- .min(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderByColumnMin
- )
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderByColumnDefault
- )
- .describe('Index of the column that sorts the rows.'),
- orderDirection: zod
- .enum(['ASC', 'DESC'])
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneOrderDirectionDefault
- )
- .describe('Sort direction for orderByColumn.'),
- limit: zod
- .number()
- .min(1)
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneLimitMax)
- .default(
- dashboardsPartialUpdateBodyTilesItemWidgetOneConfigOneOneoneLimitDefault
- )
- .describe('Maximum number of rows to show.'),
- }),
- ])
- .optional()
- .describe("Widget-specific configuration. Shape depends on the tile's widget_type."),
- name: zod
- .string()
- .max(dashboardsPartialUpdateBodyTilesItemWidgetOneNameMax)
- .nullish()
- .describe('Optional custom display name for the widget tile.'),
- description: zod
- .string()
- .optional()
- .describe('Optional markdown description shown when show_description is enabled.'),
- })
- .optional()
- .describe('Nested widget row updates.'),
- })
- )
- .optional()
- .describe(
- 'Dashboard tiles to update, each identified by its tile id. Any tile type accepts `layouts` to set its grid position and size. Widget tiles also accept nested widget.config patches.'
- ),
- use_template: zod
- .string()
- .optional()
- .describe('Template key to create the dashboard from a predefined template.'),
- use_dashboard: zod.number().nullish().describe('ID of an existing dashboard to duplicate.'),
- delete_insights: zod
- .boolean()
- .default(dashboardsPartialUpdateBodyDeleteInsightsDefault)
- .describe('When deleting, also delete insights that are only on this dashboard.'),
- })
- .describe(
- 'OpenAPI-only PATCH body for dashboards (agents\/MCP).\n\nMust be a superset of ``dashboard_patch_runtime_openapi_field_names()`` — ``extend_schema(request=...)``\nreplaces the inferred schema entirely. Contract: ``test_dashboard_openapi.py``.'
- )
+ .record(zod.string(), zod.unknown())
+ .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')
/**
* Place an existing insight on this dashboard as a new tile. Requires edit access to the dashboard and view access to the insight. Returns the tile. Adding an insight the dashboard already shows returns its tile unchanged, and adding one that was removed from the dashboard restores its tile with its old layout. To take an insight off a dashboard, use delete_tile.
diff --git a/products/data_catalog/frontend/generated/api.schemas.ts b/products/data_catalog/frontend/generated/api.schemas.ts
index dd14f8e0fef7..ff610663535f 100644
--- a/products/data_catalog/frontend/generated/api.schemas.ts
+++ b/products/data_catalog/frontend/generated/api.schemas.ts
@@ -486,10 +486,9 @@ export interface DataCatalogMetricApproveRequestApi {
* * `quarter` - quarter
* * `year` - year
*/
-export type DataCatalogMetricRunRequestIntervalEnumApi =
- (typeof DataCatalogMetricRunRequestIntervalEnumApi)[keyof typeof DataCatalogMetricRunRequestIntervalEnumApi]
+export type IntervalTypeEnumApi = (typeof IntervalTypeEnumApi)[keyof typeof IntervalTypeEnumApi]
-export const DataCatalogMetricRunRequestIntervalEnumApi = {
+export const IntervalTypeEnumApi = {
Second: 'second',
Minute: 'minute',
Hour: 'hour',
@@ -518,7 +517,7 @@ export interface DataCatalogMetricRunRequestApi {
* * `month` - month
* * `quarter` - quarter
* * `year` - year */
- interval?: DataCatalogMetricRunRequestIntervalEnumApi
+ interval?: IntervalTypeEnumApi
/** Client-supplied id to correlate or cancel the run. */
query_id?: string
}
diff --git a/products/desktop/packages/api-client/src/generated.ts b/products/desktop/packages/api-client/src/generated.ts
index 8980c551cd62..7d85ee1faaa3 100644
--- a/products/desktop/packages/api-client/src/generated.ts
+++ b/products/desktop/packages/api-client/src/generated.ts
@@ -6475,6 +6475,25 @@ export namespace Schemas {
| BehavioralPropertyFilter
> | null;
}>;
+ /**
+ * * `second` - second
+ * * `minute` - minute
+ * * `hour` - hour
+ * * `day` - day
+ * * `week` - week
+ * * `month` - month
+ * * `quarter` - quarter
+ * * `year` - year
+ */
+ export type IntervalTypeEnum =
+ | "second"
+ | "minute"
+ | "hour"
+ | "day"
+ | "week"
+ | "month"
+ | "quarter"
+ | "year";
/**
* OpenAPI-only shape for a dashboard's filters object (agents/MCP).
*
@@ -6486,6 +6505,10 @@ export namespace Schemas {
date_from: string | null;
date_to: string | null;
properties: unknown;
+ breakdown_filter: BreakdownFilter | null;
+ interval: IntervalTypeEnum | NullEnum;
+ compareFilter: CompareFilter | null;
+ filterTestAccounts: boolean | null;
}>;
export type _DashboardPatchTileLayoutBoxOpenApi = {
/**
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 812d1586e524..02d57d5c56ab 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -30039,6 +30039,30 @@ export namespace Schemas {
skipped: DashboardBulkDeleteSkipped[];
}
+ /**
+ * * `second` - second
+ * * `minute` - minute
+ * * `hour` - hour
+ * * `day` - day
+ * * `week` - week
+ * * `month` - month
+ * * `quarter` - quarter
+ * * `year` - year
+ */
+ export type IntervalTypeEnum = typeof IntervalTypeEnum[keyof typeof IntervalTypeEnum];
+
+
+ export const IntervalTypeEnum = {
+ Second: 'second',
+ Minute: 'minute',
+ Hour: 'hour',
+ Day: 'day',
+ Week: 'week',
+ Month: 'month',
+ Quarter: 'quarter',
+ Year: 'year',
+ } as const;
+
/**
* OpenAPI-only shape for a dashboard's filters object (agents/MCP).
*
@@ -30059,6 +30083,26 @@ export namespace Schemas {
date_to?: string | null;
/** Dashboard-level property filters applied to every tile (PostHog property filter group). */
properties?: unknown;
+ /** Dashboard-level breakdown applied to every tile that supports one, replacing the tile's own breakdown. Example: {"breakdown_type": "event", "breakdown": "$browser"}. Null clears it. */
+ breakdown_filter?: BreakdownFilter | null;
+ /** Time granularity forced onto every tile that supports one. Null means each tile keeps its own.
+ *
+ * * `second` - second
+ * * `minute` - minute
+ * * `hour` - hour
+ * * `day` - day
+ * * `week` - week
+ * * `month` - month
+ * * `quarter` - quarter
+ * * `year` - year */
+ interval?: IntervalTypeEnum | null;
+ /** Period comparison forced onto every tile that supports one. Null means each tile keeps its own. */
+ compareFilter?: CompareFilter | null;
+ /**
+ * True forces test accounts out of every tile, false forces them in, null keeps each tile's setting.
+ * @nullable
+ */
+ filterTestAccounts?: boolean | null;
}
/**
@@ -30854,30 +30898,6 @@ export namespace Schemas {
instructions: string | null;
}
- /**
- * * `second` - second
- * * `minute` - minute
- * * `hour` - hour
- * * `day` - day
- * * `week` - week
- * * `month` - month
- * * `quarter` - quarter
- * * `year` - year
- */
- export type DataCatalogMetricRunRequestIntervalEnum = typeof DataCatalogMetricRunRequestIntervalEnum[keyof typeof DataCatalogMetricRunRequestIntervalEnum];
-
-
- export const DataCatalogMetricRunRequestIntervalEnum = {
- Second: 'second',
- Minute: 'minute',
- Hour: 'hour',
- Day: 'day',
- Week: 'week',
- Month: 'month',
- Quarter: 'quarter',
- Year: 'year',
- } as const;
-
/**
* Optional run-time overrides. The whole body may be omitted; a metric runs by its URL name.
*/
@@ -30896,7 +30916,7 @@ export namespace Schemas {
* * `month` - month
* * `quarter` - quarter
* * `year` - year */
- interval?: DataCatalogMetricRunRequestIntervalEnum;
+ interval?: IntervalTypeEnum;
/** Client-supplied id to correlate or cancel the run. */
query_id?: string;
}
@@ -91219,7 +91239,7 @@ export namespace Schemas {
name?: string | null;
description?: string;
pinned?: boolean;
- /** Dashboard-level filters (date range and properties) applied across all tiles as the source of truth. */
+ /** Dashboard-level filters (date range, properties, breakdown, interval, comparison) applied across all tiles as the source of truth. */
filters?: DashboardFiltersOpenApi;
/**
* Colors pinned to specific breakdown values across the dashboard's tiles. A list of entries, not an object keyed by breakdown value. Send an empty list to clear them.
diff --git a/services/mcp/src/generated/dashboards/api.ts b/services/mcp/src/generated/dashboards/api.ts
index daeb0f63e974..c1f7f7c5fba4 100644
--- a/services/mcp/src/generated/dashboards/api.ts
+++ b/services/mcp/src/generated/dashboards/api.ts
@@ -291,6 +291,10 @@ export const DashboardsPartialUpdateQueryParams = () => zod.object({
export const dashboardsPartialUpdateBodyNameMax = 400
+export const dashboardsPartialUpdateBodyFiltersOneBreakdownFilterOneBreakdownTypeDefault = `event`
+export const dashboardsPartialUpdateBodyFiltersOneBreakdownFilterOneBreakdownsOneMax = 3
+
+export const dashboardsPartialUpdateBodyFiltersOneCompareFilterOneCompareDefault = false
export const dashboardsPartialUpdateBodyBreakdownColorsItemColorTokenRegExp = new RegExp('^preset-[1-9][0-9]\*$')
export const dashboardsPartialUpdateBodyGroupsTitleMax = 200
@@ -335,13 +339,127 @@ export const DashboardsPartialUpdateBody = () => zod
.describe(
'Dashboard-level property filters applied to every tile (PostHog property filter group).'
),
+ breakdown_filter: zod
+ .union([
+ zod.object({
+ breakdown: zod
+ .union([
+ zod.string(),
+ zod.array(zod.union([zod.string(), zod.number()])),
+ zod.number(),
+ zod.null(),
+ ])
+ .optional(),
+ breakdown_group_type_index: zod.union([zod.number(), zod.null()]).optional(),
+ breakdown_hide_other_aggregation: zod.union([zod.boolean(), zod.null()]).optional(),
+ breakdown_histogram_bin_count: zod.union([zod.number(), zod.null()]).optional(),
+ breakdown_limit: zod.union([zod.number(), zod.null()]).optional(),
+ breakdown_normalize_url: zod.union([zod.boolean(), zod.null()]).optional(),
+ breakdown_path_cleaning: zod.union([zod.boolean(), zod.null()]).optional(),
+ breakdown_type: zod
+ .union([
+ zod.enum([
+ 'cohort',
+ 'person',
+ 'event',
+ 'event_metadata',
+ 'element',
+ 'group',
+ 'session',
+ 'hogql',
+ 'data_warehouse',
+ 'data_warehouse_person_property',
+ 'revenue_analytics',
+ ]),
+ zod.null(),
+ ])
+ .default(dashboardsPartialUpdateBodyFiltersOneBreakdownFilterOneBreakdownTypeDefault),
+ breakdowns: zod
+ .union([
+ zod
+ .array(
+ zod.object({
+ group_type_index: zod.union([zod.number(), zod.null()]).optional(),
+ histogram_bin_count: zod.union([zod.number(), zod.null()]).optional(),
+ normalize_url: zod.union([zod.boolean(), zod.null()]).optional(),
+ property: zod.union([zod.string(), zod.number()]),
+ type: zod
+ .union([
+ zod.enum([
+ 'person',
+ 'event',
+ 'event_metadata',
+ 'element',
+ 'group',
+ 'session',
+ 'hogql',
+ 'cohort',
+ 'revenue_analytics',
+ 'data_warehouse',
+ 'data_warehouse_person_property',
+ ]),
+ zod.null(),
+ ])
+ .optional(),
+ })
+ )
+ .max(dashboardsPartialUpdateBodyFiltersOneBreakdownFilterOneBreakdownsOneMax),
+ zod.null(),
+ ])
+ .optional(),
+ }),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ 'Dashboard-level breakdown applied to every tile that supports one, replacing the tile\'s own breakdown. Example: {\"breakdown_type\": \"event\", \"breakdown\": \"$browser\"}. Null clears it.'
+ ),
+ interval: zod
+ .union([
+ zod
+ .enum(['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'])
+ .describe(
+ '\* `second` - second\n\* `minute` - minute\n\* `hour` - hour\n\* `day` - day\n\* `week` - week\n\* `month` - month\n\* `quarter` - quarter\n\* `year` - year'
+ ),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ 'Time granularity forced onto every tile that supports one. Null means each tile keeps its own.\n\n\* `second` - second\n\* `minute` - minute\n\* `hour` - hour\n\* `day` - day\n\* `week` - week\n\* `month` - month\n\* `quarter` - quarter\n\* `year` - year'
+ ),
+ compareFilter: zod
+ .union([
+ zod.object({
+ compare: zod
+ .union([zod.boolean(), zod.null()])
+ .default(dashboardsPartialUpdateBodyFiltersOneCompareFilterOneCompareDefault)
+ .describe('Whether to compare the current date range to a previous date range.'),
+ compare_to: zod
+ .union([zod.string(), zod.null()])
+ .optional()
+ .describe(
+ 'The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago.'
+ ),
+ }),
+ zod.null(),
+ ])
+ .optional()
+ .describe(
+ 'Period comparison forced onto every tile that supports one. Null means each tile keeps its own.'
+ ),
+ filterTestAccounts: zod
+ .boolean()
+ .nullish()
+ .describe(
+ "True forces test accounts out of every tile, false forces them in, null keeps each tile's setting."
+ ),
})
.describe(
"OpenAPI-only shape for a dashboard's filters object (agents\/MCP).\n\nDocuments the dashboard-level filters that act as the single source of truth for the\ndashboard's tiles. Runtime persistence reads the raw ``filters`` dict from the request body, so\nextra keys are accepted, but these are the ones agents should set."
)
.optional()
.describe(
- 'Dashboard-level filters (date range and properties) applied across all tiles as the source of truth.'
+ 'Dashboard-level filters (date range, properties, breakdown, interval, comparison) applied across all tiles as the source of truth.'
),
breakdown_colors: zod
.array(
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
index e0e7ccc59a88..1855c04601ca 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/dashboard-update.json
@@ -88,8 +88,247 @@
"type": "string"
},
"filters": {
- "description": "Dashboard-level filters (date range and properties) applied across all tiles as the source of truth.",
+ "description": "Dashboard-level filters (date range, properties, breakdown, interval, comparison) applied across all tiles as the source of truth.",
"properties": {
+ "breakdown_filter": {
+ "anyOf": [
+ {
+ "properties": {
+ "breakdown": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ "type": "array"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_group_type_index": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_hide_other_aggregation": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_histogram_bin_count": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_limit": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_normalize_url": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_path_cleaning": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "breakdown_type": {
+ "anyOf": [
+ {
+ "enum": [
+ "cohort",
+ "person",
+ "event",
+ "event_metadata",
+ "element",
+ "group",
+ "session",
+ "hogql",
+ "data_warehouse",
+ "data_warehouse_person_property",
+ "revenue_analytics"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": "event"
+ },
+ "breakdowns": {
+ "anyOf": [
+ {
+ "items": {
+ "properties": {
+ "group_type_index": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "histogram_bin_count": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "normalize_url": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "property": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ }
+ ]
+ },
+ "type": {
+ "anyOf": [
+ {
+ "enum": [
+ "person",
+ "event",
+ "event_metadata",
+ "element",
+ "group",
+ "session",
+ "hogql",
+ "cohort",
+ "revenue_analytics",
+ "data_warehouse",
+ "data_warehouse_person_property"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": ["property"],
+ "type": "object"
+ },
+ "maxItems": 3,
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Dashboard-level breakdown applied to every tile that supports one, replacing the tile's own breakdown. Example: {\"breakdown_type\": \"event\", \"breakdown\": \"$browser\"}. Null clears it."
+ },
+ "compareFilter": {
+ "anyOf": [
+ {
+ "properties": {
+ "compare": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "default": false,
+ "description": "Whether to compare the current date range to a previous date range."
+ },
+ "compare_to": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago."
+ }
+ },
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Period comparison forced onto every tile that supports one. Null means each tile keeps its own."
+ },
"date_from": {
"anyOf": [
{
@@ -112,6 +351,30 @@
],
"description": "Dashboard-level end of the date range, e.g. '-1d' or an ISO date. Null/omitted means up to now."
},
+ "filterTestAccounts": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "True forces test accounts out of every tile, false forces them in, null keeps each tile's setting."
+ },
+ "interval": {
+ "anyOf": [
+ {
+ "description": "* `second` - second\n* `minute` - minute\n* `hour` - hour\n* `day` - day\n* `week` - week\n* `month` - month\n* `quarter` - quarter\n* `year` - year",
+ "enum": ["second", "minute", "hour", "day", "week", "month", "quarter", "year"],
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Time granularity forced onto every tile that supports one. Null means each tile keeps its own.\n\n* `second` - second\n* `minute` - minute\n* `hour` - hour\n* `day` - day\n* `week` - week\n* `month` - month\n* `quarter` - quarter\n* `year` - year"
+ },
"properties": {
"description": "Dashboard-level property filters applied to every tile (PostHog property filter group)."
}