PostHog query API

The query API from PostHog — 14 operation(s) for query.

OpenAPI Specification

posthog-query-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PostHog actions query API
  version: 1.0.0
  description: ''
tags:
- name: query
paths:
  /api/environments/{environment_id}/query/:
    post:
      operationId: environments_query_create
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QueryRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QueryRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponseAlternative'
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/{id}/:
    get:
      operationId: environments_query_retrieve
      description: (Experimental)
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
        required: true
      tags:
      - query
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryStatusResponse'
          description: ''
      deprecated: true
      x-explicit-tags: []
    delete:
      operationId: environments_query_destroy
      description: (Experimental)
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
        required: true
      tags:
      - query
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '204':
          description: Query cancelled
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/{id}/log/:
    get:
      operationId: environments_query_log_retrieve
      description: Get query log details from query_log_archive table for a specific query_id, the query must have been issued in last 24 hours.
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: id
        schema:
          type: string
        required: true
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/{query_kind}/:
    post:
      operationId: environments_query_create_with_kind
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      - in: path
        name: query_kind
        schema:
          type: string
          pattern: ^[A-Z][A-Za-z]*$
        required: true
      tags:
      - query
      responses:
        '200':
          description: No response body
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/check_auth_for_async/:
    post:
      operationId: environments_query_check_auth_for_async_create
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/draft_sql/:
    get:
      operationId: environments_query_draft_sql_retrieve
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/environments/{environment_id}/query/upgrade/:
    post:
      operationId: environments_query_upgrade_create
      description: Upgrades a query without executing it. Returns a query with all nodes migrated to the latest version.
      parameters:
      - $ref: '#/components/parameters/EnvironmentIdPath'
      tags:
      - query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryUpgradeResponse'
          description: ''
      deprecated: true
      x-explicit-tags: []
  /api/projects/{project_id}/query/:
    post:
      operationId: query_create
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QueryRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QueryRequest'
        required: true
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponseAlternative'
          description: ''
      x-explicit-tags: []
  /api/projects/{project_id}/query/{id}/:
    get:
      operationId: query_retrieve
      description: (Experimental)
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryStatusResponse'
          description: ''
      x-explicit-tags: []
    delete:
      operationId: query_destroy
      description: (Experimental)
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      security:
      - PersonalAPIKeyAuth:
        - query:read
      responses:
        '204':
          description: Query cancelled
      x-explicit-tags: []
  /api/projects/{project_id}/query/{id}/log/:
    get:
      operationId: query_log_retrieve
      description: Get query log details from query_log_archive table for a specific query_id, the query must have been issued in last 24 hours.
      parameters:
      - in: path
        name: id
        schema:
          type: string
        required: true
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      x-explicit-tags: []
  /api/projects/{project_id}/query/{query_kind}/:
    post:
      operationId: query_create_with_kind
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      - in: path
        name: query_kind
        schema:
          type: string
          pattern: ^[A-Z][A-Za-z]*$
        required: true
      tags:
      - query
      responses:
        '200':
          description: No response body
      x-explicit-tags: []
  /api/projects/{project_id}/query/check_auth_for_async/:
    post:
      operationId: query_check_auth_for_async_create
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      x-explicit-tags: []
  /api/projects/{project_id}/query/draft_sql/:
    get:
      operationId: query_draft_sql_retrieve
      description: 'DRF ViewSet mixin that gates coalesced responses behind permission checks.


        The QueryCoalescingMiddleware attaches cached response data to

        request.META["_coalesced_response"] for followers. This mixin runs DRF''s

        initial() (auth + permissions + throttling) before returning the

        cached response, ensuring the request is authorized.'
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
          description: ''
      x-explicit-tags: []
  /api/projects/{project_id}/query/upgrade/:
    post:
      operationId: query_upgrade_create
      description: Upgrades a query without executing it. Returns a query with all nodes migrated to the latest version.
      parameters:
      - $ref: '#/components/parameters/ProjectIdPath'
      tags:
      - query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/QueryUpgradeRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryUpgradeResponse'
          description: ''
      x-explicit-tags: []
components:
  schemas:
    Response6:
      additionalProperties: false
      properties:
        columns:
          default: null
          title: Columns
          items: {}
          type: array
          nullable: true
        error:
          default: null
          description: Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.
          title: Error
          type: string
          nullable: true
        hasMore:
          default: null
          title: Hasmore
          type: boolean
          nullable: true
        hogql:
          default: null
          description: Generated HogQL query.
          title: Hogql
          type: string
          nullable: true
        limit:
          default: null
          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
          title: Offset
          type: integer
          nullable: true
        query_status:
          default: null
          description: Query status indicates whether next to the provided data, a query is still running.
          allOf:
          - $ref: '#/components/schemas/QueryStatus'
          nullable: true
        resolved_date_range:
          default: null
          description: The date range used for the query
          allOf:
          - $ref: '#/components/schemas/ResolvedDateRangeResponse'
          nullable: true
        results:
          items: {}
          title: Results
          type: array
        samplingRate:
          default: null
          allOf:
          - $ref: '#/components/schemas/SamplingRate'
          nullable: true
        timings:
          default: null
          description: Measured timings for different parts of the query generation process
          title: Timings
          items:
            $ref: '#/components/schemas/QueryTiming'
          type: array
          nullable: true
        types:
          default: null
          title: Types
          items: {}
          type: array
          nullable: true
      required:
      - results
      title: Response6
      type: object
    RetentionFilter:
      additionalProperties: false
      properties:
        aggregationProperty:
          default: null
          description: The property to aggregate when aggregationType is sum or avg
          title: Aggregationproperty
          type: string
          nullable: true
        aggregationPropertyType:
          default: event
          description: The type of property to aggregate on (event or person). Defaults to event.
          allOf:
          - $ref: '#/components/schemas/AggregationPropertyType'
          nullable: true
        aggregationType:
          default: count
          description: The aggregation type to use for retention
          allOf:
          - $ref: '#/components/schemas/AggregationType'
          nullable: true
        cumulative:
          default: null
          title: Cumulative
          type: boolean
          nullable: true
        customAggregationTarget:
          default: null
          description: For data warehouse based retention insights when the aggregation target can't be mapped to persons or groups.
          title: Customaggregationtarget
          type: boolean
          nullable: true
        dashboardDisplay:
          default: null
          allOf:
          - $ref: '#/components/schemas/RetentionDashboardDisplayType'
          nullable: true
        display:
          default: null
          description: controls the display of the retention graph
          allOf:
          - $ref: '#/components/schemas/ChartDisplayType'
          nullable: true
        goalLines:
          default: null
          title: Goallines
          items:
            $ref: '#/components/schemas/GoalLine'
          type: array
          nullable: true
        meanRetentionCalculation:
          default: null
          allOf:
          - $ref: '#/components/schemas/MeanRetentionCalculation'
          nullable: true
        minimumOccurrences:
          default: null
          title: Minimumoccurrences
          type: integer
          nullable: true
        period:
          default: Day
          allOf:
          - $ref: '#/components/schemas/RetentionPeriod'
          nullable: true
        retentionCustomBrackets:
          default: null
          description: Custom brackets for retention calculations
          title: Retentioncustombrackets
          items:
            type: number
          type: array
          nullable: true
        retentionReference:
          default: null
          description: Whether retention is with regard to initial cohort size, or that of the previous period.
          allOf:
          - $ref: '#/components/schemas/RetentionReference'
          nullable: true
        retentionType:
          default: null
          allOf:
          - $ref: '#/components/schemas/RetentionType'
          nullable: true
        returningEntity:
          default: null
          allOf:
          - $ref: '#/components/schemas/RetentionEntity'
          nullable: true
        selectedInterval:
          default: null
          description: The selected interval to display across all cohorts (null = show all intervals for each cohort)
          title: Selectedinterval
          type: integer
          nullable: true
        showTrendLines:
          default: null
          title: Showtrendlines
          type: boolean
          nullable: true
        targetEntity:
          default: null
          allOf:
          - $ref: '#/components/schemas/RetentionEntity'
          nullable: true
        timeWindowMode:
          default: null
          description: The time window mode to use for retention calculations
          allOf:
          - $ref: '#/components/schemas/TimeWindowMode'
          nullable: true
        totalIntervals:
          default: 8
          title: Totalintervals
          type: integer
          nullable: true
      title: RetentionFilter
      type: object
    Integration:
      additionalProperties: false
      properties:
        display_name:
          title: Display Name
          type: string
        id:
          title: Id
          type: number
        kind:
          $ref: '#/components/schemas/IntegrationKind'
      required:
      - display_name
      - id
      - kind
      title: Integration
      type: object
    LLMTrace:
      additionalProperties: false
      properties:
        aiSessionId:
          default: null
          title: Aisessionid
          type: string
          nullable: true
        createdAt:
          title: Createdat
          type: string
        distinctId:
          title: Distinctid
          type: string
        errorCount:
          default: null
          title: Errorcount
          type: number
          nullable: true
        events:
          items:
            $ref: '#/components/schemas/LLMTraceEvent'
          title: Events
          type: array
        id:
          title: Id
          type: string
        inputCost:
          default: null
          title: Inputcost
          type: number
          nullable: true
        inputState:
          default: null
          title: Inputstate
          nullable: true
        inputTokens:
          default: null
          title: Inputtokens
          type: number
          nullable: true
        isSupportTrace:
          default: null
          title: Issupporttrace
          type: boolean
          nullable: true
        outputCost:
          default: null
          title: Outputcost
          type: number
          nullable: true
        outputState:
          default: null
          title: Outputstate
          nullable: true
        outputTokens:
          default: null
          title: Outputtokens
          type: number
          nullable: true
        person:
          default: null
          allOf:
          - $ref: '#/components/schemas/LLMTracePerson'
          nullable: true
        requestCost:
          default: null
          title: Requestcost
          type: number
          nullable: true
        tools:
          default: null
          title: Tools
          items:
            type: string
          type: array
          nullable: true
        totalCost:
          default: null
          title: Totalcost
          type: number
          nullable: true
        totalLatency:
          default: null
          title: Totallatency
          type: number
          nullable: true
        traceName:
          default: null
          title: Tracename
          type: string
          nullable: true
        webSearchCost:
          default: null
          title: Websearchcost
          type: number
          nullable: true
      required:
      - createdAt
      - distinctId
      - events
      - id
      title: LLMTrace
      type: object
    SuggestedQuestionsQueryResponse:
      additionalProperties: false
      properties:
        questions:
          items:
            type: string
          title: Questions
          type: array
      required:
      - questions
      title: SuggestedQuestionsQueryResponse
      type: object
    MaterializationType:
      enum:
      - materialized
      - inline
      - null
      title: MaterializationType
    ActorsQueryResponse:
      additionalProperties: false
      properties:
        columns:
          items: {}
          title: Columns
          type: array
        error:
          default: null
          description: Query error. Returned only if 'explain' or `modifiers.debug` is true. Throws an error otherwise.
          title: Error
          type: string
          nullable: true
        hasMore:
          default: null
          title: Hasmore
          type: boolean
          nullable: true
        hogql:
          description: Generated HogQL query.
          title: Hogql
          type: string
        limit:
          title: Limit
          type: integer
        missing_actors_count:
          default: null
          title: Missing Actors Count
          type: integer
          nullable: true
        modifiers:
          default: null
          description: Modifiers used when performing the query
          allOf:
          - $ref: '#/components/schemas/HogQLQueryModifiers'
          nullable: true
        offset:
          title: Offset
          type: integer
        query_status:
          default: null
          description: Query status indicates whether next to the provided data, a query is still running.
          allOf:
          - $ref: '#/components/schemas/QueryStatus'
          nullable: true
        resolved_date_range:
          default: null
          description: The date range used for the query
          allOf:
          - $ref: '#/components/schemas/ResolvedDateRangeResponse'
          nullable: true
        results:
          items:
            items: {}
            type: array
          title: Results
          type: array
        timings:
          default: null
          description: Measured timings for different parts of the query generation process
          title: Timings
          items:
            $ref: '#/components/schemas/QueryTiming'
          type: array
          nullable: true
        types:
          default: null
          title: Types
          items:
            type: string
          type: array
          nullable: true
      required:
      - columns
      - hogql
      - limit
      - offset
      - results
      title: ActorsQueryResponse
      type: object
    EventsNode:
      additionalProperties: false
      properties:
        custom_name:
          default: null
          title: Custom Name
          type: string
          nullable: true
        event:
          default: null
          description: The event or `null` for all events.
          title: Event
          type: string
          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/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: EventsNode
          title: Kind
          type: string
          enum:
          - EventsNode
        limit:
          default: null
          title: Limit
          type: integer
          nullable: true
        math:
          default: null
          title: Math
          anyOf:
          - $ref: '#/components/schemas/BaseMathType'
          - $ref: '#/components/schemas/FunnelMathType'
          - $ref: '#/components/schemas/PropertyMathType'
          - $ref: '#/components/schemas/CountPerActorMathType'
          - $ref: '#/components/schemas/ExperimentMetricMathType'
          - $ref: '#/components/schemas/CalendarHeatmapMathType'
          - type: string
            enum:
            - unique_group
          - type: string
            enum:
            - hogql
          nullable: true
        math_group_type_index:
          default: null
          allOf:
          - $ref: '#/components/schemas/MathGroupTypeIndex'
          nullable: true
        math_hogql:
          default: null
          title: Math Hogql
          type: string
          nullable: true
        math_multiplier:
          default: null
          title: Math Multiplier
          type: number
          nullable: true
        math_property:
          default: null
          title: Math Property
          type: string
          nullable: true
        math_property_revenue_currency:
          default: null
          allOf:
          - $ref: '#/components/schemas/RevenueCurrencyPropertyConfig'
          nullable: true
        math_property_type:
          default: null
          title: Math Property Type
          type: string
          nullable: true
        name:
          default: null
          title: Name
          type: string
          nullable: true
        optionalInFunnel:
          default: null
          title: Optionalinfunnel
          type: boolean
          nullable: true
        orderBy:
          default: null
          description: Columns to order by
          title: Orderby
          items:
            type: string
          type: array
          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
          title: Response
          additionalProperties: true
          type: object
          nullable: true
        version:
          default: null
          description: version of the node, used for schema migrations
          title: Version
          type: number
          nullable: true
      title: EventsNode
      type: object
    TraceSpansQuery:
      additionalProperties: false
      properties:
        after:
          default: null
          description: Cursor for fetching the next page of results
          title: After
          type: string
          nullable: true
        dateRange:
          $ref: '#/components/schemas/DateRange'
        filterGroup:
          default: null
          allOf:
          - $ref: '#/components/schemas/PropertyGroupFilter'
          nullable: true
        kind:
          default: TraceSpansQuery
          title: Kind
          type: string
          enum:
          - TraceSpansQuery
        limit:
          default: null
          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
          title: Offset
          type: integer
          nullable: true
        orderBy:
          default: null
          allOf:
          - $ref: '#/components/schemas/LogsOrderBy'
          nullable: true
        prefetchSpans:
          default: null
          description: Prefetch up to this many spans per trace and include them in results
          title: Prefetchspans
          type: integer
          nullable: true
        response:
          default: null
          allOf:
          - $ref: '#/components/schemas/TraceSpansQueryResponse'
          nullable: true
        rootSpans:
          default: null
          title: Rootspans
          type: boolean
          nullable: true
        serviceNames:
          default: null
          title: Servicenames
          items:
            type: string
          type: array


# --- truncated at 32 KB (881 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/openapi/posthog-query-api-openapi.yml