PostHog · Schema

TrendsQuery

A/B TestingAnalyticsFeature FlagsOpen SourceProduct AnalyticsSession Recording

Properties

Name Type Description
aggregation_group_type_index integer Groups aggregation
breakdownFilter object Breakdown of the events and actions
compareFilter object Compare to date range
conversionGoal object Whether we should be comparing against a specific conversion goal
dataColorTheme number Colors used in the insight's visualization
dateRange object Date range for the query
filterTestAccounts boolean Exclude internal and test users by applying the respective filters
interval object Granularity of the response. Can be one of `hour`, `day`, `week` or `month`
kind string
modifiers object Modifiers used when performing the query
properties object Property filters for all series
response object
samplingFactor number Sampling rate
series array Events and actions to include
tags object Tags that will be added to the Query log comment
trendsFilter object Properties specific to the trends insight
version number version of the node, used for schema migrations
View JSON Schema on GitHub

JSON Schema

posthog-trendsquery-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/TrendsQuery",
  "title": "TrendsQuery",
  "additionalProperties": false,
  "properties": {
    "aggregation_group_type_index": {
      "default": null,
      "description": "Groups aggregation",
      "title": "Aggregation Group Type Index",
      "type": "integer",
      "nullable": true
    },
    "breakdownFilter": {
      "default": null,
      "description": "Breakdown of the events and actions",
      "allOf": [
        {
          "$ref": "#/components/schemas/BreakdownFilter"
        }
      ],
      "nullable": true
    },
    "compareFilter": {
      "default": null,
      "description": "Compare to date range",
      "allOf": [
        {
          "$ref": "#/components/schemas/CompareFilter"
        }
      ],
      "nullable": true
    },
    "conversionGoal": {
      "default": null,
      "description": "Whether we should be comparing against a specific conversion goal",
      "title": "Conversiongoal",
      "anyOf": [
        {
          "$ref": "#/components/schemas/ActionConversionGoal"
        },
        {
          "$ref": "#/components/schemas/CustomEventConversionGoal"
        }
      ],
      "nullable": true
    },
    "dataColorTheme": {
      "default": null,
      "description": "Colors used in the insight's visualization",
      "title": "Datacolortheme",
      "type": "number",
      "nullable": true
    },
    "dateRange": {
      "default": null,
      "description": "Date range for the query",
      "allOf": [
        {
          "$ref": "#/components/schemas/DateRange"
        }
      ],
      "nullable": true
    },
    "filterTestAccounts": {
      "default": false,
      "description": "Exclude internal and test users by applying the respective filters",
      "title": "Filtertestaccounts",
      "type": "boolean",
      "nullable": true
    },
    "interval": {
      "default": "day",
      "description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`",
      "allOf": [
        {
          "$ref": "#/components/schemas/IntervalType"
        }
      ],
      "nullable": true
    },
    "kind": {
      "default": "TrendsQuery",
      "title": "Kind",
      "type": "string",
      "enum": [
        "TrendsQuery"
      ]
    },
    "modifiers": {
      "default": null,
      "description": "Modifiers used when performing the query",
      "allOf": [
        {
          "$ref": "#/components/schemas/HogQLQueryModifiers"
        }
      ],
      "nullable": true
    },
    "properties": {
      "default": [],
      "description": "Property filters for all series",
      "title": "Properties",
      "anyOf": [
        {
          "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"
        },
        {
          "$ref": "#/components/schemas/PropertyGroupFilter"
        }
      ],
      "nullable": true
    },
    "response": {
      "default": null,
      "allOf": [
        {
          "$ref": "#/components/schemas/TrendsQueryResponse"
        }
      ],
      "nullable": true
    },
    "samplingFactor": {
      "default": null,
      "description": "Sampling rate",
      "title": "Samplingfactor",
      "type": "number",
      "nullable": true
    },
    "series": {
      "description": "Events and actions to include",
      "items": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/GroupNode"
          },
          {
            "$ref": "#/components/schemas/EventsNode"
          },
          {
            "$ref": "#/components/schemas/ActionsNode"
          },
          {
            "$ref": "#/components/schemas/DataWarehouseNode"
          }
        ]
      },
      "title": "Series",
      "type": "array"
    },
    "tags": {
      "default": null,
      "description": "Tags that will be added to the Query log comment",
      "allOf": [
        {
          "$ref": "#/components/schemas/QueryLogTags"
        }
      ],
      "nullable": true
    },
    "trendsFilter": {
      "default": null,
      "description": "Properties specific to the trends insight",
      "allOf": [
        {
          "$ref": "#/components/schemas/TrendsFilter"
        }
      ],
      "nullable": true
    },
    "version": {
      "default": null,
      "description": "version of the node, used for schema migrations",
      "title": "Version",
      "type": "number",
      "nullable": true
    }
  },
  "required": [
    "series"
  ],
  "type": "object"
}