: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
/**
* Auto-generated from the Django backend OpenAPI schema.
* MCP service uses these Zod schemas for generated tool handlers.
* To regenerate: hogli build:openapi
*
* PostHog API - MCP 12 enabled ops
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
/**
* List all endpoints for the team.
*/
export const EndpointsListParams = () => zod.object({
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsListQueryParams = () => zod.object({
created_by: zod.number().optional(),
is_active: zod.boolean().optional(),
limit: zod.number().optional().describe('Number of results to return per page.'),
offset: zod.number().optional().describe('The initial index from which to return the results.'),
})
/**
* Create a new endpoint.
*/
export const EndpointsCreateParams = () => zod.object({
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsCreateBody = () => zod
.object({
name: zod
.string()
.nullish()
.describe(
'Unique URL-safe name. Must start with a letter, only letters\/numbers\/hyphens\/underscores, max 128 chars.'
),
query: zod
.unknown()
.optional()
.describe('HogQL or insight query this endpoint executes. Changing this auto-creates a new version.'),
description: zod.string().nullish().describe('Human-readable description of what this endpoint returns.'),
data_freshness_seconds: zod
.number()
.nullish()
.describe(
'How fresh the data should be, in seconds. Must be one of: 900 (15 min), 1800 (30 min), 3600 (1 h), 21600 (6 h), 43200 (12 h), 86400 (24 h, default), 604800 (7 d). Controls cache TTL and materialization sync frequency.'
),
is_active: zod.boolean().nullish().describe('Whether this endpoint is available for execution via the API.'),
is_materialized: zod.boolean().nullish().describe('Whether query results are materialized to S3.'),
derived_from_insight: zod
.string()
.nullish()
.describe('Short ID of the insight this endpoint was derived from.'),
version: zod
.number()
.nullish()
.describe('Target a specific version for updates (defaults to current version).'),
bucket_overrides: zod
.record(zod.string(), zod.unknown())
.nullish()
.describe(
'Per-column bucket overrides for range variable materialization. Keys are column names, values are bucket keys.'
),
deleted: zod.boolean().nullish().describe('Set to true to soft-delete this endpoint.'),
tags: zod
.array(zod.string())
.nullish()
.describe('List of tag names to associate with this endpoint. Replaces any existing tags.'),
optional_breakdown_properties: zod
.array(zod.string())
.nullish()
.describe(
'Breakdown property names that may be omitted on \/run. Omitted ones return data aggregated across all values of that breakdown. Defaults to [] — every breakdown variable is required.'
),
})
.describe('Schema for creating\/updating endpoints. OpenAPI docs only — validation uses Pydantic.')
/**
* Retrieve an endpoint, or a specific version via ?version=N.
*/
export const EndpointsRetrieveParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsRetrieveQueryParams = () => zod.object({
version: zod.number().optional().describe('Endpoint version to act on. Defaults to the current version.'),
})
/**
* Update an existing endpoint.
*/
export const EndpointsPartialUpdateParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsPartialUpdateBody = () => zod
.object({
name: zod
.string()
.nullish()
.describe(
'Unique URL-safe name. Must start with a letter, only letters\/numbers\/hyphens\/underscores, max 128 chars.'
),
query: zod
.unknown()
.optional()
.describe('HogQL or insight query this endpoint executes. Changing this auto-creates a new version.'),
description: zod.string().nullish().describe('Human-readable description of what this endpoint returns.'),
data_freshness_seconds: zod
.number()
.nullish()
.describe(
'How fresh the data should be, in seconds. Must be one of: 900 (15 min), 1800 (30 min), 3600 (1 h), 21600 (6 h), 43200 (12 h), 86400 (24 h, default), 604800 (7 d). Controls cache TTL and materialization sync frequency.'
),
is_active: zod.boolean().nullish().describe('Whether this endpoint is available for execution via the API.'),
is_materialized: zod.boolean().nullish().describe('Whether query results are materialized to S3.'),
derived_from_insight: zod
.string()
.nullish()
.describe('Short ID of the insight this endpoint was derived from.'),
version: zod
.number()
.nullish()
.describe('Target a specific version for updates (defaults to current version).'),
bucket_overrides: zod
.record(zod.string(), zod.unknown())
.nullish()
.describe(
'Per-column bucket overrides for range variable materialization. Keys are column names, values are bucket keys.'
),
deleted: zod.boolean().nullish().describe('Set to true to soft-delete this endpoint.'),
tags: zod
.array(zod.string())
.nullish()
.describe('List of tag names to associate with this endpoint. Replaces any existing tags.'),
optional_breakdown_properties: zod
.array(zod.string())
.nullish()
.describe(
'Breakdown property names that may be omitted on \/run. Omitted ones return data aggregated across all values of that breakdown. Defaults to [] — every breakdown variable is required.'
),
})
.describe('Schema for creating\/updating endpoints. OpenAPI docs only — validation uses Pydantic.')
/**
* Delete an endpoint and clean up materialized query.
*/
export const EndpointsDestroyParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsLogsRetrieveParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const endpointsLogsRetrieveQueryLimitDefault = 50
export const endpointsLogsRetrieveQueryLimitMax = 500
export const endpointsLogsRetrieveQueryOffsetDefault = 0
export const endpointsLogsRetrieveQueryOffsetMin = 0
export const EndpointsLogsRetrieveQueryParams = () => zod.object({
after: zod.iso
.datetime({ offset: true })
.optional()
.describe(
'Only return entries after this ISO 8601 timestamp. Defaults to 7 days ago; pass an explicit value to read further back.'
),
before: zod.iso
.datetime({ offset: true })
.optional()
.describe('Only return entries before this ISO 8601 timestamp.'),
instance_id: zod.string().min(1).optional().describe('Filter logs to a specific execution instance.'),
level: zod
.string()
.min(1)
.optional()
.describe(
"Comma-separated log levels to include, e.g. 'WARN,ERROR'. Valid levels: DEBUG, LOG, INFO, WARN, ERROR."
),
limit: zod
.number()
.min(1)
.max(endpointsLogsRetrieveQueryLimitMax)
.default(endpointsLogsRetrieveQueryLimitDefault)
.describe('Maximum number of log entries to return (1-500, default 50).'),
offset: zod
.number()
.min(endpointsLogsRetrieveQueryOffsetMin)
.default(endpointsLogsRetrieveQueryOffsetDefault)
.describe('Number of log entries to skip before the first returned entry (default 0).'),
search: zod.string().min(1).optional().describe('Case-insensitive substring search across log messages.'),
})
/**
* Preview the materialization transform for an endpoint. Shows what the query will look like after materialization, including range pair detection and bucket functions.
*/
export const EndpointsMaterializationPreviewCreateParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsMaterializationPreviewCreateBody = () => zod.object({
version: zod.number().optional().describe('Endpoint version to preview. Defaults to the current version.'),
bucket_overrides: zod
.record(zod.string(), zod.string())
.nullish()
.describe('Per-column bucket function overrides, e.g. {\"timestamp\": \"hour\"}'),
})
/**
* Get materialization status for an endpoint. Supports ?version=N query param.
*/
export const EndpointsMaterializationStatusRetrieveParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsMaterializationStatusRetrieveQueryParams = () => zod.object({
version: zod.number().optional().describe('Endpoint version to act on. Defaults to the current version.'),
})
/**
* Get OpenAPI 3.0 specification for this endpoint. Use this to generate typed SDK clients.
*/
export const EndpointsOpenapiSpecRetrieveParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsOpenapiSpecRetrieveQueryParams = () => zod.object({
version: zod.number().optional().describe('Endpoint version to act on. Defaults to the current version.'),
})
/**
* Execute endpoint with optional materialization. Supports version parameter, runs latest version if not set.
*/
export const EndpointsRunCreateParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const endpointsRunCreateBodyDebugDefault = false
export const endpointsRunCreateBodyFiltersOverrideOneBreakdownFilterOneBreakdownTypeDefault = `event`
export const endpointsRunCreateBodyFiltersOverrideOneBreakdownFilterOneBreakdownsOneMax = 3
export const endpointsRunCreateBodyFiltersOverrideOneCompareFilterOneCompareDefault = false
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneOperatorDefault = `exact`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneTypeDefault = `event`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwoTypeDefault = `person`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemThreeTypeDefault = `person_metadata`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemFourTypeDefault = `element`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemFiveTypeDefault = `event_metadata`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSixTypeDefault = `session`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenKeyDefault = `id`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenOperatorDefault = `in`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenTypeDefault = `cohort`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemEightTypeDefault = `recording`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemNineTypeDefault = `log_entry`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnezeroTypeDefault = `group`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneoneTypeDefault = `feature`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnetwoOperatorDefault = `flag_evaluates_to`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnetwoTypeDefault = `flag`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnethreeTypeDefault = `hogql`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnefourTypeDefault = `empty`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnefiveTypeDefault = `data_warehouse`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnesixTypeDefault = `data_warehouse_person_property`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnesevenTypeDefault = `error_tracking_issue`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnenineTypeDefault = `metric_attribute`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwooneTypeDefault = `revenue_analytics`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwotwoTypeDefault = `account_custom_property`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwothreeTypeDefault = `workflow_variable`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemOneOperatorDefault = `exact`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemOneTypeDefault = `event`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemTwoTypeDefault = `person`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemThreeTypeDefault = `element`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemFourTypeDefault = `feature`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemFiveTypeDefault = `hogql`
export const endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourTypeDefault = `behavioral`
export const endpointsRunCreateBodyRefreshDefault = `cache`
export const EndpointsRunCreateBody = () => zod.object({
client_query_id: zod
.union([zod.string(), zod.null()])
.optional()
.describe('Client provided query ID. Can be used to retrieve the status or cancel the query.'),
debug: zod
.union([zod.boolean(), zod.null()])
.default(endpointsRunCreateBodyDebugDefault)
.describe('Whether to include debug information (such as the executed HogQL) in the response.'),
filters_override: zod
.union([
zod.object({
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(
endpointsRunCreateBodyFiltersOverrideOneBreakdownFilterOneBreakdownTypeDefault
),
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(
endpointsRunCreateBodyFiltersOverrideOneBreakdownFilterOneBreakdownsOneMax
),
zod.null(),
])
.optional(),
}),
zod.null(),
])
.optional(),
compareFilter: zod
.union([
zod.object({
compare: zod
.union([zod.boolean(), zod.null()])
.default(endpointsRunCreateBodyFiltersOverrideOneCompareFilterOneCompareDefault)
.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 insight that supports one. Absent\/null = inherit.'),
date_from: zod.union([zod.string(), zod.null()]).optional(),
date_to: zod.union([zod.string(), zod.null()]).optional(),
explicitDate: zod.union([zod.boolean(), zod.null()]).optional(),
filterTestAccounts: zod
.union([zod.boolean(), zod.null()])
.optional()
.describe(
'Tri-state test-account override. Null\/absent = inherit; true = force on; false = force off.'
),
interval: zod
.union([
zod.enum(['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']),
zod.null(),
])
.optional()
.describe('Time granularity forced onto every insight that supports one. Absent\/null = inherit.'),
metricFilters: zod
.union([
zod.array(
zod.object({
key: zod.string(),
op: zod.enum(['eq', 'neq', 'regex', 'not_regex']),
scope: zod.union([zod.enum(['resource', 'attribute', 'auto']), zod.null()]).optional(),
value: zod.string(),
})
),
zod.null(),
])
.optional(),
metricVariables: zod
.union([
zod.array(
zod.object({
allValue: zod
.union([zod.string(), zod.null()])
.optional()
.describe('The text that All puts in a PromQL query. `.\*` when it is empty.'),
current: zod
.union([
zod.object({
all: zod.union([zod.boolean(), zod.null()]).optional(),
values: zod
.array(zod.string())
.describe(
'The selected values. Empty when `all` is true: All stands for every option of the variable.'
),
}),
zod.null(),
])
.optional(),
customValues: zod
.union([zod.array(zod.string()), zod.null()])
.optional()
.describe('The options when `source` is `custom`.'),
includeAll: zod.union([zod.boolean(), zod.null()]).optional(),
label: zod
.union([zod.string(), zod.null()])
.optional()
.describe('Shown in the dashboard filter bar. The name is shown when it is empty.'),
multi: zod.union([zod.boolean(), zod.null()]).optional(),
name: zod
.string()
.describe('Letters, digits and underscores. Tiles refer to it as `$name`.'),
query: zod
.union([zod.string(), zod.null()])
.optional()
.describe(
'The options query when `source` is `promql` or `sql`. It can refer to other variables. PromQL supports `label_values(label)`, `label_values(selector, label)`, `label_names()`, `metrics(regex)` and `query_result(expr)`. SQL returns the options in its first column.'
),
regex: zod
.union([zod.string(), zod.null()])
.optional()
.describe(
'RE2 pattern that options must match. When it has a capture group, the option is the first group.'
),
source: zod.enum(['custom', 'promql', 'sql', 'textbox']),
})
),
zod.null(),
])
.optional()
.describe('Variables that metrics tiles refer to as `$name`. Other tiles ignore them.'),
properties: zod
.union([
zod.array(
zod.union([
zod.object({
key: zod.string(),
label: zod.union([zod.string(), zod.null()]).optional(),
operator: zod
.union([
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',
]),
zod.null(),
])
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneOperatorDefault
),
type: zod
.literal('event')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneTypeDefault
)
.describe('Event properties'),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('person')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwoTypeDefault
)
.describe('Person properties'),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('person_metadata')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemThreeTypeDefault
)
.describe(
'Top-level columns on the persons table (e.g. created_at), not properties JSON'
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.enum(['tag_name', 'text', 'href', 'selector']),
label: zod.union([zod.string(), 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
.literal('element')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemFourTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('event_metadata')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemFiveTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('session')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSixTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
cohort_deleted: zod
.union([zod.boolean(), zod.null()])
.optional()
.describe(
'Set by the feature flag API when the cohort is deleted or does not exist.'
),
cohort_missing: zod
.union([zod.boolean(), zod.null()])
.optional()
.describe(
'Set by the feature flag API when the cohort does not exist, so it cannot be restored.'
),
cohort_name: zod.union([zod.string(), zod.null()]).optional(),
key: zod
.literal('id')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenKeyDefault
),
label: zod.union([zod.string(), zod.null()]).optional(),
operator: zod
.union([
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',
]),
zod.null(),
])
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenOperatorDefault
),
type: zod
.literal('cohort')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemSevenTypeDefault
),
value: zod.number(),
}),
zod.object({
key: zod.union([
zod.enum(['duration', 'active_seconds', 'inactive_seconds']),
zod.string(),
]),
label: zod.union([zod.string(), 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
.literal('recording')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemEightTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('log_entry')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemNineTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
group_key_names: zod
.union([zod.record(zod.string(), zod.string()), zod.null()])
.optional(),
group_type_index: zod.union([zod.number(), zod.null()]).optional(),
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('group')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnezeroTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('feature')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOneoneTypeDefault
)
.describe('Event property with \"$feature\/\" prepended'),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string().describe('The key should be the flag ID'),
label: zod.union([zod.string(), zod.null()]).optional(),
operator: zod
.literal('flag_evaluates_to')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnetwoOperatorDefault
)
.describe('Only flag_evaluates_to operator is allowed for flag dependencies'),
type: zod
.literal('flag')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnetwoTypeDefault
)
.describe('Feature flag dependency'),
value: zod
.union([zod.boolean(), zod.string()])
.describe('The value can be true, false, or a variant name'),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), zod.null()]).optional(),
type: zod
.literal('hogql')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnethreeTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
type: zod
.literal('empty')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnefourTypeDefault
),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('data_warehouse')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnefiveTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('data_warehouse_person_property')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnesixTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('error_tracking_issue')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnesevenTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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(['log', 'log_attribute', 'log_resource_attribute']),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('metric_attribute')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemOnenineTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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(['span', 'span_attribute', 'span_resource_attribute']),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('revenue_analytics')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwooneTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('account_custom_property')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwotwoTypeDefault
)
.describe(
'Customer analytics account custom property — the key is the property definition id'
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('workflow_variable')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwothreeTypeDefault
),
value: zod
.union([
zod.array(zod.union([zod.string(), zod.number(), zod.boolean()])),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
event_filters: zod
.union([
zod.array(
zod.union([
zod.object({
key: zod.string(),
label: zod.union([zod.string(), zod.null()]).optional(),
operator: zod
.union([
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',
]),
zod.null(),
])
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemOneOperatorDefault
),
type: zod
.literal('event')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemOneTypeDefault
)
.describe('Event properties'),
value: zod
.union([
zod.array(
zod.union([
zod.string(),
zod.number(),
zod.boolean(),
])
),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('person')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemTwoTypeDefault
)
.describe('Person properties'),
value: zod
.union([
zod.array(
zod.union([
zod.string(),
zod.number(),
zod.boolean(),
])
),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.enum(['tag_name', 'text', 'href', 'selector']),
label: zod.union([zod.string(), 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
.literal('element')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemThreeTypeDefault
),
value: zod
.union([
zod.array(
zod.union([
zod.string(),
zod.number(),
zod.boolean(),
])
),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), 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
.literal('feature')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemFourTypeDefault
)
.describe('Event property with \"$feature\/\" prepended'),
value: zod
.union([
zod.array(
zod.union([
zod.string(),
zod.number(),
zod.boolean(),
])
),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
zod.object({
key: zod.string(),
label: zod.union([zod.string(), zod.null()]).optional(),
type: zod
.literal('hogql')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourEventFiltersOneItemFiveTypeDefault
),
value: zod
.union([
zod.array(
zod.union([
zod.string(),
zod.number(),
zod.boolean(),
])
),
zod.string(),
zod.number(),
zod.boolean(),
zod.null(),
])
.optional(),
}),
])
),
zod.null(),
])
.optional()
.describe(
'Extra property filters the matching events must satisfy. Deliberately excludes nested behavioral\/cohort filters and groups'
),
event_type: zod.enum(['events', 'actions']),
explicit_datetime: zod
.union([zod.string(), zod.null()])
.optional()
.describe(
'Absolute or relative (e.g. -30d) lower date bound — alternative to time_value\/time_interval'
),
explicit_datetime_to: zod.union([zod.string(), zod.null()]).optional(),
key: zod.string().describe("Event name, or action id when event_type is 'actions'"),
label: zod.union([zod.string(), zod.null()]).optional(),
negation: zod
.union([zod.boolean(), zod.null()])
.optional()
.describe(
'Match persons who did NOT satisfy the criterion. Not the same as a low count — zero-occurrence persons never match count operators'
),
operator: zod
.union([
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',
]),
zod.null(),
])
.optional()
.describe('Count comparison for performed_event_multiple, defaults to exact'),
operator_value: zod
.union([zod.number(), zod.null()])
.optional()
.describe('Count threshold for performed_event_multiple'),
time_interval: zod
.union([zod.enum(['day', 'week', 'month', 'year']), zod.null()])
.optional(),
time_value: zod
.union([zod.number(), zod.null()])
.optional()
.describe('Relative time window size, paired with time_interval'),
type: zod
.literal('behavioral')
.default(
endpointsRunCreateBodyFiltersOverrideOnePropertiesOneItemTwofourTypeDefault
)
.describe(
"Person performed (or didn't perform) an event in a time window. ClickHouse-only — not evaluable by flags or CDP"
),
value: zod.enum(['performed_event', 'performed_event_multiple']),
}),
])
),
zod.null(),
])
.optional(),
}),
zod.null(),
])
.optional(),
limit: zod
.union([zod.number(), zod.null()])
.optional()
.describe('Maximum number of results to return. If not provided, returns all results.'),
offset: zod
.union([zod.number(), zod.null()])
.optional()
.describe('Number of results to skip. Must be used together with limit. Only supported for HogQL endpoints.'),
refresh: zod
.union([zod.enum(['cache', 'force', 'direct']), zod.null()])
.default(endpointsRunCreateBodyRefreshDefault),
variables: zod
.union([zod.record(zod.string(), zod.unknown()), zod.null()])
.optional()
.describe(
'Variables to parameterize the endpoint query. The key is the variable name and the value is the variable value.\n\nFor HogQL endpoints: Keys must match a variable `code_name` defined in the query (referenced as `{variables.code_name}`). Example: `{\"event_name\": \"$pageview\"}`\n\nFor non-materialized insight endpoints (e.g. TrendsQuery): - `date_from` and `date_to` are built-in variables that filter the date range. Example: `{\"date_from\": \"2024-01-01\", \"date_to\": \"2024-01-31\"}`\n\nFor materialized insight endpoints: - Use the breakdown property name as the key to filter by breakdown value. Example: `{\"$browser\": \"Chrome\"}` - `date_from`\/`date_to` are not supported on materialized insight endpoints.\n\nUnknown variable names will return a 400 error.'
),
version: zod
.union([zod.number(), zod.null()])
.optional()
.describe('Specific endpoint version to execute. If not provided, the latest version is used.'),
})
/**
* List all versions for an endpoint.
*/
export const EndpointsVersionsListParams = () => zod.object({
name: zod.string(),
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsVersionsListQueryParams = () => zod.object({
created_by: zod.number().optional(),
is_active: zod.boolean().optional(),
limit: zod.number().optional().describe('Number of results to return per page.'),
offset: zod.number().optional().describe('The initial index from which to return the results.'),
})
/**
* Get the most recent execution time per endpoint (endpoint-level). Timestamps are recorded by the run path for personal-API-key calls. For per-version usage, query the query_log table directly.
*/
export const EndpointsLastExecutionTimesCreateParams = () => zod.object({
project_id: zod
.string()
.describe(
"Project ID of the project you're trying to access. To find the ID of the project, make a call to \/api\/projects\/."
),
})
export const EndpointsLastExecutionTimesCreateBody = () => zod.object({
names: zod.array(zod.string()),
})