Customer profiles and event history tools

list_customers

Searches for customers in a project and returns matching records. Each result has an internal ID and a dictionary of identifier values keyed by field name, for example {'registered': '[email protected]', 'cookie': '...'}. The query parameter searches across identifier values such as email address or cookie ID. It does not search property values.

Pagination is controlled with skip and count; together they must not exceed 1,000. Identifier values marked as private are masked to '******' when the session does not have the administration.pii.flag permission. The masking is enforced on the server and cannot be overridden from the tool.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
querystrNoText to search across customer identifier values. Defaults to an empty string.
skipintNoPagination offset. Defaults to 0. skip plus count must not exceed 1,000.
countintNoNumber of results to return. Defaults to 20. Maximum 1,000.

Response parameters

The tool returns a CustomersResponse object with the following parameters:

ParameterTypeDescription
datalist[Customer]The matching customer records.
evaluation_statsany | nullQuery evaluation statistics, when available.
limitintThe maximum number of results requested.
matchedintThe number of customers matched by the filter.
matched_exactlyintThe number matched exactly, not fuzzy.
matched_limitedboolWhether the match count was capped by a server limit. The true total may be higher.
skipintThe pagination offset that was applied.
totalintThe total number of customers in the project.

The Customer object has the following fields:

FieldTypeDescription
idstrThe internal customer ID. Use this as customer_id in other tools.
idsdict[str, any | null]Identifier values keyed by field name, for example {'registered': '[email protected]', 'cookie': '...'}.

get_customer_properties

Returns every property currently set on a single customer, along with each property's last update timestamp. The response also includes the customer's expression-derived computed attributes. Property values marked as private are masked to '******' when the session does not have the administration.pii.flag permission.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
customer_idstrYesThe internal customer ID returned by list_customers.

Response parameters

The tool returns a CustomerPropertiesResponse object with the following parameters:

ParameterTypeDescription
idstrThe internal customer ID.
company_idstrThe project ID this customer belongs to.
createdintUnix timestamp of when the customer record was created.
idsdict[str, str | null]Identifier values keyed by field name.
propertiesdict[str, CustomerProperty]Property values keyed by name. Each entry has a value and a last_update.
attributeslist[any]Expression-derived computed attribute values for this customer.
failed_attributeslist[any]Expressions that failed to evaluate for this customer.
export_archived_eventsboolWhether archived events are included when this customer is exported.

get_customer_attribute_values

Computes one or more aggregate or expression values for a single customer, live from that customer's raw event history. This is the tool to reach for when you need to know what an attribute actually evaluates to for one person, for example when working out why a customer does or doesn't land in a segmentation.

It fills a real gap left by get_customer_properties. Many aggregates, most_common types in particular, have no exposing properties, so their computed value is never written back to the customer profile and never shows up in the property list. Values here are computed at call time and aren't cached, so they change as new events arrive.

Pass each attribute as a {"type": ..., "id": ...} descriptor, where type is aggregate or expression and id comes from search_aggregates or search_expressions. When some attributes can't be evaluated, the response sets partial to true and lists their IDs in failed_attributes. Values that did compute are still returned, so a partial result is still useful.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
customer_idstrYesThe internal customer ID returned by list_customers. It must be the internal ID, not an external identifier such as an email address or cookie ID.
attributeslist[dict]YesThe attributes to evaluate. Each entry needs a type of aggregate or expression and an id from search_aggregates or search_expressions.

Response parameters

The tool returns a CustomerAttributeValuesResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
attributeslist[CustomerAttributeValue]The computed values, in the same order as the attributes you passed in.
failed_attributeslist[str]IDs of the attributes that couldn't be evaluated, for example because no events matched.
partialbooltrue when at least one attribute failed to evaluate. Successful values are still returned.
errorstr | nullError message if the whole request failed.

The CustomerAttributeValue object has the following fields:

FieldTypeDescription
namestrThe attribute's display name, for example Total purchases.
idstr | nullThe ID of the aggregate or expression that produced the value. A null value means it couldn't be matched.
valueanyThe computed value: a number, string, boolean, or list. It's null when the attribute couldn't be evaluated.

list_customer_events

Lists events for a single customer, with an optional filter by event type. Events are returned in reverse chronological order by default. Each event has a type (such as purchase or session_start), a Unix timestamp, and a properties dictionary with event-specific data.

Use days_back to set the history window. It defaults to the last 365 days and accepts up to 3,650 days, and events older than the window are excluded. The window counts relative calendar days in your own Marketing user timezone, and day boundaries align to that timezone. There's no separate timezone parameter to set.

Event property values marked as private are masked to '******' when the session does not have the administration.pii.flag permission.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
customer_idstrYesThe internal customer ID returned by list_customers.
event_typeslist[str] | nullNoEvent types to include, for example ['purchase', 'page_visit']. Omit to return all event types.
skipintNoPagination offset. Defaults to 0.
limitintNoNumber of events to return. Defaults to 50. Maximum 500.
order_directionstrNodesc (most recent first, default) or asc (oldest first).
days_backintNoDays of event history to include. Defaults to 365. Maximum 3,650.

Response parameters

The tool returns a CustomerEventsResponse object with the following parameters:

ParameterTypeDescription
datalist[CustomerEvent]The events that matched the filters.
totalintThe number of events the customer has in the days_back window, counted before pagination and regardless of event_types.
matchedint | nullThe number of events in the window that match event_types. Use this, not total, to decide whether to paginate.
limitintThe maximum number of events requested.
skipintThe pagination offset that was applied.

The CustomerEvent object has the following fields:

FieldTypeDescription
typestrThe event type identifier, for example purchase or page_visit.
timestampfloatUnix timestamp of when the event occurred.
propertiesdict[str, any]Event property values keyed by property name.

list_customers_in_segment

Lists customers who belong to a specific named segment inside a segmentation. The segment name must match exactly. If the name is not found, the tool returns an error that lists the segment names that do exist.

Pagination is controlled with skip and count; together they must not exceed 1,000. Identifier values marked as private are masked to '******' when the session does not have the administration.pii.flag permission.

Request parameters

NameTypeRequired?Description
project_idstrYesThe project ID returned by list_projects.
segmentation_idstrYesThe segmentation ID returned by search_segmentations.
segment_namestrYesThe exact name of the segment to filter by, for example At-Risk.
skipintNoPagination offset. Defaults to 0. skip plus count must not exceed 1,000.
countintNoNumber of results to return. Defaults to 20. Maximum 1,000.

Response parameters

The tool returns a CustomersResponse object with the following parameters:

ParameterTypeDescription
datalist[Customer]The matching customer records.
evaluation_statsany | nullQuery evaluation statistics, when available.
limitintThe maximum number of results requested.
matchedintThe number of customers matched by the segment filter.
matched_exactlyintThe number matched exactly, not fuzzy.
matched_limitedboolWhether the match count was capped by a server limit. The true total may be higher.
skipintThe pagination offset that was applied.
totalintThe total number of customers in the project.

The Customer object has the following fields:

FieldTypeDescription
idstrThe internal customer ID.
idsdict[str, any | null]Identifier values keyed by field name, for example {'registered': '[email protected]', 'cookie': '...'}.


Did this page help you?

© Bloomreach, Inc. All rights reserved.