Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

24.3 KB
Raw Blame
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "base_updated_at": {
            "description": "Optimistic concurrency: the updated_at (or draft_updated_at when editing a staged draft) you last read. If the stored side is newer, the write fails with 409 instead of overwriting the concurrent edit. Omit to overwrite unconditionally.",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
            "type": "string"
        },
        "description": {
            "description": "Human-readable description of what this function does.",
            "type": "string"
        },
        "enabled": {
            "description": "Set to true to activate or false to deactivate the function.",
            "type": "boolean"
        },
        "execution_order": {
            "anyOf": [
                {
                    "maximum": 32767,
                    "minimum": 0,
                    "type": "number"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Execution priority for transformations. Lower values run first."
        },
        "filters": {
            "description": "Event filters that control which events trigger this function.",
            "properties": {
                "actions": {
                    "items": {
                        "additionalProperties": {},
                        "propertyNames": {
                            "type": "string"
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "bytecode_contract": {
                    "type": "string"
                },
                "data_warehouse": {
                    "items": {
                        "additionalProperties": {},
                        "propertyNames": {
                            "type": "string"
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "events": {
                    "items": {
                        "additionalProperties": {},
                        "propertyNames": {
                            "type": "string"
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "filter_test_accounts": {
                    "type": "boolean"
                },
                "properties": {
                    "items": {
                        "additionalProperties": {},
                        "propertyNames": {
                            "type": "string"
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "source": {
                    "default": "events",
                    "description": "* `events` - events\n* `internal-events` - internal-events\n* `person-updates` - person-updates\n* `data-warehouse-table` - data-warehouse-table\n* `data-warehouse-view` - data-warehouse-view",
                    "enum": [
                        "events",
                        "internal-events",
                        "person-updates",
                        "data-warehouse-table",
                        "data-warehouse-view"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "hog": {
            "description": "Source code. Hog language for most types; TypeScript for site_destination and site_app.",
            "type": "string"
        },
        "icon_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "URL for the function's icon displayed in the UI."
        },
        "id": {
            "description": "A UUID string identifying this hog function.",
            "type": "string"
        },
        "inputs": {
            "additionalProperties": {
                "properties": {
                    "bytecode": {
                        "items": {},
                        "type": "array"
                    },
                    "bytecode_contract": {
                        "type": "string"
                    },
                    "order": {
                        "type": "number"
                    },
                    "templating": {
                        "description": "* `hog` - hog\n* `liquid` - liquid",
                        "enum": ["hog", "liquid"],
                        "type": "string"
                    },
                    "transpiled": {},
                    "value": {}
                },
                "type": "object"
            },
            "description": "Values for each input defined in inputs_schema.",
            "propertyNames": {
                "type": "string"
            },
            "type": "object"
        },
        "inputs_schema": {
            "description": "Schema defining the configurable input parameters for this function.",
            "items": {
                "properties": {
                    "choices": {
                        "items": {
                            "additionalProperties": {},
                            "propertyNames": {
                                "type": "string"
                            },
                            "type": "object"
                        },
                        "type": "array"
                    },
                    "default": {},
                    "description": {
                        "type": "string"
                    },
                    "hidden": {
                        "default": false,
                        "type": "boolean"
                    },
                    "key": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "required": {
                        "default": false,
                        "type": "boolean"
                    },
                    "searchable": {
                        "type": "boolean"
                    },
                    "secret": {
                        "default": false,
                        "type": "boolean"
                    },
                    "templating": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "enum": ["hog", "liquid"],
                                "type": "string"
                            }
                        ]
                    },
                    "type": {
                        "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_multi` - integration_multi\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes\n* `customer_analytics_account_properties` - customer_analytics_account_properties\n* `customer_analytics_account_relationships` - customer_analytics_account_relationships\n* `task_model` - task_model\n* `task_repository` - task_repository\n* `task_mcp_installations` - task_mcp_installations\n* `signals_scout` - signals_scout\n* `posthog_survey` - posthog_survey\n* `task_skills` - task_skills\n* `replay_vision_scan` - replay_vision_scan",
                        "enum": [
                            "string",
                            "number",
                            "boolean",
                            "dictionary",
                            "choice",
                            "json",
                            "integration",
                            "integration_multi",
                            "integration_field",
                            "email",
                            "native_email",
                            "posthog_assignee",
                            "posthog_ticket_tags",
                            "posthog_business_hours",
                            "non_failure_status_codes",
                            "customer_analytics_account_properties",
                            "customer_analytics_account_relationships",
                            "task_model",
                            "task_repository",
                            "task_mcp_installations",
                            "signals_scout",
                            "posthog_survey",
                            "task_skills",
                            "replay_vision_scan"
                        ],
                        "type": "string"
                    }
                },
                "required": ["type", "key"],
                "type": "object"
            },
            "type": "array"
        },
        "mappings": {
            "anyOf": [
                {
                    "items": {
                        "properties": {
                            "filters": {
                                "properties": {
                                    "actions": {
                                        "items": {
                                            "additionalProperties": {},
                                            "propertyNames": {
                                                "type": "string"
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "bytecode_contract": {
                                        "type": "string"
                                    },
                                    "data_warehouse": {
                                        "items": {
                                            "additionalProperties": {},
                                            "propertyNames": {
                                                "type": "string"
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "events": {
                                        "items": {
                                            "additionalProperties": {},
                                            "propertyNames": {
                                                "type": "string"
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "filter_test_accounts": {
                                        "type": "boolean"
                                    },
                                    "properties": {
                                        "items": {
                                            "additionalProperties": {},
                                            "propertyNames": {
                                                "type": "string"
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "source": {
                                        "default": "events",
                                        "description": "* `events` - events\n* `internal-events` - internal-events\n* `person-updates` - person-updates\n* `data-warehouse-table` - data-warehouse-table\n* `data-warehouse-view` - data-warehouse-view",
                                        "enum": [
                                            "events",
                                            "internal-events",
                                            "person-updates",
                                            "data-warehouse-table",
                                            "data-warehouse-view"
                                        ],
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            },
                            "inputs": {
                                "additionalProperties": {
                                    "properties": {
                                        "bytecode": {
                                            "items": {},
                                            "type": "array"
                                        },
                                        "bytecode_contract": {
                                            "type": "string"
                                        },
                                        "order": {
                                            "type": "number"
                                        },
                                        "templating": {
                                            "description": "* `hog` - hog\n* `liquid` - liquid",
                                            "enum": ["hog", "liquid"],
                                            "type": "string"
                                        },
                                        "transpiled": {},
                                        "value": {}
                                    },
                                    "type": "object"
                                },
                                "propertyNames": {
                                    "type": "string"
                                },
                                "type": "object"
                            },
                            "inputs_schema": {
                                "items": {
                                    "properties": {
                                        "choices": {
                                            "items": {
                                                "additionalProperties": {},
                                                "propertyNames": {
                                                    "type": "string"
                                                },
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "default": {},
                                        "description": {
                                            "type": "string"
                                        },
                                        "hidden": {
                                            "default": false,
                                            "type": "boolean"
                                        },
                                        "key": {
                                            "type": "string"
                                        },
                                        "label": {
                                            "type": "string"
                                        },
                                        "required": {
                                            "default": false,
                                            "type": "boolean"
                                        },
                                        "searchable": {
                                            "type": "boolean"
                                        },
                                        "secret": {
                                            "default": false,
                                            "type": "boolean"
                                        },
                                        "templating": {
                                            "anyOf": [
                                                {
                                                    "type": "boolean"
                                                },
                                                {
                                                    "enum": ["hog", "liquid"],
                                                    "type": "string"
                                                }
                                            ]
                                        },
                                        "type": {
                                            "description": "* `string` - string\n* `number` - number\n* `boolean` - boolean\n* `dictionary` - dictionary\n* `choice` - choice\n* `json` - json\n* `integration` - integration\n* `integration_multi` - integration_multi\n* `integration_field` - integration_field\n* `email` - email\n* `native_email` - native_email\n* `posthog_assignee` - posthog_assignee\n* `posthog_ticket_tags` - posthog_ticket_tags\n* `posthog_business_hours` - posthog_business_hours\n* `non_failure_status_codes` - non_failure_status_codes\n* `customer_analytics_account_properties` - customer_analytics_account_properties\n* `customer_analytics_account_relationships` - customer_analytics_account_relationships\n* `task_model` - task_model\n* `task_repository` - task_repository\n* `task_mcp_installations` - task_mcp_installations\n* `signals_scout` - signals_scout\n* `posthog_survey` - posthog_survey\n* `task_skills` - task_skills\n* `replay_vision_scan` - replay_vision_scan",
                                            "enum": [
                                                "string",
                                                "number",
                                                "boolean",
                                                "dictionary",
                                                "choice",
                                                "json",
                                                "integration",
                                                "integration_multi",
                                                "integration_field",
                                                "email",
                                                "native_email",
                                                "posthog_assignee",
                                                "posthog_ticket_tags",
                                                "posthog_business_hours",
                                                "non_failure_status_codes",
                                                "customer_analytics_account_properties",
                                                "customer_analytics_account_relationships",
                                                "task_model",
                                                "task_repository",
                                                "task_mcp_installations",
                                                "signals_scout",
                                                "posthog_survey",
                                                "task_skills",
                                                "replay_vision_scan"
                                            ],
                                            "type": "string"
                                        }
                                    },
                                    "required": ["type", "key"],
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Event-to-destination field mappings. Only for destination and site_destination types."
        },
        "masking": {
            "anyOf": [
                {
                    "properties": {
                        "hash": {
                            "description": "Hog expression used to compute the masking hash.",
                            "type": "string"
                        },
                        "threshold": {
                            "anyOf": [
                                {
                                    "type": "number"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "description": "Optional threshold count before masking applies."
                        },
                        "ttl": {
                            "description": "Time-to-live in seconds for the masking cache (60–86400).",
                            "maximum": 86400,
                            "minimum": 60,
                            "type": "number"
                        }
                    },
                    "required": ["ttl", "hash"],
                    "type": "object"
                },
                {
                    "type": "null"
                }
            ],
            "description": "PII masking configuration with TTL, threshold, and hash expression."
        },
        "name": {
            "anyOf": [
                {
                    "maxLength": 400,
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Display name for the function."
        },
        "template_id": {
            "anyOf": [
                {
                    "maxLength": 400,
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "ID of the template to create this function from."
        },
        "type": {
            "anyOf": [
                {
                    "description": "* `destination` - Destination\n* `site_destination` - Site Destination\n* `internal_destination` - Internal Destination\n* `source_webhook` - Source Webhook\n* `warehouse_source_webhook` - Warehouse Source Webhook\n* `site_app` - Site App\n* `transformation` - Transformation\n* `transformation_log` - Transformation Log\n* `legacy_destination` - Legacy Destination",
                    "enum": [
                        "destination",
                        "site_destination",
                        "internal_destination",
                        "source_webhook",
                        "warehouse_source_webhook",
                        "site_app",
                        "transformation",
                        "transformation_log",
                        "legacy_destination"
                    ],
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "Function type: destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation, or transformation_log.\n\n* `destination` - Destination\n* `site_destination` - Site Destination\n* `internal_destination` - Internal Destination\n* `source_webhook` - Source Webhook\n* `warehouse_source_webhook` - Warehouse Source Webhook\n* `site_app` - Site App\n* `transformation` - Transformation\n* `transformation_log` - Transformation Log\n* `legacy_destination` - Legacy Destination"
        }
    },
    "required": ["id"],
    "type": "object"
}