Skip to content

Filter Operators

When building segments, each filter uses an operator to define how the contact's data is compared against your value. Below is a reference of all 22 available operators.


Property Operators

These operators compare a contact field or custom property against a value you provide.

OperatorDescriptionExampleMatches
isExact match (equals)product_type is StandardContacts whose product type is exactly "Standard"
is_notDoes not equalproduct_type is_not UnsubContacts whose product type is anything except "Unsub"
inMatches any value in a listproduct_type in Standard, PremiumContacts whose product type is either "Standard" or "Premium"
not_inDoes not match any value in a listproduct_type not_in Unsub, InactiveContacts whose product type is neither "Unsub" nor "Inactive"
containsText includes a substringemail contains @gmail.comContacts whose email contains "@gmail.com"
not_containsText does not include a substringemail not_contains testContacts whose email does not contain "test"
starts_withText begins with a prefixphone starts_with +65Contacts whose phone number starts with "+65"
ends_withText ends with a suffixemail ends_with @acme.comContacts whose email ends with "@acme.com"
greater_thanNumeric comparison (strictly greater)properties.age greater_than 30Contacts older than 30
less_thanNumeric comparison (strictly less)properties.age less_than 25Contacts younger than 25
gteGreater than or equalproperties.order_count gte 5Contacts with 5 or more orders
lteLess than or equalproperties.order_count lte 20Contacts with 20 or fewer orders
betweenWithin a range (inclusive)properties.order_count between 5, 20Contacts with 5 to 20 orders
existsField has a value (is not null)phone existsContacts who have a phone number on file
not_existsField is null or missingproperties.company not_existsContacts who have no company set
is_emptyField is null or an empty stringphone is_emptyContacts whose phone field is missing or blank
is_not_emptyField has a non-empty valueemail is_not_emptyContacts who have an email address that is not blank
Note

The contains, not_contains, starts_with, and ends_with operators are case-insensitive, so @Gmail.com and @gmail.com will match the same contacts.

Tip

exists vs is_not_empty vs is_empty: exists checks that the field is not null (the field has been set at all). is_not_empty checks that the field is neither null nor an empty string. is_empty checks that the field is null OR an empty string. A field can exist but be empty -- use whichever is appropriate for your data.


Date Operators

These operators work specifically with date and timestamp fields like created_at.

OperatorDescriptionExampleMatches
date_beforeDate is before a specific datecreated_at date_before 2026-01-01Contacts created before January 1, 2026
date_afterDate is after a specific datecreated_at date_after 2026-01-01Contacts created after January 1, 2026
date_in_lastDate is within the last N dayscreated_at date_in_last 30Contacts created in the last 30 days
Tip

Use date_in_last for relative time ranges that automatically adjust. "Contacts created in the last 7 days" will always give you the most recent week without needing to update the date value.


Behavioral Operators

These operators check whether a contact has performed (or not performed) specific events.

OperatorDescriptionExampleMatches
has_executedContact has performed this event at least oncehas_executed purchase_completeContacts who have completed at least one purchase
has_not_executedContact has never performed this eventhas_not_executed onboarding_completeContacts who have never completed onboarding
Tip

Behavioral operators are great for targeting contacts based on actions they have or haven't taken. Combine them with property operators for precise audience targeting.


Operator Compatibility

Not all operators work with all data types. Here's a quick compatibility guide:

OperatorTextNumbersDatesBoolean
isYesYesYesYes
is_notYesYesYesYes
inYesYes----
not_inYesYes----
containsYes------
not_containsYes------
starts_withYes------
ends_withYes------
greater_than--Yes----
less_than--Yes----
gte--Yes----
lte--Yes----
between--YesYes--
existsYesYesYesYes
not_existsYesYesYesYes
is_emptyYes------
is_not_emptyYes------
date_before----Yes--
date_after----Yes--
date_in_last----Yes--

Tips for Choosing Operators

  • Use is / is_not when you know the exact value.
  • Use in / not_in when you want to match against multiple possible values at once.
  • Use contains / not_contains when you need partial text matching (e.g., email domains).
  • Use starts_with / ends_with for prefix or suffix matching (e.g., phone country codes, email domains).
  • Use gte / lte when the boundary value should be included (e.g., "age 18 or older"). Use greater_than / less_than when it should not.
  • Use exists / not_exists to find contacts with missing data (useful for data quality checks).
  • Use is_empty / is_not_empty to distinguish between null fields and blank strings.
  • Use date_before / date_after for fixed date ranges and date_in_last for rolling time windows.
  • Use has_executed / has_not_executed to create behavioral segments (e.g., "signed up but never purchased").
  • Use between for range queries on numbers or dates (e.g., "contacts with 5 to 20 orders").

Looking for the API?

If you prefer to build segment filters programmatically, see the Segments API Reference for the filter DSL format.