Retrieve segmentations

/data/v2/projects/{projectToken}/analyses/segmentation

Retrieve calculated (materialized) results of an already existing segmentation.

Please note that:

  • Results of your analyses may contain Private data (PII)
  • Results may be cached for up to 10 minutes

Definition

Authorization

In this API call you must use the following authorization access and permissions:

Available access typePermissions needed
Private accessGDPR > Export analyses > Allow

Read more about:

Path parameters

ParameterTypeDescriptionRequired
projectTokenstringThe ID of your project.Required

Body Parameters

ParameterTypeDescriptionRequired
analysis_idstringThe ID of the segmentation you want to retrieve. This can be found in the URL when editing an analyses.Required
execution_timestringTo which timestamp should the segmentation be evaluated. The default value is current time.No
timezonestringWhich timezone should the customer filter and attributes be evaluated on. The default value is UTC.No
formatstringHow should the segmentation's output be formatted.

csv - Formatted as CSV table with header row.

table_json - Similar to CSV format, but with data represented in JSON.
Required

Header

ParameterTypeDescriptionRequired
authorizationstringUsed for authentication. Read more in the Authentication section.Required
content-typestringapplication/jsonRequired

Response description

JSON format

AttributeTypeDescription
namestringThe name of the requested segmentation, as displayed in the app.
headerarray of stringNames of the columns.

"segment", segment metrics, and "#" as total segment size.
rowsarray of arrays of valuesValues of rows as indicated by header.
successbooleanResult status

Additional payload and response examples

{
    "analysis_id": "606488856f8cf6f848b20af8",
    "timezone": "Europe/Bratislava",
    "format": "csv"
}
segment,count(purchase),avg(purchase.total_price),#
online buyers,3,64.66666666666667,2
offline buyers,1,65,1
{
    "header": [
        "segment",
        "count(purchase)",
        "avg(purchase.total_price)",
        "#"
    ],
    "name": "buyers by source",
    "rows": [
        [
            "online buyers",
            3,
            64.66666666666667,
            2
        ],
        [
            "offline buyers",
            1,
            65,
            1
        ]
    ],
    "success": true
}
Language
Click Try It! to start a request and see the response here!