: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 Zod validation schemas from the Django backend OpenAPI schema.
* To modify these schemas, update the Django serializers or views, then run:
* hogli build:openapi
* Questions or issues? #team-devex on Slack
*
* PostHog API - generated
* OpenAPI spec version: 1.0.0
*/
import * as zod from 'zod'
export const actionsCreateBodyNameMax = 400
export const actionsCreateBodySlackMessageFormatMax = 1200
export const actionsCreateBodyStepsItemPropertiesItemOneTypeDefault = `event`
export const actionsCreateBodyStepsItemPropertiesItemOneOperatorDefault = `exact`
export const actionsCreateBodyStepsItemPropertiesItemTwoTypeDefault = `event`
export const actionsCreateBodyStepsItemPropertiesItemTwoOperatorDefault = `exact`
export const actionsCreateBodyStepsItemPropertiesItemThreeTypeDefault = `event`
export const actionsCreateBodyStepsItemPropertiesItemThreeOperatorDefault = `exact`
export const actionsCreateBodyStepsItemPropertiesItemFourTypeDefault = `event`
export const actionsCreateBodyStepsItemPropertiesItemFourOperatorDefault = `is_date_exact`
export const actionsCreateBodyStepsItemPropertiesItemFiveTypeDefault = `event`
export const ActionsCreateBody = /* @__PURE__ */ zod
.object({
name: zod
.string()
.max(actionsCreateBodyNameMax)
.nullish()
.describe('Name of the action (must be unique within the project).'),
description: zod.string().optional().describe('Human-readable description of what this action represents.'),
tags: zod.array(zod.unknown()).optional(),
post_to_slack: zod
.boolean()
.optional()
.describe('Whether to post a notification to Slack when this action is triggered.'),
slack_message_format: zod
.string()
.max(actionsCreateBodySlackMessageFormatMax)
.optional()
.describe('Custom Slack message format. Supports templates with event properties.'),
steps: zod
.array(
zod.object({
event: zod
.string()
.nullish()
.describe("Event name to match (e.g. '$pageview', '$autocapture', or a custom event name)."),
properties: zod
.array(
zod.union([
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsCreateBodyStepsItemPropertiesItemOneTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.string().describe('String value to match against.'),
operator: zod
.enum([
'exact',
'is_not',
'icontains',
'not_icontains',
'starts_with',
'not_starts_with',
'ends_with',
'not_ends_with',
'regex',
'not_regex',
])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
)
.default(actionsCreateBodyStepsItemPropertiesItemOneOperatorDefault)
.describe(
'String comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
),
})
.describe('Matches string values with text-oriented operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsCreateBodyStepsItemPropertiesItemTwoTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.number().describe('Numeric value to compare against.'),
operator: zod
.enum(['exact', 'is_not', 'gt', 'lt', 'gte', 'lte'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
)
.default(actionsCreateBodyStepsItemPropertiesItemTwoOperatorDefault)
.describe(
'Numeric comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
),
})
.describe('Matches numeric values with comparison operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsCreateBodyStepsItemPropertiesItemThreeTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.array(zod.string())
.describe(
'List of values to match. For example `[\"[email protected]\", \"[email protected]\"]`.'
),
operator: zod
.enum(['exact', 'is_not', 'in', 'not_in'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
)
.default(actionsCreateBodyStepsItemPropertiesItemThreeOperatorDefault)
.describe(
'Array comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
),
})
.describe(
'Matches against a list of values (OR semantics for exact\/is_not, set membership for in\/not_in).'
),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsCreateBodyStepsItemPropertiesItemFourTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.string()
.describe(
"Date or datetime string in ISO 8601 format (e.g. '2024-01-15' or '2024-01-15T10:30:00Z')."
),
operator: zod
.enum(['is_date_exact', 'is_date_before', 'is_date_after'])
.describe(
'\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
)
.default(actionsCreateBodyStepsItemPropertiesItemFourOperatorDefault)
.describe(
'Date comparison operator.\n\n\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
),
})
.describe('Matches date\/datetime values with date-specific operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsCreateBodyStepsItemPropertiesItemFiveTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
operator: zod
.enum(['is_set', 'is_not_set'])
.describe('\* `is_set` - is_set\n\* `is_not_set` - is_not_set')
.describe(
'Existence check operator.\n\n\* `is_set` - is_set\n\* `is_not_set` - is_not_set'
),
})
.describe('Checks whether a property is set or not, without comparing values.'),
])
)
.nullish()
.describe(
"Event or person property filters. Each item should have 'key' (string), 'value' (string, number, boolean, or array), optional 'operator' (exact, is_not, is_set, is_not_set, icontains, not_icontains, regex, not_regex, gt, gte, lt, lte), and optional 'type' (event, person)."
),
selector: zod
.string()
.nullish()
.describe("CSS selector to match the target element (e.g. 'div > button.cta')."),
selector_regex: zod
.string()
.nullable()
.describe(
'Compiled regex the selector matches against the event elements chain. Null when no selector is set.'
),
selector_warning: zod
.string()
.nullable()
.describe(
'Set when the selector compiles to a matcher that cannot match any event. Null when the selector is valid or absent.'
),
tag_name: zod
.string()
.nullish()
.describe('HTML tag name to match (e.g. \"button\", \"a\", \"input\").'),
text: zod.string().nullish().describe('Element text content to match.'),
text_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the text value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
href: zod.string().nullish().describe('Link href attribute to match.'),
href_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the href value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
url: zod.string().nullish().describe('Page URL to match.'),
url_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the URL value. Defaults to contains.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
})
)
.optional()
.describe(
'Action steps defining trigger conditions. Each step matches events by name, properties, URL, or element attributes. Multiple steps are OR-ed together.'
),
deleted: zod.boolean().optional(),
last_calculated_at: zod.iso.datetime({ offset: true }).optional(),
pinned_at: zod.iso
.datetime({ offset: true })
.nullish()
.describe(
'ISO 8601 timestamp when the action was pinned, or null if not pinned. Set any value to pin, null to unpin.'
),
_create_in_folder: zod.string().optional(),
})
.describe('Serializer mixin that handles tags for objects.')
export const actionsUpdateBodyNameMax = 400
export const actionsUpdateBodySlackMessageFormatMax = 1200
export const actionsUpdateBodyStepsItemPropertiesItemOneTypeDefault = `event`
export const actionsUpdateBodyStepsItemPropertiesItemOneOperatorDefault = `exact`
export const actionsUpdateBodyStepsItemPropertiesItemTwoTypeDefault = `event`
export const actionsUpdateBodyStepsItemPropertiesItemTwoOperatorDefault = `exact`
export const actionsUpdateBodyStepsItemPropertiesItemThreeTypeDefault = `event`
export const actionsUpdateBodyStepsItemPropertiesItemThreeOperatorDefault = `exact`
export const actionsUpdateBodyStepsItemPropertiesItemFourTypeDefault = `event`
export const actionsUpdateBodyStepsItemPropertiesItemFourOperatorDefault = `is_date_exact`
export const actionsUpdateBodyStepsItemPropertiesItemFiveTypeDefault = `event`
export const ActionsUpdateBody = /* @__PURE__ */ zod
.object({
name: zod
.string()
.max(actionsUpdateBodyNameMax)
.nullish()
.describe('Name of the action (must be unique within the project).'),
description: zod.string().optional().describe('Human-readable description of what this action represents.'),
tags: zod.array(zod.unknown()).optional(),
post_to_slack: zod
.boolean()
.optional()
.describe('Whether to post a notification to Slack when this action is triggered.'),
slack_message_format: zod
.string()
.max(actionsUpdateBodySlackMessageFormatMax)
.optional()
.describe('Custom Slack message format. Supports templates with event properties.'),
steps: zod
.array(
zod.object({
event: zod
.string()
.nullish()
.describe("Event name to match (e.g. '$pageview', '$autocapture', or a custom event name)."),
properties: zod
.array(
zod.union([
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsUpdateBodyStepsItemPropertiesItemOneTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.string().describe('String value to match against.'),
operator: zod
.enum([
'exact',
'is_not',
'icontains',
'not_icontains',
'starts_with',
'not_starts_with',
'ends_with',
'not_ends_with',
'regex',
'not_regex',
])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
)
.default(actionsUpdateBodyStepsItemPropertiesItemOneOperatorDefault)
.describe(
'String comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
),
})
.describe('Matches string values with text-oriented operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsUpdateBodyStepsItemPropertiesItemTwoTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.number().describe('Numeric value to compare against.'),
operator: zod
.enum(['exact', 'is_not', 'gt', 'lt', 'gte', 'lte'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
)
.default(actionsUpdateBodyStepsItemPropertiesItemTwoOperatorDefault)
.describe(
'Numeric comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
),
})
.describe('Matches numeric values with comparison operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsUpdateBodyStepsItemPropertiesItemThreeTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.array(zod.string())
.describe(
'List of values to match. For example `[\"[email protected]\", \"[email protected]\"]`.'
),
operator: zod
.enum(['exact', 'is_not', 'in', 'not_in'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
)
.default(actionsUpdateBodyStepsItemPropertiesItemThreeOperatorDefault)
.describe(
'Array comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
),
})
.describe(
'Matches against a list of values (OR semantics for exact\/is_not, set membership for in\/not_in).'
),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsUpdateBodyStepsItemPropertiesItemFourTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.string()
.describe(
"Date or datetime string in ISO 8601 format (e.g. '2024-01-15' or '2024-01-15T10:30:00Z')."
),
operator: zod
.enum(['is_date_exact', 'is_date_before', 'is_date_after'])
.describe(
'\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
)
.default(actionsUpdateBodyStepsItemPropertiesItemFourOperatorDefault)
.describe(
'Date comparison operator.\n\n\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
),
})
.describe('Matches date\/datetime values with date-specific operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsUpdateBodyStepsItemPropertiesItemFiveTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
operator: zod
.enum(['is_set', 'is_not_set'])
.describe('\* `is_set` - is_set\n\* `is_not_set` - is_not_set')
.describe(
'Existence check operator.\n\n\* `is_set` - is_set\n\* `is_not_set` - is_not_set'
),
})
.describe('Checks whether a property is set or not, without comparing values.'),
])
)
.nullish()
.describe(
"Event or person property filters. Each item should have 'key' (string), 'value' (string, number, boolean, or array), optional 'operator' (exact, is_not, is_set, is_not_set, icontains, not_icontains, regex, not_regex, gt, gte, lt, lte), and optional 'type' (event, person)."
),
selector: zod
.string()
.nullish()
.describe("CSS selector to match the target element (e.g. 'div > button.cta')."),
selector_regex: zod
.string()
.nullable()
.describe(
'Compiled regex the selector matches against the event elements chain. Null when no selector is set.'
),
selector_warning: zod
.string()
.nullable()
.describe(
'Set when the selector compiles to a matcher that cannot match any event. Null when the selector is valid or absent.'
),
tag_name: zod
.string()
.nullish()
.describe('HTML tag name to match (e.g. \"button\", \"a\", \"input\").'),
text: zod.string().nullish().describe('Element text content to match.'),
text_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the text value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
href: zod.string().nullish().describe('Link href attribute to match.'),
href_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the href value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
url: zod.string().nullish().describe('Page URL to match.'),
url_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the URL value. Defaults to contains.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
})
)
.optional()
.describe(
'Action steps defining trigger conditions. Each step matches events by name, properties, URL, or element attributes. Multiple steps are OR-ed together.'
),
deleted: zod.boolean().optional(),
last_calculated_at: zod.iso.datetime({ offset: true }).optional(),
pinned_at: zod.iso
.datetime({ offset: true })
.nullish()
.describe(
'ISO 8601 timestamp when the action was pinned, or null if not pinned. Set any value to pin, null to unpin.'
),
_create_in_folder: zod.string().optional(),
})
.describe('Serializer mixin that handles tags for objects.')
export const actionsPartialUpdateBodyNameMax = 400
export const actionsPartialUpdateBodySlackMessageFormatMax = 1200
export const actionsPartialUpdateBodyStepsItemPropertiesItemOneTypeDefault = `event`
export const actionsPartialUpdateBodyStepsItemPropertiesItemOneOperatorDefault = `exact`
export const actionsPartialUpdateBodyStepsItemPropertiesItemTwoTypeDefault = `event`
export const actionsPartialUpdateBodyStepsItemPropertiesItemTwoOperatorDefault = `exact`
export const actionsPartialUpdateBodyStepsItemPropertiesItemThreeTypeDefault = `event`
export const actionsPartialUpdateBodyStepsItemPropertiesItemThreeOperatorDefault = `exact`
export const actionsPartialUpdateBodyStepsItemPropertiesItemFourTypeDefault = `event`
export const actionsPartialUpdateBodyStepsItemPropertiesItemFourOperatorDefault = `is_date_exact`
export const actionsPartialUpdateBodyStepsItemPropertiesItemFiveTypeDefault = `event`
export const ActionsPartialUpdateBody = /* @__PURE__ */ zod
.object({
name: zod
.string()
.max(actionsPartialUpdateBodyNameMax)
.nullish()
.describe('Name of the action (must be unique within the project).'),
description: zod.string().optional().describe('Human-readable description of what this action represents.'),
tags: zod.array(zod.unknown()).optional(),
post_to_slack: zod
.boolean()
.optional()
.describe('Whether to post a notification to Slack when this action is triggered.'),
slack_message_format: zod
.string()
.max(actionsPartialUpdateBodySlackMessageFormatMax)
.optional()
.describe('Custom Slack message format. Supports templates with event properties.'),
steps: zod
.array(
zod.object({
event: zod
.string()
.nullish()
.describe("Event name to match (e.g. '$pageview', '$autocapture', or a custom event name)."),
properties: zod
.array(
zod.union([
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemOneTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.string().describe('String value to match against.'),
operator: zod
.enum([
'exact',
'is_not',
'icontains',
'not_icontains',
'starts_with',
'not_starts_with',
'ends_with',
'not_ends_with',
'regex',
'not_regex',
])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemOneOperatorDefault)
.describe(
'String comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `icontains` - icontains\n\* `not_icontains` - not_icontains\n\* `starts_with` - starts_with\n\* `not_starts_with` - not_starts_with\n\* `ends_with` - ends_with\n\* `not_ends_with` - not_ends_with\n\* `regex` - regex\n\* `not_regex` - not_regex'
),
})
.describe('Matches string values with text-oriented operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemTwoTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod.number().describe('Numeric value to compare against.'),
operator: zod
.enum(['exact', 'is_not', 'gt', 'lt', 'gte', 'lte'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemTwoOperatorDefault)
.describe(
'Numeric comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `gt` - gt\n\* `lt` - lt\n\* `gte` - gte\n\* `lte` - lte'
),
})
.describe('Matches numeric values with comparison operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemThreeTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.array(zod.string())
.describe(
'List of values to match. For example `[\"[email protected]\", \"[email protected]\"]`.'
),
operator: zod
.enum(['exact', 'is_not', 'in', 'not_in'])
.describe(
'\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
)
.default(
actionsPartialUpdateBodyStepsItemPropertiesItemThreeOperatorDefault
)
.describe(
'Array comparison operator.\n\n\* `exact` - exact\n\* `is_not` - is_not\n\* `in` - in\n\* `not_in` - not_in'
),
})
.describe(
'Matches against a list of values (OR semantics for exact\/is_not, set membership for in\/not_in).'
),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemFourTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
value: zod
.string()
.describe(
"Date or datetime string in ISO 8601 format (e.g. '2024-01-15' or '2024-01-15T10:30:00Z')."
),
operator: zod
.enum(['is_date_exact', 'is_date_before', 'is_date_after'])
.describe(
'\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemFourOperatorDefault)
.describe(
'Date comparison operator.\n\n\* `is_date_exact` - is_date_exact\n\* `is_date_before` - is_date_before\n\* `is_date_after` - is_date_after'
),
})
.describe('Matches date\/datetime values with date-specific operators.'),
zod
.object({
key: zod
.string()
.describe(
"Key of the property you're filtering on. For example `email` or `$current_url`."
),
type: zod
.enum([
'event',
'event_metadata',
'feature',
'person',
'person_metadata',
'cohort',
'element',
'static-cohort',
'dynamic-cohort',
'precalculated-cohort',
'group',
'recording',
'log_entry',
'behavioral',
'session',
'hogql',
'data_warehouse',
'data_warehouse_person_property',
'error_tracking_issue',
'log',
'log_attribute',
'log_resource_attribute',
'metric_attribute',
'span',
'span_attribute',
'span_resource_attribute',
'revenue_analytics',
'account_custom_property',
'flag',
'workflow_variable',
])
.describe(
'\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
)
.default(actionsPartialUpdateBodyStepsItemPropertiesItemFiveTypeDefault)
.describe(
'Property type (event, person, session, etc.).\n\n\* `event` - event\n\* `event_metadata` - event_metadata\n\* `feature` - feature\n\* `person` - person\n\* `person_metadata` - person_metadata\n\* `cohort` - cohort\n\* `element` - element\n\* `static-cohort` - static-cohort\n\* `dynamic-cohort` - dynamic-cohort\n\* `precalculated-cohort` - precalculated-cohort\n\* `group` - group\n\* `recording` - recording\n\* `log_entry` - log_entry\n\* `behavioral` - behavioral\n\* `session` - session\n\* `hogql` - hogql\n\* `data_warehouse` - data_warehouse\n\* `data_warehouse_person_property` - data_warehouse_person_property\n\* `error_tracking_issue` - error_tracking_issue\n\* `log` - log\n\* `log_attribute` - log_attribute\n\* `log_resource_attribute` - log_resource_attribute\n\* `metric_attribute` - metric_attribute\n\* `span` - span\n\* `span_attribute` - span_attribute\n\* `span_resource_attribute` - span_resource_attribute\n\* `revenue_analytics` - revenue_analytics\n\* `account_custom_property` - account_custom_property\n\* `flag` - flag\n\* `workflow_variable` - workflow_variable'
),
operator: zod
.enum(['is_set', 'is_not_set'])
.describe('\* `is_set` - is_set\n\* `is_not_set` - is_not_set')
.describe(
'Existence check operator.\n\n\* `is_set` - is_set\n\* `is_not_set` - is_not_set'
),
})
.describe('Checks whether a property is set or not, without comparing values.'),
])
)
.nullish()
.describe(
"Event or person property filters. Each item should have 'key' (string), 'value' (string, number, boolean, or array), optional 'operator' (exact, is_not, is_set, is_not_set, icontains, not_icontains, regex, not_regex, gt, gte, lt, lte), and optional 'type' (event, person)."
),
selector: zod
.string()
.nullish()
.describe("CSS selector to match the target element (e.g. 'div > button.cta')."),
selector_regex: zod
.string()
.nullable()
.describe(
'Compiled regex the selector matches against the event elements chain. Null when no selector is set.'
),
selector_warning: zod
.string()
.nullable()
.describe(
'Set when the selector compiles to a matcher that cannot match any event. Null when the selector is valid or absent.'
),
tag_name: zod
.string()
.nullish()
.describe('HTML tag name to match (e.g. \"button\", \"a\", \"input\").'),
text: zod.string().nullish().describe('Element text content to match.'),
text_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the text value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
href: zod.string().nullish().describe('Link href attribute to match.'),
href_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the href value. Defaults to exact.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
url: zod.string().nullish().describe('Page URL to match.'),
url_matching: zod
.union([
zod
.enum(['contains', 'regex', 'exact'])
.describe('\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'),
zod.null(),
])
.optional()
.describe(
'How to match the URL value. Defaults to contains.\n\n\* `contains` - contains\n\* `regex` - regex\n\* `exact` - exact'
),
})
)
.optional()
.describe(
'Action steps defining trigger conditions. Each step matches events by name, properties, URL, or element attributes. Multiple steps are OR-ed together.'
),
deleted: zod.boolean().optional(),
last_calculated_at: zod.iso.datetime({ offset: true }).optional(),
pinned_at: zod.iso
.datetime({ offset: true })
.nullish()
.describe(
'ISO 8601 timestamp when the action was pinned, or null if not pinned. Set any value to pin, null to unpin.'
),
_create_in_folder: zod.string().optional(),
})
.describe('Serializer mixin that handles tags for objects.')
/**
* Bulk update tags on multiple objects.
*
* PAT access: this action has no ``required_scopes=`` on the decorator —
* inheriting viewsets must add ``"bulk_update_tags"`` to their
* ``scope_object_write_actions`` list to accept personal API keys.
* Without that opt-in, ``APIScopePermission`` rejects PAT requests with
* "This action does not support personal API key access". Done per-viewset
* so granting ``<scope>:write`` for one resource doesn't leak access to
* sibling resources that share this mixin.
*
* Accepts:
* - {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}
*
* Actions:
* - "add": Add tags to existing tags on each object
* - "remove": Remove specific tags from each object
* - "set": Replace all tags on each object with the provided list
*/
export const actionsBulkUpdateTagsCreateBodyIdsMax = 500
export const actionsBulkUpdateTagsCreateBodyTagsItemMax = 255
export const actionsBulkUpdateTagsCreateBodyTagsMax = 100
export const ActionsBulkUpdateTagsCreateBody = /* @__PURE__ */ zod.object({
ids: zod
.array(zod.number())
.max(actionsBulkUpdateTagsCreateBodyIdsMax)
.describe('List of object IDs to update tags on.'),
action: zod
.enum(['add', 'remove', 'set'])
.describe('\* `add` - add\n\* `remove` - remove\n\* `set` - set')
.describe(
"'add' merges with existing tags, 'remove' deletes specific tags, 'set' replaces all tags.\n\n\* `add` - add\n\* `remove` - remove\n\* `set` - set"
),
tags: zod
.array(zod.string().max(actionsBulkUpdateTagsCreateBodyTagsItemMax))
.max(actionsBulkUpdateTagsCreateBodyTagsMax)
.describe('Tag names to add, remove, or set (up to 100 per request, 255 characters each).'),
})