Analytics building blocks tools

Event segmentations also appear under the Marketing > Customer filters and segments page, since they're often used as named customer groups.

search_expressions

Searches the expressions defined in a project, or fetches one by ID. Expressions are derived attributes computed from a formula: they combine customer or event attributes (properties, aggregates, running aggregates), functions (such as min, max, ifnull, floor, and concat), operators, and string literals.

Omit expression_id to list all expressions. The response gives you the name, context type (customer or event), variable bindings, tags, and which customer or event attributes surface the result. The formula string is not included in list mode. By default the list returns only active (non-archived) expressions; set include_archived to true to return only archived ones. Pass expression_id to fetch the full definition of a single expression, including its formula, ordered variable bindings, exposing properties, filters, and metadata.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
expression_idstrNoThe expression ID. Omit to list all expressions; provide to fetch one.
include_archivedboolNoList mode only: if true, return only archived expressions. Defaults to false. Ignored when expression_id is provided.

Response parameters

The tool returns an ExpressionsResponse when expression_id is omitted, or an ExpressionResponse when it's provided.

When expression_id is omitted, the ExpressionsResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[ExpressionSummary]The expressions defined in the project.
archived_items_existboolWhether archived expressions exist in this project. Populated only when include_archived is false.
errorstr | nullError message if the request failed.

The ExpressionSummary object has the following fields:

FieldTypeDescription
idstrThe expression's unique ID.
namestrThe expression's display name.
context_typestrThe context the expression operates on: customer or event.
event_typestr | nullThe event type, when context_type is event.
all_exposing_propertieslist[ExpressionPropertyRef]Customer properties that surface this expression's computed value. Empty if it isn't yet exposed.
archivedboolWhether the expression has been archived.
parametrizedboolWhether the expression accepts parameters.
tagslist[str]User-defined tags.
created_by_display_namestrDisplay name of the creator.
editedfloatUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.
is_global_objectboolWhether the expression is shared across projects.
version_idstrThe version ID of the current definition.
used_bylist[any]Segmentations, reports, funnels, or campaigns that reference this expression.

When expression_id is provided, the ExpressionResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataExpression | nullThe full expression record.
errorstr | nullError message if the request failed.

The Expression object has the following fields:

FieldTypeDescription
idstrThe expression's unique ID.
namestrThe expression's display name.
descriptionstr | nullAn optional written description. Often null.
formulastrThe formula that combines variables (A–Z) with functions and operators. Available functions: abs(A), concat(A,B), exp(A), max(A,B), min(A,B), ifnull(A,B), floor(A), ceil(A), lower(A), upper(A), round(A), ln(A), now(), length(A), sqrt(A), and power(A,B).
context_typestrcustomer or event.
event_typestr | nullThe event type, when context_type is event.
memberslist[ExpressionMember]Variable bindings in declaration order: the first is A, the second is B, and so on. Each maps to a customer or event attribute, an aggregate, a running aggregate, or an inline constant.
exposing_propertieslist[ExpressionPropertyRef]Customer properties that surface this expression's computed value.
filterslist[any]Filters applied before the expression is evaluated.
tagslist[str]User-defined tags.
archivedboolWhether the expression has been archived.
parametrizedboolWhether the expression accepts parameters.
parametersany | nullThe parameter definitions, when parametrized is true.
company_idstrThe project ID this expression belongs to.
createdanyUnix timestamp of when the expression was created.
created_by_display_namestrDisplay name of the creator.
editedfloatUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.
is_global_objectboolWhether the expression is shared across projects.
version_idstrThe version ID of the current definition.
used_bylist[any]Segmentations, reports, funnels, or campaigns that reference this expression.

search_aggregates

Searches the aggregates defined in a project, or fetches one by ID. Aggregates compute a single value over a customer's event history — for example, total purchase count, sum of order values, or date of last session. Aggregate names can be used as variable bindings inside expressions.

Omit aggregate_id to list all aggregates — returns summary records with the name, tags, and archived status. Pass aggregate_id to fetch the full definition of a single aggregate: the event filter, the aggregation type, the date filter, the attribute being aggregated, the group-by, and the output format.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
aggregate_idstrNoThe aggregate ID. Omit to list all aggregates; provide to fetch one.

Response parameters

The tool returns an AggregatesResponse when aggregate_id is omitted, or an AggregateResponse when it's provided.

When aggregate_id is omitted, the AggregatesResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[AggregateSummary]The aggregates defined in the project.
errorstr | nullError message if the request failed.

The AggregateSummary object has the following fields:

FieldTypeDescription
idstrThe aggregate's unique ID.
namestrThe aggregate's display name.
archivedboolWhether the aggregate has been archived.
tagslist[str]User-defined tags.
createdfloat | nullUnix timestamp of when the aggregate was created.
created_by_display_namestrDisplay name of the creator.
editedfloat | nullUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.
is_global_objectboolWhether the aggregate is shared across projects.
version_idstr | nullThe version ID of the current definition.
used_bylist[any]Segmentations, reports, funnels, or campaigns that reference this aggregate.
all_exposing_propertieslist[any]Customer or event properties that surface this aggregate's computed value.

When aggregate_id is provided, the AggregateResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataAggregate | nullThe full aggregate record.
errorstr | nullError message if the request failed.

The Aggregate object adds the following fields on top of the summary record:

FieldTypeDescription
typestrThe aggregation type: count, sum, avg, min, max, median, first, last, or distinct_count.
eventanyThe event filter: which events are aggregated, including type, attribute conditions, and date range.
attributeany | nullThe event attribute being aggregated. Required for sum, avg, min, max, and median.
date_filteranyThe date range applied to events before aggregating.
independent_if_reusedboolWhether the aggregate is computed independently when reused across multiple expressions.
formatstrThe output format: number, date, or string.
group_byany | nullThe event attribute to group results by. Present only for multi-value aggregations.
skipintThe number of values to skip when returning grouped results.
max_valuesintThe maximum number of grouped values to return. 1 for scalar aggregations.
exposing_propertieslist[any]The direct exposing properties for this aggregate.

search_running_aggregates

Searches the running aggregates in a project, or fetches one by ID. Running aggregates are like aggregates, but they're computed incrementally in real time as events arrive — not on demand. Running aggregate names can be used as variable bindings inside expressions.

Omit running_aggregate_id to list all running aggregates — returns summary records with the name, tags, and archived status. Pass running_aggregate_id to fetch the full definition of a single running aggregate: the event filter, the aggregation type, the date filter, the attribute, and whether the current (in-progress) window is included.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
running_aggregate_idstrNoThe running aggregate ID. Omit to list all running aggregates; provide to fetch one.

Response parameters

The tool returns a RunningAggregatesResponse when running_aggregate_id is omitted, or a RunningAggregateResponse when it's provided.

When running_aggregate_id is omitted, the RunningAggregatesResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[RunningAggregateSummary]The running aggregates defined in the project.
errorstr | nullError message if the request failed.

The RunningAggregateSummary object has the following fields:

FieldTypeDescription
idstrThe running aggregate's unique ID.
namestrThe running aggregate's display name.
archivedboolWhether the running aggregate has been archived.
tagslist[str]User-defined tags.
createdfloat | nullUnix timestamp of when the running aggregate was created.
created_by_display_namestrDisplay name of the creator.
editedfloat | nullUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.
is_global_objectboolWhether the running aggregate is shared across projects.
version_idstr | nullThe version ID of the current definition.
used_bylist[any]Segmentations, reports, funnels, or campaigns that reference this running aggregate.
all_exposing_propertieslist[any]Customer or event properties that surface this running aggregate's computed value.

When running_aggregate_id is provided, the RunningAggregateResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataRunningAggregate | nullThe full running aggregate record.
errorstr | nullError message if the request failed.

The RunningAggregate object adds the following fields on top of the summary record:

FieldTypeDescription
typestrThe aggregation type, restricted to forward types: count, sum, avg, min, or max.
eventanyThe event filter: which events are aggregated.
attributeany | nullThe event attribute being aggregated. Required for sum, avg, min, and max.
date_filteranyThe date range applied to events before aggregating.
include_currentboolWhether to include the current (in-progress) aggregation window. When true, the value reflects events received so far in the current period.
formatstrThe output format: number, date, or string.
group_byany | nullThe event attribute to group results by.
max_valuesintThe maximum number of grouped values to return.

search_event_segmentations

Searches the event segmentations defined in a project, or fetches one by ID. Event segmentations partition customers into buckets based on event behavior — for example, which product category was most purchased, or which campaign was last clicked.

Omit event_segmentation_id to list all event segmentations. The response gives you the name, tags, archived flag, and the resources that reference each event segmentation. Segment definitions are not included in list mode. Pass event_segmentation_id to fetch the full definition of a single event segmentation, including each segment's name and event attribute filter.

Event segmentations also appear under the Marketing → Customer filters and segments page.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
event_segmentation_idstrNoThe event segmentation ID. Omit to list all event segmentations; provide to fetch one.

Response parameters

The tool returns an EventSegmentationsResponse when event_segmentation_id is omitted, or an EventSegmentationResponse when it's provided.

When event_segmentation_id is omitted, the EventSegmentationsResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[EventSegmentationSummary]The event segmentations defined in the project.
errorstr | nullError message if the request failed.

The EventSegmentationSummary object has the following fields:

FieldTypeDescription
idstrThe event segmentation's unique ID.
namestrThe event segmentation's display name.
event_typestr | nullThe event type the segmentation partitions customers by.
archivedboolWhether the event segmentation has been archived.
tagslist[str]User-defined tags.
createdfloat | nullUnix timestamp of when the event segmentation was created.
created_by_display_namestrDisplay name of the creator.
editedfloat | nullUnix timestamp of the last edit.
edited_by_display_namestrDisplay name of the last editor.
is_global_objectboolWhether the event segmentation is shared across projects.
version_idstr | nullThe version ID of the current definition.
used_bylist[any]Segmentations, reports, funnels, or campaigns that reference this event segmentation.
all_exposing_propertieslist[any]Properties that surface this event segmentation's computed value.

When event_segmentation_id is provided, the EventSegmentationResponse object has the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataEventSegmentation | nullThe full event segmentation record.
errorstr | nullError message if the request failed.

The EventSegmentation object adds the following fields on top of the summary record:

FieldTypeDescription
segmentslist[any]The segment definitions. Each segment has a name (the bucket label) and a filter (the event attribute conditions).
exposing_propertieslist[any]The direct exposing properties for this event segmentation.


Did this page help you?

© Bloomreach, Inc. All rights reserved.