v1

latestOpenAPI 3.0.3MIT2026-07-26104113247.1 KB
Segmentation

Query Segmentation Report

Get data for an event, segmented and filtered by properties. The Query API has a rate limit of 60 queries per hour and a maximum of 5 concurrent queries.

get/segmentation

Query parameters

project_idinteger required

Required if using service account to authenticate request.

workspace_idinteger

The id of the workspace if applicable.

eventstring required

The event that you wish to get data for. Note: this is a single event name, not an array.

from_datestring required

The date in yyyy-mm-dd format to begin querying from. This date is inclusive.

to_datestring required

The date in yyyy-mm-dd format to query to. This date is inclusive.

onstring

The property expression to segment the event on. See the expression to segment below.

unit'minute' | 'hour' | 'day' | 'month'

This can be "minute", "hour", "day", or "month". This determines the buckets into which the property values that you segment on are placed. The default value is "day".

intervalinteger

Optional parameter in lieu of 'unit' when 'type' is not 'general'. Determines the number of days your results are bucketed into can be used with or without 'from_date' and 'to_date' parameters.

wherestring

An expression to filter events by. See the expression to segment below.

limitinteger

Return the top property values. Defaults to 60. Maximum value 10,000. This parameter does nothing if "on" is not specified.

type'general' | 'unique' | 'average'

This can be "general", "unique", or "average". If this is set to "unique", we return the unique count of events or property values. If set to "general", we return the total, including repeats. If set to "average", we return the average count. The default value is "general".

format'csv'

Can be set to "csv".

Response

Success.

legend_sizeinteger

List of all dates.