Skip to main content
A filter definition describes one customer property so that it can be used as a filter in the embed. For background, see How segments and filter definitions work.

Fields

Each entry in options has a label, shown to businesses, and a value, matched against the customer’s data. Both are strings.

Variable names

A customer filter’s variable_name must start with customer.. The rest names the property:
  • A built-in customer property: customer.full_name, customer.first_name, customer.last_name, customer.email_address, customer.phone_number, or customer.external_id. customer.external_id works in segments but not in trigger filters.
  • Anything else is read from the customer’s metadata. customer.plan reads metadata.plan.
Each part of the name after customer. may contain only letters, numbers and underscores. Don’t give a metadata key the same name as a built-in property: segments read the built-in property, but trigger filters read the metadata key. For the syntax of the filters built from these definitions, see Filter syntax. Within one business, and within the project-level definitions of one project, each variable_name can be defined once.

Types

The value you sync must match the filter’s type. select and array_of_known require options.

Enabled and disabled

A business’s definition replaces the project-level definition with the same variable_name for that business. If the business’s definition is disabled, the filter is hidden for that business.

Endpoints

POST /businesses/:id/filter_definitions requires variable_name, label, type and options. Pass "options": [] for types that have no options. Event filter definitions use a variable_name that starts with event.. For request and response schemas, see the API Reference tab.