Customer filters and segments tools

Event segmentations also appear under the Analytics > Analytics building blocks page, since they compose with expressions, aggregates, and running aggregates.

list_customer_filters

Lists every customer filter defined in a project. Customer filters are reusable conditions that match customers based on their properties, events, or computed attributes. The response gives you the name, tags, description, and whether each filter is archived. The boolean formula and the filter conditions themselves are not included here — use get_customer_filter for those.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns a CustomerFiltersResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[CustomerFilterSummary]The customer filters defined in the project.
errorstr | nullError message if the request failed.

The CustomerFilterSummary object has the following fields:

FieldTypeDescription
idstrThe customer filter's unique ID.
namestrThe customer filter's display name.
descriptionstr | nullAn optional written description of the filter.
archivedboolWhether the filter has been archived.
tagslist[str]User-defined tags.
company_idstrThe project ID this filter belongs to.
createdfloat | nullUnix timestamp of when the filter 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.
version_idstr | nullThe version ID of the current definition.

get_customer_filter

Returns the full definition of a single customer filter, including its boolean formula and the underlying filter conditions. The formula combines zero-based filter indices with & (AND), | (OR), and ! (NOT), for example F0&(F1|!F2).

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
customer_filter_idstrYesThe customer filter ID returned by list_customer_filters.

Response parameters

The tool returns a CustomerFilterResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataCustomerFilter | nullThe full customer filter record.
errorstr | nullError message if the request failed.

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

FieldTypeDescription
formulastr | nullA boolean formula combining filter conditions using & (AND), | (OR), and ! (NOT) over zero-based indices, for example F0&(F1|!F2).
filterslist[any]The filter condition definitions referenced by the formula. Each entry is either a customer attribute condition or a funnel-based condition.

list_segmentations

Lists every segmentation defined in a project. Segmentations partition customers into named buckets (segments) based on customer filter conditions. The response gives you the name, tags, archived flag, and the resources that reference each segmentation. Segment definitions and per-segment metrics are not included here — use get_segmentations for those.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns a SegmentationsResponse object with the following parameters:

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

The SegmentationSummary object has the following fields:

FieldTypeDescription
idstrThe segmentation's unique ID.
namestrThe segmentation's display name.
archivedboolWhether the segmentation has been archived.
tagslist[str]User-defined tags.
createdany | nullUnix timestamp of when the 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 segmentation is shared across projects.
version_idstr | nullThe version ID of the current definition.
used_bylist[any]Campaigns, reports, or other analyses that reference this segmentation.
parametrizedboolWhether the segmentation accepts parameters.

get_segmentations

Returns the full definition of a single segmentation, including each segment's name and customer filter, the global customer filter, per-segment metrics, map axes configuration, and any BRX integration settings.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
segmentation_idstrYesThe segmentation ID returned by list_segmentations.

Response parameters

The tool returns a SegmentationResponse object with the following parameters:

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

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

FieldTypeDescription
customer_filterany | nullThe global customer filter applied before segments are evaluated. Customers who do not match are left out of every segment.
segmentslist[any]The segment definitions. Each segment has an _id, a name, and a customer_filter that decides which customers go in that bucket.
metricslist[any]Metrics computed for each segment, for example total revenue or purchase count. Each entry has a context_format field.
segmentation_map_axesany | nullMap visualization axes: the x, y, and size metric indices.
customer_count_formatstrHow per-segment customer counts are formatted: value, percentage, or average.
independent_if_reusedboolWhether the segmentation is computed independently when reused across multiple analyses.
content_integrationany | nullBRX content integration settings.
discovery_integrationany | nullBRX discovery integration settings.
merchandising_integrationany | nullBRX merchandising integration settings.

list_autosegments

Lists every autosegment defined in a project. Autosegments use machine learning to discover meaningful customer groups automatically from behavioral and property metrics — no manual segment conditions required. The response gives you the name, tags, initiative, and the current job status (draft, running, successful, or failed) with the last run timestamp. The metric list and detailed job info (progress, stage, error) are not included here — use get_autosegment for those.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns an AutosegmentsResponse object with the following parameters:

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

The AutosegmentSummary object has the following fields:

FieldTypeDescription
idstrThe autosegment's unique ID.
namestrThe autosegment's display name.
createdany | nullUnix timestamp of when the autosegment 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.
tagslist[str]User-defined tags.
initiative_idstr | nullThe initiative this autosegment belongs to, if any.
is_global_objectboolWhether the autosegment is shared across projects.
job_infoAutosegmentJobInfoSummary | nullCurrent execution status: the status (draft, running, successful, or failed) and last_run_at timestamp.

get_autosegment

Returns the full definition of a single autosegment, including the metrics that drive segment discovery, the global customer filter, the minimum segment size, and the full job execution info (status, progress, stage, error). Note: the generated segment data itself (results) is not available through this endpoint.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
autosegment_idstrYesThe autosegment ID returned by list_autosegments.

Response parameters

The tool returns an AutosegmentResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataAutosegment | nullThe full autosegment record.
errorstr | nullError message if the request failed.

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

FieldTypeDescription
company_idstrThe project ID this autosegment belongs to.
descriptionstr | nullAn optional written description.
archivedboolWhether the autosegment has been archived.
version_idstr | nullThe version ID of the current definition.
used_bylist[any]Campaigns, reports, or other analyses that reference this autosegment.
all_exposing_propertieslist[any]Customer properties that surface this autosegment's output values.
definitionAutosegmentDefinition | nullThe full configuration: metrics, customer_filter, min_customers_per_segment (default 5000), min_customers_per_segment_is_relative, and customer_attributes.
job_infoAutosegmentJobInfo | nullThe full job info: status, last_run_at, queued_at, stage, progress (a value between 0.0 and 1.0), error, and submitted_job_id.

list_event_segmentations

Lists every event segmentation defined in a project. Event segmentations partition customers into buckets based on event behavior, for example which product category was most purchased or which campaign was last clicked. The response gives you the name, tags, archived flag, and the resources that reference each event segmentation. Segment definitions are not included here — use get_event_segmentation for those.

Event segmentations also appear under the Analytics → Analytics building blocks page.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.

Response parameters

The tool returns an EventSegmentationsResponse object with 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.

get_event_segmentation

Returns the full definition of a single event segmentation, including each segment's name and event attribute filter. Use list_event_segmentations first if you don't already have the ID.

Event segmentations also appear under the Analytics → Analytics building blocks page.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
event_segmentation_idstrYesThe event segmentation ID returned by list_event_segmentations.

Response parameters

The tool returns an EventSegmentationResponse object with 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.


© Bloomreach, Inc. All rights reserved.