: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(customer-analytics): filter accounts by relationships (#90921)
Arthur Moreira de Deuse4e5bfd9e984
diff --git a/frontend/src/lib/components/PropertiesTable/PropertiesTable.tsx b/frontend/src/lib/components/PropertiesTable/PropertiesTable.tsxindex d8a2e7915b17..f2ec22c0e4cb 100644--- a/frontend/src/lib/components/PropertiesTable/PropertiesTable.tsx+++ b/frontend/src/lib/components/PropertiesTable/PropertiesTable.tsx@@ -267,6 +267,7 @@ export function PropertiesTable({[PropertyDefinitionType.EventMetadata]: TaxonomicFilterGroupType.EventMetadata,[PropertyDefinitionType.RevenueAnalytics]: TaxonomicFilterGroupType.RevenueAnalyticsProperties,[PropertyDefinitionType.Account]: TaxonomicFilterGroupType.AccountFields,+ [PropertyDefinitionType.AccountRelationship]: TaxonomicFilterGroupType.AccountRelationships,[PropertyDefinitionType.AccountCustomProperty]: TaxonomicFilterGroupType.AccountCustomProperties,[PropertyDefinitionType.Person]: TaxonomicFilterGroupType.PersonProperties,[PropertyDefinitionType.PersonMetadata]: TaxonomicFilterGroupType.PersonMetadata,diff --git a/frontend/src/lib/components/PropertyFilters/PropertyFilters.tsx b/frontend/src/lib/components/PropertyFilters/PropertyFilters.tsxindex 34d7bca1e5f8..6c05b6646d4f 100644--- a/frontend/src/lib/components/PropertyFilters/PropertyFilters.tsx+++ b/frontend/src/lib/components/PropertyFilters/PropertyFilters.tsx@@ -73,6 +73,7 @@ export interface PropertyFiltersProps {*/triggerVariant?: 'button' | 'input'staticValueOptions?: PropertyFilterInternalProps['staticValueOptions']+ renderOperatorValueSelect?: PropertyFilterInternalProps['renderOperatorValueSelect']/** Override inferred property definitions for contexts where one event key is polymorphic. */propertyDefinitionsOverride?: PropertyDefinition[]/** Keep the selected key fixed while leaving its operator and value editable. */@@ -124,6 +125,7 @@ export function PropertyFilters({hogQLGlobals,triggerVariant = 'button',staticValueOptions,+ renderOperatorValueSelect,propertyDefinitionsOverride,propertyKeyEditable,singleLine,@@ -237,6 +239,7 @@ export function PropertyFilters({hogQLGlobals={hogQLGlobals}triggerVariant={triggerVariant}staticValueOptions={staticValueOptions}+ renderOperatorValueSelect={renderOperatorValueSelect}propertyDefinitionsOverride={propertyDefinitionsOverride}propertyKeyEditable={propertyKeyEditable}singleLine={singleLine}diff --git a/frontend/src/lib/components/PropertyFilters/components/TaxonomicPropertyFilter.tsx b/frontend/src/lib/components/PropertyFilters/components/TaxonomicPropertyFilter.tsxindex a45736c0f918..9407035ddc59 100644--- a/frontend/src/lib/components/PropertyFilters/components/TaxonomicPropertyFilter.tsx+++ b/frontend/src/lib/components/PropertyFilters/components/TaxonomicPropertyFilter.tsx@@ -86,6 +86,7 @@ export function TaxonomicPropertyFilter({hogQLGlobals,triggerVariant = 'button',staticValueOptions,+ renderOperatorValueSelect,propertyDefinitionsOverride,propertyKeyEditable = true,singleLine,@@ -195,7 +196,7 @@ export function TaxonomicPropertyFilter({/>)- const operatorValueSelect = (+ const defaultOperatorValueSelect = (<OperatorValueSelectpropertyDefinitions={propertyDefinitions}size={size}@@ -249,14 +250,30 @@ export function TaxonomicPropertyFilter({/>)+ const operatorValueSelect =+ filter && renderOperatorValueSelect+ ? renderOperatorValueSelect(filter, (operator, value) => {+ setFilter(index, {+ ...filter,+ operator,+ value,+ } as AnyPropertyFilter)+ })+ : null++ const filterType = filter?.type as PropertyFilterType | undefined+const filterContent =filter?.type === 'cohort'? cohortName || `Cohort #${filter?.value}`: filter?.type === PropertyFilterType.EventMetadata && filter?.key?.startsWith('$group_')? filter.label || `Group ${filter?.value}`: (filter?.type === PropertyFilterType.Flag ||+ filterType === PropertyFilterType.AccountRelationship ||filter?.type === PropertyFilterType.AccountCustomProperty) &&- filter?.label+ filter &&+ 'label' in filter &&+ filter.label? filter.label: filter?.key && (<PropertyKeyInfo@@ -381,9 +398,13 @@ export function TaxonomicPropertyFilter({framedRows && filter?.key && FILTER_ROW_FRAME_CLASSES)}>- {showOperatorValueSelect && placeOperatorValueSelectOnLeft && operatorValueSelect}+ {showOperatorValueSelect &&+ placeOperatorValueSelectOnLeft &&+ (operatorValueSelect ?? defaultOperatorValueSelect)}{editable && propertyKeyEditable ? editablePicker : filterContent}- {showOperatorValueSelect && !placeOperatorValueSelectOnLeft && operatorValueSelect}+ {showOperatorValueSelect &&+ !placeOperatorValueSelectOnLeft &&+ (operatorValueSelect ?? defaultOperatorValueSelect)}</div></div>)}diff --git a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.tsindex be80f27dab9e..07cefa149847 100644--- a/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts+++ b/frontend/src/lib/components/PropertyFilters/components/taxonomicPropertyFilterLogic.ts@@ -23,6 +23,7 @@ import { eventUsageLogic } from 'lib/utils/eventUsageLogic'import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'import {AccountCustomPropertyFilter,+ AccountRelationshipPropertyFilter,AnyPropertyFilter,CohortPropertyFilter,EventMetadataPropertyFilter,@@ -245,6 +246,11 @@ export const taxonomicPropertyFilterLogic = kea<taxonomicPropertyFilterLogicType}// The key is the definition id (a UUID), so keep the human-readable name for display+ if (propertyType === PropertyFilterType.AccountRelationship && item?.name) {+ const accountRelationshipFilter = filter as unknown as AccountRelationshipPropertyFilter+ accountRelationshipFilter.label = item.name+ }+if (propertyType === PropertyFilterType.AccountCustomProperty && item?.name) {const accountCustomPropertyFilter = filter as AccountCustomPropertyFilteraccountCustomPropertyFilter.label = item.namediff --git a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.tsindex 9361b69a8ee6..991551648e0a 100644--- a/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts+++ b/frontend/src/lib/components/PropertyFilters/propertyFilterLogic.ts@@ -37,6 +37,7 @@ const TAXONOMIC_GROUP_TYPE_TO_DISPLAY_NAME: Partial<Record<TaxonomicFilterGroupT[TaxonomicFilterGroupType.ErrorTrackingIssues]: 'Error tracking issues',[TaxonomicFilterGroupType.RevenueAnalyticsProperties]: 'Revenue analytics',[TaxonomicFilterGroupType.AccountFields]: 'Account fields',+ [TaxonomicFilterGroupType.AccountRelationships]: 'Account relationships',[TaxonomicFilterGroupType.AccountCustomProperties]: 'Account custom properties',}diff --git a/frontend/src/lib/components/PropertyFilters/types.ts b/frontend/src/lib/components/PropertyFilters/types.tsindex 5be18a64046c..f9c55c110e23 100644--- a/frontend/src/lib/components/PropertyFilters/types.ts+++ b/frontend/src/lib/components/PropertyFilters/types.ts@@ -12,7 +12,14 @@ import {import { PropValue } from '~/models/propertyDefinitionsModel'import { AnyDataNode, DatabaseSchemaField } from '~/queries/schema/schema-general'-import { AnyPropertyFilter, FilterLogicalOperator, PropertyDefinition, PropertyGroupFilter } from '~/types'+import {+ AnyPropertyFilter,+ FilterLogicalOperator,+ PropertyDefinition,+ PropertyFilterValue,+ PropertyGroupFilter,+ PropertyOperator,+} from '~/types'export interface PropertyFilterBaseProps {pageKey: string@@ -81,6 +88,11 @@ export interface PropertyFilterInternalProps {* to the default behavior. See `PropertyValueProps.staticValues`.*/staticValueOptions?: (propertyKey: string) => PropValue[] | null+ /** Renders an alternate operator and value control for one filter type. */+ renderOperatorValueSelect?: (+ filter: AnyPropertyFilter,+ onChange: (operator: PropertyOperator, value: PropertyFilterValue) => void+ ) => JSX.Element | null/** Override the model's inferred definitions, e.g. for a polymorphic event property. */propertyDefinitionsOverride?: PropertyDefinition[]/** Keep the selected property key fixed while allowing operator/value edits. */diff --git a/frontend/src/lib/components/PropertyFilters/utils.ts b/frontend/src/lib/components/PropertyFilters/utils.tsindex 04073e4e389e..bc6cc17f8a21 100644--- a/frontend/src/lib/components/PropertyFilters/utils.ts+++ b/frontend/src/lib/components/PropertyFilters/utils.ts@@ -17,6 +17,7 @@ import { BreakdownFilter } from '~/queries/schema/schema-general'import { getCoreFilterDefinition } from '~/taxonomy/helpers'import {AccountCustomPropertyFilter,+ AccountRelationshipPropertyFilter,ActionType,AnyFilterLike,AnyPropertyFilter,@@ -124,6 +125,7 @@ export const PROPERTY_FILTER_TYPE_TO_TAXONOMIC_FILTER_GROUP_TYPE: Record<Propert[PropertyFilterType.Event]: TaxonomicFilterGroupType.EventProperties,[PropertyFilterType.InternalEvent]: TaxonomicFilterGroupType.EventProperties,[PropertyFilterType.Account]: TaxonomicFilterGroupType.AccountFields,+ [PropertyFilterType.AccountRelationship]: TaxonomicFilterGroupType.AccountRelationships,[PropertyFilterType.AccountCustomProperty]: TaxonomicFilterGroupType.AccountCustomProperties,[PropertyFilterType.EventMetadata]: TaxonomicFilterGroupType.EventMetadata,[PropertyFilterType.PersonMetadata]: TaxonomicFilterGroupType.PersonMetadata,@@ -334,6 +336,12 @@ export function isRevenueAnalyticsPropertyFilter(): filter is RevenueAnalyticsPropertyFilter {return filter?.type === PropertyFilterType.RevenueAnalytics}+export function isAccountRelationshipPropertyFilter(+ filter?: { type?: string } | null+): filter is AccountRelationshipPropertyFilter {+ return filter?.type === PropertyFilterType.AccountRelationship+}+export function isAccountCustomPropertyFilter(filter?: AnyFilterLike | null): filter is AccountCustomPropertyFilter {return filter?.type === PropertyFilterType.AccountCustomProperty}@@ -427,6 +435,7 @@ export function isAnyPropertyfilter(filter?: AnyFilterLike | null): filter is AnisPersonMetadataPropertyFilter(filter) ||isEventMetadataPropertyFilter(filter) ||isRevenueAnalyticsPropertyFilter(filter) ||+ isAccountRelationshipPropertyFilter(filter) ||isAccountCustomPropertyFilter(filter) ||isElementPropertyFilter(filter) ||isSessionPropertyFilter(filter) ||@@ -472,6 +481,7 @@ export function isPropertyFilterWithOperator(isPersonMetadataPropertyFilter(filter) ||isEventMetadataPropertyFilter(filter) ||isRevenueAnalyticsPropertyFilter(filter) ||+ isAccountRelationshipPropertyFilter(filter) ||isAccountCustomPropertyFilter(filter) ||isElementPropertyFilter(filter) ||isSessionPropertyFilter(filter) ||@@ -524,6 +534,7 @@ const propertyFilterMapping: Partial<Record<PropertyFilterType, TaxonomicFilterG[PropertyFilterType.SpanResourceAttribute]: TaxonomicFilterGroupType.SpanResourceAttributes,[PropertyFilterType.RevenueAnalytics]: TaxonomicFilterGroupType.RevenueAnalyticsProperties,[PropertyFilterType.Account]: TaxonomicFilterGroupType.AccountFields,+ [PropertyFilterType.AccountRelationship]: TaxonomicFilterGroupType.AccountRelationships,[PropertyFilterType.AccountCustomProperty]: TaxonomicFilterGroupType.AccountCustomProperties,[PropertyFilterType.Flag]: TaxonomicFilterGroupType.FeatureFlags,[PropertyFilterType.WorkflowVariable]: TaxonomicFilterGroupType.WorkflowVariables,@@ -582,6 +593,7 @@ export function propertyFilterTypeToPropertyDefinitionType([PropertyFilterType.SpanResourceAttribute]: PropertyDefinitionType.SpanResourceAttribute,[PropertyFilterType.RevenueAnalytics]: PropertyDefinitionType.RevenueAnalytics,[PropertyFilterType.Account]: PropertyDefinitionType.Account,+ [PropertyFilterType.AccountRelationship]: PropertyDefinitionType.AccountRelationship,[PropertyFilterType.AccountCustomProperty]: PropertyDefinitionType.AccountCustomProperty,[PropertyFilterType.Flag]: PropertyDefinitionType.FlagValue,[PropertyFilterType.WorkflowVariable]: PropertyDefinitionType.WorkflowVariable,diff --git a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsxindex 88ea93961529..2e054b789244 100644--- a/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/taxonomicFilterLogic.tsx@@ -1372,6 +1372,15 @@ export const taxonomicFilterLogic = kea<taxonomicFilterLogicType>([getValue: (option: PropertyDefinition) => option.id,getPopoverHeader: () => 'Account field',},+ {+ name: 'Account relationships',+ searchPlaceholder: 'account relationships',+ type: TaxonomicFilterGroupType.AccountRelationships,+ getIcon: getAccountFieldDefinitionIcon,+ getName: (option: PropertyDefinition) => option.name,+ getValue: (option: PropertyDefinition) => option.id,+ getPopoverHeader: () => 'Account relationship',+ },{name: 'Account custom properties',searchPlaceholder: 'account custom properties',diff --git a/frontend/src/lib/components/TaxonomicFilter/types.ts b/frontend/src/lib/components/TaxonomicFilter/types.tsindex 5233aeeb90a7..143e1d203423 100644--- a/frontend/src/lib/components/TaxonomicFilter/types.ts+++ b/frontend/src/lib/components/TaxonomicFilter/types.ts@@ -345,6 +345,7 @@ export enum TaxonomicFilterGroupType {ReplaySavedFilters = 'replay_saved_filters',RevenueAnalyticsProperties = 'revenue_analytics_properties',AccountFields = 'account_fields',+ AccountRelationships = 'account_relationships',AccountCustomProperties = 'account_custom_properties',Resources = 'resources',ErrorTrackingProperties = 'error_tracking_properties',diff --git a/frontend/src/lib/components/TaxonomicFilter/utils/buildTaxonomicGroups.tsx b/frontend/src/lib/components/TaxonomicFilter/utils/buildTaxonomicGroups.tsxindex 6b9b949d20a3..251740bf413f 100644--- a/frontend/src/lib/components/TaxonomicFilter/utils/buildTaxonomicGroups.tsx+++ b/frontend/src/lib/components/TaxonomicFilter/utils/buildTaxonomicGroups.tsx@@ -545,6 +545,15 @@ export function buildTaxonomicGroups(ctx: BuildTaxonomicGroupsContext): TaxonomigetValue: (option: PropertyDefinition) => option.id,getPopoverHeader: () => 'Account field',},+ {+ name: 'Account relationships',+ searchPlaceholder: 'account relationships',+ type: TaxonomicFilterGroupType.AccountRelationships,+ getIcon: getAccountFieldDefinitionIcon,+ getName: (option: PropertyDefinition) => option.name,+ getValue: (option: PropertyDefinition) => option.id,+ getPopoverHeader: () => 'Account relationship',+ },{name: 'Account custom properties',searchPlaceholder: 'account custom properties',diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex e49ad75d7259..21124a353109 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -553,6 +553,9 @@{"$ref": "#/definitions/AccountsTableUnassignedFilter"},+ {+ "$ref": "#/definitions/AccountsTableRelationshipFilter"+ },{"$ref": "#/definitions/AccountsTableAccountIdFilter"},@@ -759,6 +762,33 @@"required": ["kind", "definitionId"],"type": "object"},+ "AccountsTableRelationshipFilter": {+ "additionalProperties": false,+ "properties": {+ "definitionId": {+ "type": "string"+ },+ "kind": {+ "const": "relationship",+ "type": "string"+ },+ "operator": {+ "$ref": "#/definitions/AccountsTableRelationshipOperator"+ },+ "userIds": {+ "items": {+ "$ref": "#/definitions/integer"+ },+ "type": "array"+ }+ },+ "required": ["kind", "definitionId", "operator"],+ "type": "object"+ },+ "AccountsTableRelationshipOperator": {+ "enum": ["exact", "is_not", "is_set", "is_not_set"],+ "type": "string"+ },"AccountsTableRow": {"additionalProperties": false,"properties": {@@ -39990,6 +40020,7 @@"error_tracking_issue","revenue_analytics","account",+ "account_relationship","account_custom_property","flag","log",@@ -53291,6 +53322,7 @@"replay_saved_filters","revenue_analytics_properties","account_fields",+ "account_relationships","account_custom_properties","resources","error_tracking_properties",diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex da0c7ca4295c..53aaed6c8bb0 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -3043,6 +3043,20 @@ export interface AccountsTableUnassignedFilter {kind: 'unassigned'}+export enum AccountsTableRelationshipOperator {+ Exact = 'exact',+ IsNot = 'is_not',+ IsSet = 'is_set',+ IsNotSet = 'is_not_set',+}++export interface AccountsTableRelationshipFilter {+ kind: 'relationship'+ definitionId: string+ operator: AccountsTableRelationshipOperator+ userIds?: integer[]+}+export interface AccountsTableAccountIdFilter {kind: 'account_id'accountId: string@@ -3103,6 +3117,7 @@ export type AccountsTableFilter =| AccountsTableAssignedToFilter| AccountsTableAssignedFilter| AccountsTableUnassignedFilter+ | AccountsTableRelationshipFilter| AccountsTableAccountIdFilter| AccountsTableAccountFieldFilter| AccountsTableCustomPropertyFilterdiff --git a/frontend/src/scenes/insights/filters/BreakdownFilter/taxonomicBreakdownFilterLogic.ts b/frontend/src/scenes/insights/filters/BreakdownFilter/taxonomicBreakdownFilterLogic.tsindex 996449b49f50..334d5a923fdb 100644--- a/frontend/src/scenes/insights/filters/BreakdownFilter/taxonomicBreakdownFilterLogic.ts+++ b/frontend/src/scenes/insights/filters/BreakdownFilter/taxonomicBreakdownFilterLogic.ts@@ -123,6 +123,7 @@ export interface taxonomicBreakdownFilterLogicValues {| TaxonomicFilterGroupType.ReplaySavedFilters| TaxonomicFilterGroupType.RevenueAnalyticsProperties| TaxonomicFilterGroupType.AccountFields+ | TaxonomicFilterGroupType.AccountRelationships| TaxonomicFilterGroupType.AccountCustomProperties| TaxonomicFilterGroupType.Resources| TaxonomicFilterGroupType.ErrorTrackingProperties@@ -289,6 +290,7 @@ export interface taxonomicBreakdownFilterLogicMeta {| TaxonomicFilterGroupType.ReplaySavedFilters| TaxonomicFilterGroupType.RevenueAnalyticsProperties| TaxonomicFilterGroupType.AccountFields+ | TaxonomicFilterGroupType.AccountRelationships| TaxonomicFilterGroupType.AccountCustomProperties| TaxonomicFilterGroupType.Resources| TaxonomicFilterGroupType.ErrorTrackingPropertiesdiff --git a/frontend/src/types.ts b/frontend/src/types.tsindex dfad12210be4..6612b774530d 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -1180,6 +1180,8 @@ export enum PropertyFilterType {ErrorTrackingIssue = 'error_tracking_issue',RevenueAnalytics = 'revenue_analytics',Account = 'account',+ /** Customer analytics account relationship — the key is the relationship definition id */+ AccountRelationship = 'account_relationship',/** Customer analytics account custom property — the key is the property definition id */AccountCustomProperty = 'account_custom_property',/** Feature flag dependency */@@ -1220,6 +1222,11 @@ export interface RevenueAnalyticsPropertyFilter extends BasePropertyFilter {operator: PropertyOperator}+export interface AccountRelationshipPropertyFilter extends BasePropertyFilter {+ type: PropertyFilterType.AccountRelationship+ operator: PropertyOperator+}+export interface AccountCustomPropertyFilter extends BasePropertyFilter {type: PropertyFilterType.AccountCustomPropertyoperator: PropertyOperator@@ -4862,6 +4869,7 @@ export enum PropertyDefinitionType {EventMetadata = 'event_metadata',RevenueAnalytics = 'revenue_analytics',Account = 'account',+ AccountRelationship = 'account_relationship',AccountCustomProperty = 'account_custom_property',Person = 'person',PersonMetadata = 'person_metadata',diff --git a/posthog/schema.py b/posthog/schema.pyindex 1cd86cd6cfa2..1df30fdccaf6 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -17,6 +17,7 @@ from posthog.schema_enums import (AccountsTableAccountFieldOperator as AccountsTableAccountFieldOperator,AccountsTableAggregation as AccountsTableAggregation,AccountsTableCustomPropertyOperator as AccountsTableCustomPropertyOperator,+ AccountsTableRelationshipOperator as AccountsTableRelationshipOperator,AccountsTableSortDirection as AccountsTableSortDirection,AccountsTableThresholdOperator as AccountsTableThresholdOperator,Action as Action,@@ -3232,6 +3233,16 @@ class AccountsTableCustomPropertyFilter(BaseModel):)+class AccountsTableRelationshipFilter(BaseModel):+ model_config = ConfigDict(+ extra="forbid",+ )+ definitionId: str+ kind: Literal["relationship"] = "relationship"+ operator: AccountsTableRelationshipOperator+ userIds: list[int] | None = None++class AccountsTableRow(BaseModel):model_config = ConfigDict(extra="forbid",@@ -24781,6 +24792,7 @@ class AccountsTableQuery(BaseModel):| AccountsTableAssignedToFilter| AccountsTableAssignedFilter| AccountsTableUnassignedFilter+ | AccountsTableRelationshipFilter| AccountsTableAccountIdFilter| AccountsTableAccountFieldFilter| AccountsTableCustomPropertyFilterdiff --git a/posthog/schema_enums.py b/posthog/schema_enums.pyindex b29e801e2052..838823c70cbd 100644--- a/posthog/schema_enums.py+++ b/posthog/schema_enums.py@@ -89,6 +89,13 @@ class AccountsTableCustomPropertyOperator(StrEnum):IS_DATE_AFTER = "is_date_after"+class AccountsTableRelationshipOperator(StrEnum):+ EXACT = "exact"+ IS_NOT = "is_not"+ IS_SET = "is_set"+ IS_NOT_SET = "is_not_set"++class AccountsTableSortDirection(StrEnum):ASC = "asc"DESC = "desc"@@ -3709,6 +3716,7 @@ class PropertyFilterType(StrEnum):ERROR_TRACKING_ISSUE = "error_tracking_issue"REVENUE_ANALYTICS = "revenue_analytics"ACCOUNT = "account"+ ACCOUNT_RELATIONSHIP = "account_relationship"ACCOUNT_CUSTOM_PROPERTY = "account_custom_property"FLAG = "flag"LOG = "log"@@ -4137,6 +4145,7 @@ class TaxonomicFilterGroupType(StrEnum):REPLAY_SAVED_FILTERS = "replay_saved_filters"REVENUE_ANALYTICS_PROPERTIES = "revenue_analytics_properties"ACCOUNT_FIELDS = "account_fields"+ ACCOUNT_RELATIONSHIPS = "account_relationships"ACCOUNT_CUSTOM_PROPERTIES = "account_custom_properties"RESOURCES = "resources"ERROR_TRACKING_PROPERTIES = "error_tracking_properties"diff --git a/products/customer_analytics/backend/facade/api.py b/products/customer_analytics/backend/facade/api.pyindex d7e6d8b79b68..9b4317ff320a 100644--- a/products/customer_analytics/backend/facade/api.py+++ b/products/customer_analytics/backend/facade/api.py@@ -2715,6 +2715,9 @@ def _validate_account_table_definitions(sort: contracts.AccountTableSort | None,) -> dict[UUID, DisplayType]:relationship_ids = set(selection.relationship_definition_ids)+ relationship_ids.update(+ filter_.definition_id for filter_ in filters if isinstance(filter_, contracts.AccountTableRelationshipFilter)+ )if sort and sort.kind == contracts.AccountTableSortKind.RELATIONSHIP:if sort.definition_id is None:raise InvalidAccountTableColumn("Relationship sorting requires a definition.")diff --git a/products/customer_analytics/backend/facade/contracts.py b/products/customer_analytics/backend/facade/contracts.pyindex 126489cad223..290b8f279019 100644--- a/products/customer_analytics/backend/facade/contracts.py+++ b/products/customer_analytics/backend/facade/contracts.py@@ -237,6 +237,20 @@ class AccountTableUnassignedFilter:pass+class AccountTableRelationshipOperator(str, Enum):+ EXACT = "exact"+ IS_NOT = "is_not"+ IS_SET = "is_set"+ IS_NOT_SET = "is_not_set"+++@dataclass(frozen=True, kw_only=True)+class AccountTableRelationshipFilter:+ definition_id: UUID+ operator: AccountTableRelationshipOperator+ user_ids: tuple[int, ...] = ()++@dataclass(frozen=True, kw_only=True)class AccountTableAccountIdFilter:account_id: UUID@@ -292,6 +306,7 @@ AccountTableFilter = (| AccountTableAssignedToFilter| AccountTableAssignedFilter| AccountTableUnassignedFilter+ | AccountTableRelationshipFilter| AccountTableAccountIdFilter| AccountTableFieldFilter| AccountTableCustomPropertyFilterdiff --git a/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py b/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.pyindex 4d5b742aa92d..cded9b7f249b 100644--- a/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/accounts_table_query_runner.py@@ -20,6 +20,7 @@ from posthog.schema import (AccountsTableQuery,AccountsTableQueryResponse,AccountsTableRelationshipColumn,+ AccountsTableRelationshipFilter,AccountsTableRow,AccountsTableSearchFilter,AccountsTableTagsColumn,@@ -112,10 +113,12 @@ class AccountsTableQueryRunner(AnalyticsQueryRunner[AccountsTableQueryResponse])f"Account table filter strings support up to {ACCOUNTS_TABLE_MAX_STRING_LENGTH} characters.")filter_values = (- filter_.tagNames+ filter_.tagNames or []if isinstance(filter_, AccountsTableTagsFilter)- else filter_.userIds+ else filter_.userIds or []if isinstance(filter_, AccountsTableAssignedToFilter)+ else filter_.userIds or []+ if isinstance(filter_, AccountsTableRelationshipFilter)else filter_.values or []if isinstance(filter_, AccountsTableAccountFieldFilter | AccountsTableCustomPropertyFilter)else []@@ -140,6 +143,14 @@ class AccountsTableQueryRunner(AnalyticsQueryRunner[AccountsTableQueryResponse])filters.append(contracts.AccountTableAssignedFilter())elif isinstance(filter_, AccountsTableUnassignedFilter):filters.append(contracts.AccountTableUnassignedFilter())+ elif isinstance(filter_, AccountsTableRelationshipFilter):+ filters.append(+ contracts.AccountTableRelationshipFilter(+ definition_id=UUID(filter_.definitionId),+ operator=contracts.AccountTableRelationshipOperator(filter_.operator.value),+ user_ids=tuple(filter_.userIds or ()),+ )+ )elif isinstance(filter_, AccountsTableAccountIdFilter):filters.append(contracts.AccountTableAccountIdFilter(account_id=UUID(filter_.accountId)))elif isinstance(filter_, AccountsTableAccountFieldFilter):diff --git a/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py b/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.pyindex 4fad82957f34..9f05ed2d7c59 100644--- a/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py+++ b/products/customer_analytics/backend/hogql_queries/test/test_accounts_table_query_runner.py@@ -31,6 +31,8 @@ from posthog.schema import (AccountsTableQuery,AccountsTableQueryResponse,AccountsTableRelationshipColumn,+ AccountsTableRelationshipFilter,+ AccountsTableRelationshipOperator,AccountsTableSearchFilter,AccountsTableSort,AccountsTableSortDirection,@@ -446,6 +448,41 @@ class TestAccountsTableQueryRunner(BaseTest):assert [row.id for row in response.results] == [str(active_account.id)]assert str(untagged_account.id) not in {row.id for row in response.results}+ def test_filters_by_relationship_definition_and_user(self) -> None:+ csm_account = create_account(team_id=self.team.id, name="CSM")+ ae_account = create_account(team_id=self.team.id, name="AE")+ csm_definition = AccountRelationshipDefinition.objects.unscoped().create(team=self.team, name="CSM")+ ae_definition = AccountRelationshipDefinition.objects.unscoped().create(+ team=self.team, name="Account executive"+ )+ AccountRelationship.objects.unscoped().create(+ team=self.team,+ account=csm_account,+ definition=csm_definition,+ user=self.user,+ )+ AccountRelationship.objects.unscoped().create(+ team=self.team,+ account=ae_account,+ definition=ae_definition,+ user=self.user,+ )++ response = self._run(+ AccountsTableQuery(+ columns=[],+ filters=[+ AccountsTableRelationshipFilter(+ definitionId=str(csm_definition.id),+ operator=AccountsTableRelationshipOperator.EXACT,+ userIds=[self.user.id],+ )+ ],+ )+ )++ assert [row.id for row in response.results] == [str(csm_account.id)]+def test_unassigned_and_account_id_filters(self) -> None:assigned_account = create_account(team_id=self.team.id, name="Assigned")unassigned_account = create_account(team_id=self.team.id, name="Unassigned")diff --git a/products/customer_analytics/backend/logic/account_filters.py b/products/customer_analytics/backend/logic/account_filters.pyindex 03f7278a2491..980bfcb6d894 100644--- a/products/customer_analytics/backend/logic/account_filters.py+++ b/products/customer_analytics/backend/logic/account_filters.py@@ -283,6 +283,20 @@ def apply_account_filters(queryset = queryset.filter(Exists(active_relationships))elif isinstance(filter_, contracts.AccountTableUnassignedFilter):queryset = queryset.filter(~Exists(active_relationships))+ elif isinstance(filter_, contracts.AccountTableRelationshipFilter):+ relationship = active_relationships.filter(definition_id=filter_.definition_id)+ if filter_.operator == contracts.AccountTableRelationshipOperator.IS_SET:+ queryset = queryset.filter(Exists(relationship))+ elif filter_.operator == contracts.AccountTableRelationshipOperator.IS_NOT_SET:+ queryset = queryset.filter(~Exists(relationship))+ elif filter_.operator == contracts.AccountTableRelationshipOperator.EXACT:+ if not filter_.user_ids:+ raise InvalidAccountFilter("Relationship filters require at least one user.")+ queryset = queryset.filter(Exists(relationship.filter(user_id__in=filter_.user_ids)))+ elif filter_.operator == contracts.AccountTableRelationshipOperator.IS_NOT:+ if not filter_.user_ids:+ raise InvalidAccountFilter("Relationship filters require at least one user.")+ queryset = queryset.filter(~Exists(relationship.filter(user_id__in=filter_.user_ids)))elif isinstance(filter_, contracts.AccountTableAccountIdFilter):queryset = queryset.filter(id=filter_.account_id)elif isinstance(filter_, contracts.AccountTableFieldFilter):diff --git a/products/customer_analytics/frontend/components/Accounts/AGENTS.md b/products/customer_analytics/frontend/components/Accounts/AGENTS.mdindex 2aa09cc5096a..923a0ec053f0 100644--- a/products/customer_analytics/frontend/components/Accounts/AGENTS.md+++ b/products/customer_analytics/frontend/components/Accounts/AGENTS.md@@ -21,7 +21,7 @@ AccountsTabContent ── binds dataNodeLogic(ACCOUNTS_TABLE_DATA_NODE_KEY, acc└─ binds dataNodeLogic(ACCOUNTS_METRICS_DATA_NODE_KEY, accountsLogic.metricsQuery) [overview tiles, metrics-only]├── AccountsMaxTools registers the `open_account` Max contextual tool → accountsLogic.openAccount├── AccountsTabFilters two rows: (1) search + Refresh; (2) tags / "assigned to" (incl. unassigned-only) /-│ "my accounts" / native-field and custom-property filters on the left,+│ "my accounts" / native-field, relationship, and custom-property filters on the left,│ AccountsOverviewTilesButton + AccountsColumnConfigurator on the right├── AccountsOverviewTiles metric tiles across the filtered set└── AccountsTable the DataTable; keyed row renderers; controlled row expansion@@ -42,7 +42,7 @@ AccountsTabContent ── binds dataNodeLogic(ACCOUNTS_TABLE_DATA_NODE_KEY, acc| Logic | Owns || ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| `accountsLogic` | The hub. Search (debounced), tag / assigned-to/unassigned / native-field / custom-property filters, sort, inline role assignment, typed Postgres list and metrics queries, shareable URL-hash view state, and `openAccount` (the Max entry point). `accountsTableQueryPlan` translates live, saved-view, and URL-restored state into typed references. `connect`s column-config, overview-tiles, and expansion logics. |+| `accountsLogic` | The hub. Search (debounced), tag / assigned-to/unassigned / native-field / relationship / custom-property filters, sort, inline role assignment, typed Postgres list and metrics queries, shareable URL-hash view state, and `openAccount` (the Max entry point). `accountsTableQueryPlan` translates live, saved-view, and URL-restored state into typed references. `connect`s column-config, overview-tiles, and expansion logics. || `accountsViewsLogic` | Saved-views lifecycle (list/create/update/delete/select). Connects to `accountsLogic`, `accountsColumnConfigLogic`, and `accountsOverviewTilesLogic`; is the single owner of reading and writing the `ColumnConfiguration` rows for this area. || `accountsColumnConfigLogic` | Selected columns (`selectColumns` / `visibleColumnNames`), Postgres-backed column-picker groups, the per-team saved column config (`columnConfigurations` API), and custom-property definitions. It seeds `propertyDefinitionsModel` so the filter UI resolves per-type operator sets. Warehouse-backed columns and SQL expressions are not offered. || `accountsExpansionLogic` | Which rows are expanded (`expandedAccountIds`) and the active tab per account (`activeTabByAccount`). Pure state — no DOM, no data fetching. |@@ -97,11 +97,12 @@ The Postgres runner returns `{ timestamp, value }` history points ascending (witFewer than 2 in-window points falls back to rendering the latest value plainly.The config persists per view via `ColumnConfiguration.properties.column_display` (round-tripped in `accountsViewState.ts`), and sorting uses the scalar custom property even when the displayed cell loads history.-**Account filters** use one shared `PropertyFilters` control with two groups: native Account fields and Account custom properties.+**Account filters** use one shared `PropertyFilters` control with three groups: native Account fields, Account relationships, and Account custom properties.+Relationship options come from the team's relationship definitions. They use the shared member picker and support matching a specific member, excluding a member, and checking whether a relationship is assigned.Native fields cover names, external and connection IDs, created and updated timestamps, and the `churned_at` and `ignored_at` lifecycle timestamps. Text fields support exact, negative, contains, and set operators. Timestamp fields support exact date, before, after, and set operators. A lifecycle timestamp filter includes that normally hidden state before applying its predicate, so `Ignored at is set` returns ignored accounts while an unfiltered list still hides them.Custom property options come from `accountsColumnConfigLogic.customPropertyTaxonomicOptions` via `optionsFromProp`. The filter `key` is the stable definition ID, and the definition name rides on the filter's `label` for display.Operator sets honor each field's type because `accountsColumnConfigLogic` seeds `propertyDefinitionsModel` under `PropertyDefinitionType.Account` and `PropertyDefinitionType.AccountCustomProperty`. The dropdown is narrowed to operators the Postgres runner supports. Regex and negative regex operators are not available.-`accountsTableQuery.ts` translates both filter kinds into typed query filters. The backend filters native model or JSON fields directly and chooses custom-property storage from the definition type. Negative operators include accounts where the value is unset. Invalid native combinations and deleted or incompatible custom properties are omitted rather than changing query engines.+`accountsTableQuery.ts` translates all three filter kinds into typed query filters. The backend filters relationships through active assignments, native model or JSON fields directly, and custom properties through storage chosen from the definition type. Negative operators include accounts where the value is unset. Invalid native combinations and deleted or incompatible custom properties are omitted rather than changing query engines.Custom property value suggestions load from `GET /api/projects/:team_id/custom_property_definitions/values/?key=<definition-id>&value=<search>`. Native account fields do not fetch suggestions.**Overview tile math** (`accountsOverviewTilesLogic` / `AccountsOverviewTilesEditor`). A tile's metric is a discriminated union: `count`, the column aggregations `sum`/`avg`/`min`/`max`/`median`, and `count_threshold`. `tileQueryMetric` translates these into the typed `AccountsTableMetric` union. Column aggregations carry an optional `scale` multiplier, and threshold tiles translate into typed custom-property filters when clicked.diff --git a/products/customer_analytics/frontend/components/Accounts/AccountRelationshipOperatorValueSelect.tsx b/products/customer_analytics/frontend/components/Accounts/AccountRelationshipOperatorValueSelect.tsxnew file mode 100644index 000000000000..f21b5f334bbb--- /dev/null+++ b/products/customer_analytics/frontend/components/Accounts/AccountRelationshipOperatorValueSelect.tsx@@ -0,0 +1,54 @@+import { MemberSelectMultiple } from 'lib/components/MemberSelectMultiple'+import { OperatorSelect } from 'lib/components/PropertyFilters/components/OperatorValueSelect'+import { isOperatorFlag } from 'lib/utils/operators'++import { PropertyFilterValue, PropertyOperator } from '~/types'++import type { AccountRelationshipFilter } from './accountsPropertyFilters'++const RELATIONSHIP_FILTER_OPERATORS = [+ PropertyOperator.Exact,+ PropertyOperator.IsNot,+ PropertyOperator.IsSet,+ PropertyOperator.IsNotSet,+]++export function AccountRelationshipOperatorValueSelect({+ filter,+ onChange,+}: {+ filter: AccountRelationshipFilter+ onChange: (operator: PropertyOperator, value: PropertyFilterValue) => void+}): JSX.Element {+ const operator = filter.operator ?? PropertyOperator.Exact+ const userIds = (Array.isArray(filter.value) ? filter.value : [filter.value]).filter(+ (value): value is number => typeof value === 'number'+ )++ return (+ <>+ <div data-attr="taxonomic-operator">+ <OperatorSelect+ operator={operator}+ operators={RELATIONSHIP_FILTER_OPERATORS}+ onChange={(nextOperator) => onChange(nextOperator, isOperatorFlag(nextOperator) ? null : userIds)}+ size="small"+ />+ </div>+ {!isOperatorFlag(operator) && (+ <div className="shrink grow-[1000] min-w-[10rem] overflow-hidden" data-attr="taxonomic-value-select">+ <MemberSelectMultiple+ idKey="id"+ value={userIds}+ onChange={(users) =>+ onChange(+ operator,+ users.map((user) => user.id)+ )+ }+ />+ </div>+ )}+ </>+ )+}diff --git a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsxindex c07b8c52c806..5d5fc1c6e47c 100644--- a/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx+++ b/products/customer_analytics/frontend/components/Accounts/AccountsTabFilters.tsx@@ -18,6 +18,7 @@ import { tagsModel } from '~/models/tagsModel'import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'import type { AnyPropertyFilter } from '~/types'+import { AccountRelationshipOperatorValueSelect } from './AccountRelationshipOperatorValueSelect'import { accountsColumnConfigLogic } from './accountsColumnConfigLogic'import { AccountsColumnConfigurator } from './AccountsColumnConfigurator'import { accountsLogic, RoleFilterValue } from './accountsLogic'@@ -26,6 +27,7 @@ import {ACCOUNT_FIELD_TAXONOMIC_OPTIONS,ACCOUNT_FILTER_OPERATOR_ALLOWLIST,accountFilterStaticValueOptions,+ isAccountRelationshipFilter,type AccountFilter,} from './accountsPropertyFilters'import { AccountsViewSelector } from './AccountsViewSelector'@@ -45,7 +47,7 @@ export function AccountsTabFilters(): JSX.Element {reportFilterChange,} = useActions(accountsLogic)const { tags: tagsAvailable } = useValues(tagsModel)- const { customPropertyTaxonomicOptions } = useValues(accountsColumnConfigLogic)+ const { customPropertyTaxonomicOptions, relationshipTaxonomicOptions } = useValues(accountsColumnConfigLogic)const tagsButtonLabel =tagsFilter.length === 0 ? 'All tags' : tagsFilter.length === 1 ? tagsFilter[0] : `${tagsFilter.length} tags`@@ -146,14 +148,21 @@ export function AccountsTabFilters(): JSX.Element {pageKey="customer-analytics-accounts-custom-properties"taxonomicGroupTypes={[TaxonomicFilterGroupType.AccountFields,+ TaxonomicFilterGroupType.AccountRelationships,TaxonomicFilterGroupType.AccountCustomProperties,]}taxonomicFilterOptionsFromProp={{[TaxonomicFilterGroupType.AccountFields]: ACCOUNT_FIELD_TAXONOMIC_OPTIONS,+ [TaxonomicFilterGroupType.AccountRelationships]: relationshipTaxonomicOptions,[TaxonomicFilterGroupType.AccountCustomProperties]: customPropertyTaxonomicOptions,}}operatorAllowlist={ACCOUNT_FILTER_OPERATOR_ALLOWLIST}staticValueOptions={accountFilterStaticValueOptions}+ renderOperatorValueSelect={(filter, onChange) =>+ isAccountRelationshipFilter(filter) ? (+ <AccountRelationshipOperatorValueSelect filter={filter} onChange={onChange} />+ ) : null+ }buttonSize="small"hasRowOperator={false}/>diff --git a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.tsindex e22242bf6042..829764a9f0b4 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsColumnConfigLogic.ts@@ -363,8 +363,13 @@ export interface accountsColumnConfigLogicValues {pickerSearchPlaceholder: stringquerySelectColumns: string[]relationshipDefinitions: AccountRelationshipDefinitionApi[]+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi>relationshipDefinitionsLoaded: booleanrelationshipDefinitionsLoading: boolean+ relationshipTaxonomicOptions: (SimpleOption & {+ id: string+ property_type: PropertyType+ })[]roleKeyToDefinition: Partial<Record<AccountRoleKey, AccountRelationshipDefinitionApi>>selectColumns: string[]visibleColumnNames: string[]@@ -501,6 +506,13 @@ export interface accountsColumnConfigLogicMeta {aliasToDefinition: (customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi>) => Record<string, CustomPropertyDefinitionApi>+ relationshipDefinitionsById: (+ relationshipDefinitions: AccountRelationshipDefinitionApi[]+ ) => Record<string, AccountRelationshipDefinitionApi>+ relationshipTaxonomicOptions: (relationshipDefinitions: AccountRelationshipDefinitionApi[]) => (SimpleOption & {+ id: string+ property_type: PropertyType+ })[]customPropertyTaxonomicOptions: (customPropertyDefinitions: CustomPropertyDefinitionApi[]) => (SimpleOption & {description?: stringid: string@@ -758,6 +770,27 @@ export const accountsColumnConfigLogic = kea<accountsColumnConfigLogicType>([])),],+ relationshipDefinitionsById: [+ (s) => [s.relationshipDefinitions],+ (+ relationshipDefinitions: AccountRelationshipDefinitionApi[]+ ): Record<string, AccountRelationshipDefinitionApi> =>+ Object.fromEntries(relationshipDefinitions.map((definition) => [definition.id, definition])),+ ],+ relationshipTaxonomicOptions: [+ (s) => [s.relationshipDefinitions],+ (+ relationshipDefinitions: AccountRelationshipDefinitionApi[]+ ): (SimpleOption & {+ id: string+ property_type: PropertyType+ })[] =>+ relationshipDefinitions.map((definition) => ({+ id: definition.id,+ name: definition.name,+ property_type: PropertyType.Assignee,+ })),+ ],// Items for the custom-properties taxonomic group (fed via `optionsFromProp`): the// definition id is the stable filter key, the name is what's displayed and searched.customPropertyTaxonomicOptions: [@@ -811,6 +844,14 @@ export const accountsColumnConfigLogic = kea<accountsColumnConfigLogicType>([// Customized columns (user edits, saved view, shared URL) no longer equal the// default they diverged from, so only still-default columns get upgraded.loadRelationshipDefinitionsSuccess: (_, __, ___, previousState) => {+ updatePropertyDefinitions(+ Object.fromEntries(+ values.relationshipTaxonomicOptions.map((option) => [+ `${PropertyDefinitionType.AccountRelationship}/${option.id}`,+ { id: option.id, name: option.id, property_type: option.property_type },+ ])+ )+ )const previousDefault = selectors.defaultSelectColumns(previousState)if (objectsEqual(values.selectColumns, previousDefault) &&diff --git a/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.tsindex 6f3621282876..1ed8ff1f2408 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsLogic.test.ts@@ -7,6 +7,7 @@ import posthog from 'posthog-js'import { urls } from 'scenes/urls'import { userLogic } from 'scenes/userLogic'+import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'import {AccountsTableAccountField,AccountsTableAccountFieldOperator,@@ -140,6 +141,7 @@ describe('accountsLogic', () => {afterEach(() => {logic.unmount()localStorage.clear()+ resumeKeaLoadersErrors()})it('starts with empty filters', () => {@@ -280,6 +282,31 @@ describe('accountsLogic', () => {expect(logic.values.metricsQuery).not.toBeNull()})+ it('removes relationship filters when relationship definitions fail to load', async () => {+ logic.unmount()+ silenceKeaLoadersErrors()+ mockDefinitionsList.mockRejectedValueOnce(new Error('network'))+ logic = accountsLogic()+ logic.mount()++ logic.actions.updateAccountFilters([+ {+ type: PropertyFilterType.AccountRelationship,+ key: CSM_DEFINITION_ID,+ operator: PropertyOperator.Exact,+ value: [42],+ },+ ])++ await expectLogic(accountsColumnConfigLogic.findMounted()!).toFinishAllListeners()++ expect(logic.values.accountFilters).toEqual([])+ expect(logic.values.accountsQuerySource?.filters).not.toContainEqual(+ expect.objectContaining({ kind: 'relationship' })+ )+ expect(logic.values.activeFilterCount).toBe(0)+ })+it('keeps overview metrics off the list query', () => {expect(logic.values.accountsQuerySource?.metrics).toBeUndefined()})diff --git a/products/customer_analytics/frontend/components/Accounts/accountsLogic.ts b/products/customer_analytics/frontend/components/Accounts/accountsLogic.tsindex 23cc4d15bef5..cc1a5cf907b0 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsLogic.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsLogic.ts@@ -147,6 +147,7 @@ export interface accountsLogicValues {customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi> // accountsColumnConfigLogicdefaultSelectColumns: string[] // accountsColumnConfigLogicquerySelectColumns: string[] // accountsColumnConfigLogic+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi> // accountsColumnConfigLogicrelationshipDefinitionsLoaded: boolean // accountsColumnConfigLogicselectColumns: string[] // accountsColumnConfigLogicvisibleColumnNames: string[] // accountsColumnConfigLogic@@ -193,6 +194,20 @@ export interface accountsLogicActions {customPropertyDefinitions: CustomPropertyDefinitionApi[]payload?: any} // accountsColumnConfigLogic+ loadRelationshipDefinitionsFailure: (+ error: string,+ errorObject?: any+ ) => {+ error: string+ errorObject?: any+ } // accountsColumnConfigLogic+ loadRelationshipDefinitionsSuccess: (+ relationshipDefinitions: AccountRelationshipDefinitionApi[],+ payload?: any+ ) => {+ payload?: any+ relationshipDefinitions: AccountRelationshipDefinitionApi[]+ } // accountsColumnConfigLogicmoveColumn: (oldIndex: number,newIndex: number@@ -411,6 +426,7 @@ export interface accountsLogicMeta {accountIdFilter: string | null,tileFilter: TileFilter | null,accountFilters: AccountFilter[],+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi>,customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi>,columnDisplay: AccountColumnDisplayState,sortOrder: AccountSortOrder,@@ -458,6 +474,7 @@ export const accountsLogic = kea<accountsLogicType>(['querySelectColumns','aliasToRelationshipDefinition','aliasToDefinition',+ 'relationshipDefinitionsById','relationshipDefinitionsLoaded','customPropertyDefinitionsById','columnDisplay',@@ -473,6 +490,8 @@ export const accountsLogic = kea<accountsLogicType>([accountsColumnConfigLogic,['loadCustomPropertyDefinitionsSuccess',+ 'loadRelationshipDefinitionsSuccess',+ 'loadRelationshipDefinitionsFailure','setSelectColumns','selectColumn','unselectColumn',@@ -782,6 +801,7 @@ export const accountsLogic = kea<accountsLogicType>([s.accountIdFilter,s.tileFilter,s.accountFilters,+ s.relationshipDefinitionsById,s.customPropertyDefinitionsById,s.columnDisplay,s.sortOrder,@@ -797,6 +817,7 @@ export const accountsLogic = kea<accountsLogicType>([accountIdFilter: string | null,tileFilter: TileFilter | null,accountFilters: AccountFilter[],+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi>,customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi>,columnDisplay: AccountColumnDisplayState,sortOrder: AccountSortOrder,@@ -811,6 +832,7 @@ export const accountsLogic = kea<accountsLogicType>([accountIdFilter,tileFilter,accountFilters,+ relationshipDefinitionsById,customPropertyDefinitionsById,columnDisplay,sortOrder,@@ -864,33 +886,72 @@ export const accountsLogic = kea<accountsLogicType>([listeners(({ actions, values, cache, selectors }) => ({loadCustomPropertyDefinitionsSuccess: ({ customPropertyDefinitions }) => {cache.customPropertyDefinitionsLoaded = true+ if (!cache.relationshipDefinitionsLoaded) {+ return+ }const definitionsById = Object.fromEntries(customPropertyDefinitions.map((definition) => [definition.id, definition]))- const supportedFilters = supportedAccountFilters(values.accountFilters, definitionsById)+ const supportedFilters = supportedAccountFilters(+ values.accountFilters,+ definitionsById,+ values.relationshipDefinitionsById+ )if (!objectsEqual(supportedFilters, values.accountFilters)) {actions.setAccountFilters(supportedFilters)}},- setAccountFilters: ({ filters }) => {+ loadRelationshipDefinitionsSuccess: () => {+ cache.relationshipDefinitionsLoaded = trueif (!cache.customPropertyDefinitionsLoaded) {return}- const supportedFilters = supportedAccountFilters(filters, values.customPropertyDefinitionsById)+ const supportedFilters = supportedAccountFilters(+ values.accountFilters,+ values.customPropertyDefinitionsById,+ values.relationshipDefinitionsById+ )+ if (!objectsEqual(supportedFilters, values.accountFilters)) {+ actions.setAccountFilters(supportedFilters)+ }+ },+ loadRelationshipDefinitionsFailure: () => {+ cache.relationshipDefinitionsLoaded = true+ actions.setAccountFilters(values.accountFilters)+ },+ setAccountFilters: ({ filters }) => {+ if (!cache.customPropertyDefinitionsLoaded || !cache.relationshipDefinitionsLoaded) {+ return+ }+ const supportedFilters = supportedAccountFilters(+ filters,+ values.customPropertyDefinitionsById,+ values.relationshipDefinitionsById+ )if (!objectsEqual(supportedFilters, filters)) {actions.setAccountFilters(supportedFilters)}},updateAccountFilters: ({ filters }, _, __, previousState) => {- const supportedFilters = cache.customPropertyDefinitionsLoaded- ? supportedAccountFilters(filters, values.customPropertyDefinitionsById)- : filters+ const supportedFilters =+ cache.customPropertyDefinitionsLoaded && cache.relationshipDefinitionsLoaded+ ? supportedAccountFilters(+ filters,+ values.customPropertyDefinitionsById,+ values.relationshipDefinitionsById+ )+ : filtersconst previousFilters = selectors.accountFilters(previousState)const changedFilter =supportedFilters.find((filter, index) => !objectsEqual(filter, previousFilters[index])) ??previousFilters.find((filter, index) => !objectsEqual(filter, supportedFilters[index]))actions.setAccountFilters(supportedFilters)- const fieldKind = changedFilter?.type === 'account' ? 'account_field' : 'custom_property'+ const fieldKind =+ changedFilter?.type === 'account'+ ? 'account_field'+ : changedFilter?.type === 'account_relationship'+ ? 'relationship'+ : 'custom_property'posthog.capture(AccountsEvents.FilterChanged, {filter_type: fieldKind,field_kind: fieldKind,diff --git a/products/customer_analytics/frontend/components/Accounts/accountsPropertyFilters.ts b/products/customer_analytics/frontend/components/Accounts/accountsPropertyFilters.tsindex 79b0b7a795c2..282271b3c947 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsPropertyFilters.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsPropertyFilters.ts@@ -2,6 +2,7 @@ import type { PropValue } from '~/models/propertyDefinitionsModel'import { AccountsTableAccountField } from '~/queries/schema/schema-general'import {AccountCustomPropertyFilter,+ AccountRelationshipPropertyFilter,PropertyDefinitionType,PropertyFilterType,PropertyOperator,@@ -14,7 +15,9 @@ export type AccountPropertyFilter = Omit<AccountCustomPropertyFilter, 'type'> &type: PropertyFilterType.Account}-export type AccountFilter = AccountPropertyFilter | AccountCustomPropertyFilter+export type AccountRelationshipFilter = AccountRelationshipPropertyFilter++export type AccountFilter = AccountPropertyFilter | AccountRelationshipFilter | AccountCustomPropertyFilterexport interface AccountFieldTaxonomicOption {id: AccountsTableAccountField@@ -100,6 +103,12 @@ export function isAccountPropertyFilter(filter: AccountFilter): filter is Accounreturn filter.type === PropertyFilterType.Account}+export function isAccountRelationshipFilter(filter: {+ type?: PropertyFilterType+}): filter is AccountRelationshipFilter {+ return filter.type === PropertyFilterType.AccountRelationship+}+export function propertyTypeForDisplayType(displayType: CustomPropertyDisplayTypeEnumApi): PropertyType {switch (displayType) {case 'number':diff --git a/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.test.ts b/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.test.tsindex de65ae2a6e41..126697625c8d 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.test.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.test.ts@@ -2,14 +2,18 @@ import {AccountsTableAccountField,AccountsTableAccountFieldOperator,AccountsTableCustomPropertyOperator,+ AccountsTableRelationshipOperator,AccountsTableSortDirection,NodeKind,} from '~/queries/schema/schema-general'import { AccountCustomPropertyFilter, PropertyFilterType, PropertyOperator } from '~/types'-import type { CustomPropertyDefinitionApi } from 'products/customer_analytics/frontend/generated/api.schemas'+import type {+ AccountRelationshipDefinitionApi,+ CustomPropertyDefinitionApi,+} from 'products/customer_analytics/frontend/generated/api.schemas'-import type { AccountPropertyFilter } from './accountsPropertyFilters'+import type { AccountPropertyFilter, AccountRelationshipFilter } from './accountsPropertyFilters'import {AccountsTableQueryPlan,BuildAccountsTableQueryPlanInput,@@ -36,6 +40,16 @@ function accountFieldFilter(overrides: Partial<AccountPropertyFilter> = {}): Acc}}+function relationshipFilter(overrides: Partial<AccountRelationshipFilter> = {}): AccountRelationshipFilter {+ return {+ type: PropertyFilterType.AccountRelationship,+ key: RELATIONSHIP_ID,+ operator: PropertyOperator.Exact,+ value: [7],+ ...overrides,+ }+}+function customFilter(overrides: Partial<AccountCustomPropertyFilter> = {}): AccountCustomPropertyFilter {return {type: PropertyFilterType.AccountCustomProperty,@@ -62,6 +76,9 @@ function queryInput(overrides: Partial<BuildAccountsTableQueryPlanInput> = {}):accountIdFilter: null,tileFilter: null,accountFilters: [],+ relationshipDefinitionsById: {+ [RELATIONSHIP_ID]: { id: RELATIONSHIP_ID, name: 'CSM' } as AccountRelationshipDefinitionApi,+ },customPropertyDefinitionsById: { [CUSTOM_PROPERTY_ID]: definition },columnDisplay: {},sortOrder: null,@@ -77,7 +94,7 @@ describe('accountsTableQuery', () => {searchQuery: ' acme ',tagsFilter: ['enterprise'],assignedToFilter: [7, 9],- accountFilters: [customFilter()],+ accountFilters: [relationshipFilter(), customFilter()],sortOrder: { column: 'csm', direction: 'desc' },canSortClientSide: false,})@@ -95,6 +112,12 @@ describe('accountsTableQuery', () => {{ kind: 'search', query: 'acme' },{ kind: 'tags', tagNames: ['enterprise'] },{ kind: 'assigned_to', userIds: [7, 9] },+ {+ kind: 'relationship',+ definitionId: RELATIONSHIP_ID,+ operator: AccountsTableRelationshipOperator.Exact,+ userIds: [7],+ },{kind: 'custom_property',definitionId: CUSTOM_PROPERTY_ID,diff --git a/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.ts b/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.tsindex 5fc389291396..c881d3645901 100644--- a/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.ts+++ b/products/customer_analytics/frontend/components/Accounts/accountsTableQuery.ts@@ -11,6 +11,8 @@ import {AccountsTableCustomPropertyFilter,AccountsTableCustomPropertyOperator,AccountsTableFilter,+ AccountsTableRelationshipFilter,+ AccountsTableRelationshipOperator,AccountsTableQuery,AccountsTableRow,AccountsTableSort,@@ -22,14 +24,22 @@ import {} from '~/queries/schema/schema-general'import { AccountCustomPropertyFilter, PropertyOperator, PropertyType } from '~/types'-import type { CustomPropertyDefinitionApi } from 'products/customer_analytics/frontend/generated/api.schemas'+import type {+ AccountRelationshipDefinitionApi,+ CustomPropertyDefinitionApi,+} from 'products/customer_analytics/frontend/generated/api.schemas'import { CUSTOMER_ANALYTICS_DEFAULT_QUERY_TAGS } from '../../constants'import { isNumericDisplayType } from '../../scenes/CustomerAnalyticsConfigurationScene/account/customPropertyTypes'import type { AccountColumnDisplayState } from './accountsColumnConfigLogic'import type { AccountSortOrder, RoleFilterValue } from './accountsLogic'import type { TileFilter } from './accountsOverviewTilesLogic'-import { ACCOUNT_FIELD_PROPERTY_TYPES, AccountFilter, isAccountPropertyFilter } from './accountsPropertyFilters'+import {+ ACCOUNT_FIELD_PROPERTY_TYPES,+ AccountFilter,+ isAccountPropertyFilter,+ isAccountRelationshipFilter,+} from './accountsPropertyFilters'const RELATIONSHIP_COLUMN_REGEX = /^accounts\.relationships\.values\.`([0-9a-fA-F-]+)` AS [A-Za-z_][\w]*$/const CUSTOM_PROPERTY_COLUMN_REGEX = /^accounts\.custom_properties\.values\.`([0-9a-fA-F-]+)` AS [A-Za-z_][\w]*$/@@ -67,6 +77,13 @@ const ACCOUNT_FIELD_DATE_OPERATORS = new Set<AccountsTableAccountFieldOperator>(AccountsTableAccountFieldOperator.IsNotSet,])+const RELATIONSHIP_OPERATOR_MAP: Partial<Record<PropertyOperator, AccountsTableRelationshipOperator>> = {+ [PropertyOperator.Exact]: AccountsTableRelationshipOperator.Exact,+ [PropertyOperator.IsNot]: AccountsTableRelationshipOperator.IsNot,+ [PropertyOperator.IsSet]: AccountsTableRelationshipOperator.IsSet,+ [PropertyOperator.IsNotSet]: AccountsTableRelationshipOperator.IsNotSet,+}+const CUSTOM_PROPERTY_OPERATOR_MAP: Partial<Record<PropertyOperator, AccountsTableCustomPropertyOperator>> = {[PropertyOperator.Exact]: AccountsTableCustomPropertyOperator.Exact,[PropertyOperator.IsNot]: AccountsTableCustomPropertyOperator.IsNot,@@ -103,6 +120,7 @@ export interface BuildAccountsTableQueryPlanInput {accountIdFilter: string | nulltileFilter: TileFilter | nullaccountFilters: AccountFilter[]+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi>customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi>columnDisplay: AccountColumnDisplayStatesortOrder: AccountSortOrder@@ -179,6 +197,29 @@ function accountFieldFilter(filter: AccountFilter): AccountsTableAccountFieldFilreturn { kind: 'account_field', field, operator, values }}+function relationshipFilter(+ filter: AccountFilter,+ definitionsById: Record<string, AccountRelationshipDefinitionApi>+): AccountsTableRelationshipFilter | null {+ if (!isAccountRelationshipFilter(filter) || !isUUIDLike(filter.key) || !definitionsById[filter.key]) {+ return null+ }+ const operator = RELATIONSHIP_OPERATOR_MAP[filter.operator]+ if (!operator) {+ return null+ }+ const rawValues = Array.isArray(filter.value) ? filter.value : filter.value == null ? [] : [filter.value]+ const userIds = rawValues.filter(+ (value): value is number => typeof value === 'number' && Number.isInteger(value) && value > 0+ )+ const doesNotNeedValues =+ operator === AccountsTableRelationshipOperator.IsSet || operator === AccountsTableRelationshipOperator.IsNotSet+ if (!doesNotNeedValues && userIds.length === 0) {+ return null+ }+ return { kind: 'relationship', definitionId: filter.key, operator, userIds }+}+function customPropertyFilter(filter: AccountCustomPropertyFilter,definitionsById: Record<string, CustomPropertyDefinitionApi>@@ -239,12 +280,15 @@ function customPropertyFilter(export function supportedAccountFilters(filters: AccountFilter[],- definitionsById: Record<string, CustomPropertyDefinitionApi>+ customPropertyDefinitionsById: Record<string, CustomPropertyDefinitionApi>,+ relationshipDefinitionsById: Record<string, AccountRelationshipDefinitionApi>): AccountFilter[] {return filters.filter((filter) =>isAccountPropertyFilter(filter)? accountFieldFilter(filter) !== null- : customPropertyFilter(filter, definitionsById) !== null+ : isAccountRelationshipFilter(filter)+ ? relationshipFilter(filter, relationshipDefinitionsById) !== null+ : customPropertyFilter(filter, customPropertyDefinitionsById) !== null)}@@ -271,7 +315,9 @@ function queryFilters(input: BuildAccountsTableQueryPlanInput): AccountsTableFilfor (const filter of input.accountFilters) {const translatedFilter = isAccountPropertyFilter(filter)? accountFieldFilter(filter)- : customPropertyFilter(filter, input.customPropertyDefinitionsById)+ : isAccountRelationshipFilter(filter)+ ? relationshipFilter(filter, input.relationshipDefinitionsById)+ : customPropertyFilter(filter, input.customPropertyDefinitionsById)if (translatedFilter) {filters.push(translatedFilter)}diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.tsindex 820bb3d8ec8c..630b7e8e719b 100644--- a/products/dashboards/frontend/generated/api.schemas.ts+++ b/products/dashboards/frontend/generated/api.schemas.ts@@ -5496,6 +5496,7 @@ export const TaxonomicFilterGroupTypeApi = {ReplaySavedFilters: 'replay_saved_filters',RevenueAnalyticsProperties: 'revenue_analytics_properties',AccountFields: 'account_fields',+ AccountRelationships: 'account_relationships',AccountCustomProperties: 'account_custom_properties',Resources: 'resources',ErrorTrackingProperties: 'error_tracking_properties',@@ -8354,6 +8355,23 @@ export const AccountsTableUnassignedFilterApiValue = {} as constexport type AccountsTableUnassignedFilterApi = typeof AccountsTableUnassignedFilterApiValue+export type AccountsTableRelationshipOperatorApi =+ (typeof AccountsTableRelationshipOperatorApi)[keyof typeof AccountsTableRelationshipOperatorApi]++export const AccountsTableRelationshipOperatorApi = {+ Exact: 'exact',+ IsNot: 'is_not',+ IsSet: 'is_set',+ IsNotSet: 'is_not_set',+} as const++export interface AccountsTableRelationshipFilterApi {+ definitionId: string+ kind?: 'relationship'+ operator: AccountsTableRelationshipOperatorApi+ userIds?: number[] | null+}+export interface AccountsTableAccountIdFilterApi {accountId: stringkind?: 'account_id'@@ -8516,6 +8534,7 @@ export interface AccountsTableQueryApi {| AccountsTableAssignedToFilterApi| AccountsTableAssignedFilterApi| AccountsTableUnassignedFilterApi+ | AccountsTableRelationshipFilterApi| AccountsTableAccountIdFilterApi| AccountsTableAccountFieldFilterApi| AccountsTableCustomPropertyFilterApidiff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.tsindex 021b6c787c98..5b51f5aef3b5 100644--- a/products/product_analytics/frontend/generated/api.schemas.ts+++ b/products/product_analytics/frontend/generated/api.schemas.ts@@ -4658,6 +4658,7 @@ export const TaxonomicFilterGroupTypeApi = {ReplaySavedFilters: 'replay_saved_filters',RevenueAnalyticsProperties: 'revenue_analytics_properties',AccountFields: 'account_fields',+ AccountRelationships: 'account_relationships',AccountCustomProperties: 'account_custom_properties',Resources: 'resources',ErrorTrackingProperties: 'error_tracking_properties',@@ -7516,6 +7517,23 @@ export const AccountsTableUnassignedFilterApiValue = {} as constexport type AccountsTableUnassignedFilterApi = typeof AccountsTableUnassignedFilterApiValue+export type AccountsTableRelationshipOperatorApi =+ (typeof AccountsTableRelationshipOperatorApi)[keyof typeof AccountsTableRelationshipOperatorApi]++export const AccountsTableRelationshipOperatorApi = {+ Exact: 'exact',+ IsNot: 'is_not',+ IsSet: 'is_set',+ IsNotSet: 'is_not_set',+} as const++export interface AccountsTableRelationshipFilterApi {+ definitionId: string+ kind?: 'relationship'+ operator: AccountsTableRelationshipOperatorApi+ userIds?: number[] | null+}+export interface AccountsTableAccountIdFilterApi {accountId: stringkind?: 'account_id'@@ -7678,6 +7696,7 @@ export interface AccountsTableQueryApi {| AccountsTableAssignedToFilterApi| AccountsTableAssignedFilterApi| AccountsTableUnassignedFilterApi+ | AccountsTableRelationshipFilterApi| AccountsTableAccountIdFilterApi| AccountsTableAccountFieldFilterApi| AccountsTableCustomPropertyFilterApidiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex c0e354879600..f81a8d213011 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -1343,6 +1343,23 @@ export namespace Schemas {} as const;export type AccountsTableUnassignedFilter = typeof AccountsTableUnassignedFilterValue;+ export type AccountsTableRelationshipOperator = typeof AccountsTableRelationshipOperator[keyof typeof AccountsTableRelationshipOperator];+++ export const AccountsTableRelationshipOperator = {+ Exact: 'exact',+ IsNot: 'is_not',+ IsSet: 'is_set',+ IsNotSet: 'is_not_set',+ } as const;++ export interface AccountsTableRelationshipFilter {+ definitionId: string;+ kind?: 'relationship';+ operator: AccountsTableRelationshipOperator;+ userIds?: number[] | null;+ }+/*** Requested direct Account fields, keyed by their typed field reference.*/@@ -1429,7 +1446,7 @@ export namespace Schemas {/** Columns to load for each account. Account identity fields are always returned. */columns: (AccountsTableAccountFieldColumn | AccountsTableTagsColumn | AccountsTableNoteCountColumn | AccountsTableRelationshipColumn | AccountsTableCustomPropertyColumn | AccountsTableCustomPropertyHistoryColumn)[];/** Filters are combined with AND. Values within tag and assignment filters use OR. */- filters?: (AccountsTableSearchFilter | AccountsTableTagsFilter | AccountsTableAssignedToFilter | AccountsTableAssignedFilter | AccountsTableUnassignedFilter | AccountsTableAccountIdFilter | AccountsTableAccountFieldFilter | AccountsTableCustomPropertyFilter)[] | null;+ filters?: (AccountsTableSearchFilter | AccountsTableTagsFilter | AccountsTableAssignedToFilter | AccountsTableAssignedFilter | AccountsTableUnassignedFilter | AccountsTableRelationshipFilter | AccountsTableAccountIdFilter | AccountsTableAccountFieldFilter | AccountsTableCustomPropertyFilter)[] | null;/** Include churned accounts. Churned accounts are hidden by default. */includeChurned?: boolean | null;/** Include ignored accounts. Ignored accounts are hidden by default. */@@ -7092,6 +7109,7 @@ export namespace Schemas {ReplaySavedFilters: 'replay_saved_filters',RevenueAnalyticsProperties: 'revenue_analytics_properties',AccountFields: 'account_fields',+ AccountRelationships: 'account_relationships',AccountCustomProperties: 'account_custom_properties',Resources: 'resources',ErrorTrackingProperties: 'error_tracking_properties',