Skip to main content
GET
/
segmentation
Query Segmentation Report
curl --request GET \
  --url https://{regionAndDomain}.com/api/query/segmentation \
  --header 'Authorization: Basic <encoded-value>'
{
  "data": {
    "series": [
      "2011-08-08",
      "2011-08-09",
      "2011-08-06",
      "2011-08-07"
    ],
    "values": {
      "Signed up": {
        "2011-08-06": 147,
        "2011-08-07": 146,
        "2011-08-08": 776,
        "2011-08-09": 1376
      }
    }
  },
  "legend_size": 1
}

Authorizations

Authorization
string
header
required

Service Account

Query Parameters

project_id
integer
required

Required if using service account to authenticate request.

workspace_id
integer

The id of the workspace if applicable.

event
string
required

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

from_date
string
required

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

to_date
string
required

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

on
string

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

unit
enum<string>

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".

Available options:
minute,
hour,
day,
month
interval
integer

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.

where
string

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

limit
integer

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

type
enum<string>

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".

Available options:
general,
unique,
average
format
enum<string>

Can be set to "csv".

Available options:
csv

Response

200 - application/json

Success.

data
object
legend_size
integer

List of all dates.