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.

search_customer_filters

Searches the customer filters defined in a project, or fetches one by ID. Customer filters are reusable conditions that match customers based on their properties, events, or computed attributes.

Omit customer_filter_id to list all customer filters. 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 in list mode. Pass customer_filter_id to fetch 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_idstrNoThe customer filter ID. Omit to list all customer filters; provide to fetch one.

Response parameters

The tool returns a CustomerFiltersResponse when customer_filter_id is omitted, or a CustomerFilterResponse when it's provided.

When customer_filter_id is omitted, the CustomerFiltersResponse object has 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.

When customer_filter_id is provided, the CustomerFilterResponse object has 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.

search_segmentations

Searches the segmentations defined in a project, or fetches one by ID. Segmentations partition customers into named buckets (segments) based on customer filter conditions.

Omit segmentation_id to list all segmentations. 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 in list mode. Pass segmentation_id to fetch 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. To list customers belonging to a specific segment, use list_customers_in_segment.

Request parameters

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

Response parameters

The tool returns a SegmentationsResponse when segmentation_id is omitted, or a SegmentationResponse when it's provided.

When segmentation_id is omitted, the SegmentationsResponse object has 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.

When segmentation_id is provided, the SegmentationResponse object has 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.

search_autosegments

Searches the autosegments defined in a project, or fetches one by ID. Autosegments use machine learning to discover meaningful customer groups automatically from behavioral and property metrics — no manual segment conditions required.

Omit autosegment_id to list all autosegments. 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 in list mode. Pass autosegment_id to fetch 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_idstrNoThe autosegment ID. Omit to list all autosegments; provide to fetch one.

Response parameters

The tool returns an AutosegmentsResponse when autosegment_id is omitted, or an AutosegmentResponse when it's provided.

When autosegment_id is omitted, the AutosegmentsResponse object has 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.

When autosegment_id is provided, the AutosegmentResponse object has 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.

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 Analytics → Analytics building blocks 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.