PostHog · Schema
EventsQuery
A/B TestingAnalyticsFeature FlagsOpen SourceProduct AnalyticsSession Recording
Properties
| Name | Type | Description |
|---|---|---|
| actionId | integer | Show events matching a given action |
| actionSteps | array | Show events matching action steps directly, used when no actionId is provided (e.g. previewing unsaved actions). Ignored if actionId is set. |
| after | string | Only fetch events that happened after this timestamp |
| before | string | Only fetch events that happened before this timestamp |
| event | string | Limit to events matching this string |
| events | array | Filter to events matching any of these event names |
| filterTestAccounts | boolean | Filter test accounts |
| fixedProperties | array | Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person) |
| kind | string | |
| limit | integer | Number of rows to return |
| modifiers | object | Modifiers used when performing the query |
| offset | integer | Number of rows to skip before returning rows |
| orderBy | array | Columns to order by |
| personId | string | Show events for a given person |
| properties | array | Properties configurable in the interface |
| response | object | |
| select | array | Return a limited set of data. Required. |
| source | object | source for querying events for insights |
| tags | object | |
| version | number | version of the node, used for schema migrations |
| where | array | HogQL filters to apply on returned data |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/EventsQuery",
"title": "EventsQuery",
"additionalProperties": false,
"properties": {
"actionId": {
"default": null,
"description": "Show events matching a given action",
"title": "Actionid",
"type": "integer",
"nullable": true
},
"actionSteps": {
"default": null,
"description": "Show events matching action steps directly, used when no actionId is provided (e.g. previewing unsaved actions). Ignored if actionId is set.",
"title": "Actionsteps",
"items": {
"$ref": "#/components/schemas/EventsQueryActionStep"
},
"type": "array",
"nullable": true
},
"after": {
"default": null,
"description": "Only fetch events that happened after this timestamp",
"title": "After",
"type": "string",
"nullable": true
},
"before": {
"default": null,
"description": "Only fetch events that happened before this timestamp",
"title": "Before",
"type": "string",
"nullable": true
},
"event": {
"default": null,
"description": "Limit to events matching this string",
"title": "Event",
"type": "string",
"nullable": true
},
"events": {
"default": null,
"description": "Filter to events matching any of these event names",
"title": "Events",
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"filterTestAccounts": {
"default": null,
"description": "Filter test accounts",
"title": "Filtertestaccounts",
"type": "boolean",
"nullable": true
},
"fixedProperties": {
"default": null,
"description": "Fixed properties in the query, can't be edited in the interface (e.g. scoping down by person)",
"title": "Fixedproperties",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/PropertyGroupFilter"
},
{
"$ref": "#/components/schemas/PropertyGroupFilterValue"
},
{
"$ref": "#/components/schemas/EventPropertyFilter"
},
{
"$ref": "#/components/schemas/PersonPropertyFilter"
},
{
"$ref": "#/components/schemas/ElementPropertyFilter"
},
{
"$ref": "#/components/schemas/EventMetadataPropertyFilter"
},
{
"$ref": "#/components/schemas/SessionPropertyFilter"
},
{
"$ref": "#/components/schemas/CohortPropertyFilter"
},
{
"$ref": "#/components/schemas/RecordingPropertyFilter"
},
{
"$ref": "#/components/schemas/LogEntryPropertyFilter"
},
{
"$ref": "#/components/schemas/GroupPropertyFilter"
},
{
"$ref": "#/components/schemas/FeaturePropertyFilter"
},
{
"$ref": "#/components/schemas/FlagPropertyFilter"
},
{
"$ref": "#/components/schemas/HogQLPropertyFilter"
},
{
"$ref": "#/components/schemas/EmptyPropertyFilter"
},
{
"$ref": "#/components/schemas/DataWarehousePropertyFilter"
},
{
"$ref": "#/components/schemas/DataWarehousePersonPropertyFilter"
},
{
"$ref": "#/components/schemas/ErrorTrackingIssueFilter"
},
{
"$ref": "#/components/schemas/LogPropertyFilter"
},
{
"$ref": "#/components/schemas/SpanPropertyFilter"
},
{
"$ref": "#/components/schemas/RevenueAnalyticsPropertyFilter"
},
{
"$ref": "#/components/schemas/WorkflowVariablePropertyFilter"
}
]
},
"type": "array",
"nullable": true
},
"kind": {
"default": "EventsQuery",
"title": "Kind",
"type": "string",
"enum": [
"EventsQuery"
]
},
"limit": {
"default": null,
"description": "Number of rows to return",
"title": "Limit",
"type": "integer",
"nullable": true
},
"modifiers": {
"default": null,
"description": "Modifiers used when performing the query",
"allOf": [
{
"$ref": "#/components/schemas/HogQLQueryModifiers"
}
],
"nullable": true
},
"offset": {
"default": null,
"description": "Number of rows to skip before returning rows",
"title": "Offset",
"type": "integer",
"nullable": true
},
"orderBy": {
"default": null,
"description": "Columns to order by",
"title": "Orderby",
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"personId": {
"default": null,
"description": "Show events for a given person",
"title": "Personid",
"type": "string",
"nullable": true
},
"properties": {
"default": null,
"description": "Properties configurable in the interface",
"title": "Properties",
"items": {
"anyOf": [
{
"$ref": "#/components/schemas/EventPropertyFilter"
},
{
"$ref": "#/components/schemas/PersonPropertyFilter"
},
{
"$ref": "#/components/schemas/ElementPropertyFilter"
},
{
"$ref": "#/components/schemas/EventMetadataPropertyFilter"
},
{
"$ref": "#/components/schemas/SessionPropertyFilter"
},
{
"$ref": "#/components/schemas/CohortPropertyFilter"
},
{
"$ref": "#/components/schemas/RecordingPropertyFilter"
},
{
"$ref": "#/components/schemas/LogEntryPropertyFilter"
},
{
"$ref": "#/components/schemas/GroupPropertyFilter"
},
{
"$ref": "#/components/schemas/FeaturePropertyFilter"
},
{
"$ref": "#/components/schemas/FlagPropertyFilter"
},
{
"$ref": "#/components/schemas/HogQLPropertyFilter"
},
{
"$ref": "#/components/schemas/EmptyPropertyFilter"
},
{
"$ref": "#/components/schemas/DataWarehousePropertyFilter"
},
{
"$ref": "#/components/schemas/DataWarehousePersonPropertyFilter"
},
{
"$ref": "#/components/schemas/ErrorTrackingIssueFilter"
},
{
"$ref": "#/components/schemas/LogPropertyFilter"
},
{
"$ref": "#/components/schemas/SpanPropertyFilter"
},
{
"$ref": "#/components/schemas/RevenueAnalyticsPropertyFilter"
},
{
"$ref": "#/components/schemas/WorkflowVariablePropertyFilter"
}
]
},
"type": "array",
"nullable": true
},
"response": {
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/EventsQueryResponse"
}
],
"nullable": true
},
"select": {
"description": "Return a limited set of data. Required.",
"items": {
"type": "string"
},
"title": "Select",
"type": "array"
},
"source": {
"default": null,
"description": "source for querying events for insights",
"allOf": [
{
"$ref": "#/components/schemas/InsightActorsQuery"
}
],
"nullable": true
},
"tags": {
"default": null,
"allOf": [
{
"$ref": "#/components/schemas/QueryLogTags"
}
],
"nullable": true
},
"version": {
"default": null,
"description": "version of the node, used for schema migrations",
"title": "Version",
"type": "number",
"nullable": true
},
"where": {
"default": null,
"description": "HogQL filters to apply on returned data",
"title": "Where",
"items": {
"type": "string"
},
"type": "array",
"nullable": true
}
},
"required": [
"select"
],
"type": "object"
}