The customer-centric rule. A segment always returns a list of people, never a list of things or events. A condition can reach through a customer’s related records — their bookings, invoices, appointments, route stops — but the answer is always the customers those records belong to. There is no “60 days before a tournament” segment, because a tournament on its own is not a customer. If you can phrase your audience as “a customer who satisfies these conditions right now,” you can build it as a segment. The Planning Engage Automations guide walks through how to reframe a business event as a question about customers.
Structure
A segment consists of:- Name and Description — what it’s called and what it’s for.
- Conditions — the criteria that define membership (see below).
- Status —
activeordeactivated. - Tenant scope — which of your tenants the segment applies to. A partner-defined segment can target a single tenant, a subset, or all of them.
What a condition can ask about
Each condition targets one field. Fields come from two places:Built-in customer fields
Available for every tenant out of the box:- Email, phone, first name, last name, user ID
- Email and SMS opt-in / opt-out status
Custom fields you expose
Any field from your schema definitions that you’ve exposed to segmentation becomes conditionable. You control this through thefields_to_expose configuration on your partner resource schema definitions — each exposed field carries a friendly name, a description, a JSON path into your data, and an exposure target. Only fields exposed to segments appear in the segment builder. See Exposing fields to tenants for how to configure them.
The friendly name and description you give an exposed field are what your tenants see in the builder — and they’re also what the AI segment builder reads when a tenant describes an audience in plain language. Write them for a human.
Operators
The operator you can use on a condition depends on the field’s type. The type comes from the field’s JSON Schema definition (string, number, integer, boolean, array, a date / date-time string, or a reference to another schema).
What each does:
Date-window operators (Date / DateTime fields)
These are what make per-customer relative timing possible — “30 days before renewal,” “birthday is today,” “serviced within a window.” A date field’s value can be compared against:- A fixed date using
greater_than/less_than/equals(e.g.service_dateis after2026-01-01). - A relative date — N days before or after today — using
greater_than/less_than. This is how you express “within the last 30 days” or “7 days from now.” (Relative dates support only thegreater_than/less_thanand month/day operators; relativeequals/not_equalsisn’t supported.) equals_month_day— matches the same month and day regardless of year (birthdays, anniversaries).equals_month_day_year— matches an exact month, day, and year.between_month_day— the field’s month-and-day falls within a start–end window (handles windows that span a year boundary).between_month_day_year— the field falls within an absolute start–end date window.
Related-record conditions (counts across a relationship)
The most powerful condition type reaches through a customer’s related records and asks a count question about them. This is how you express “customers with 4 or more invoices” or “customers with a location that has no route stop scheduled this week.” A related-record condition specifies:- which related schema to look at and the field on it that points back to the customer,
- a count operator (
eq,gt,gte,lt,lte) and a count value, and - optional inner conditions on the related records (AND-combined), using the same operators above.
- “Has at least N …” — count operator
gte(orgt 0for “has any”). “Customers who have at least 1 invoice paid more than 30 days ago.” - “Has zero …” — count operator
eq 0(orlt 1). “Customers who have no cleaning scheduled in the future.” Combine an at-least condition with a has-zero condition to get an at-risk cohort — see the pool-cleaning winback example.
Condition structure
A simple field condition:and / or logic, and groups can nest. A related-record condition references the related schema and its own inner conditions:
In practice, tenants build these in the segment builder UI rather than authoring JSON by hand — the shapes above are for understanding what the builder produces and what the API accepts.
Usage in automations
Segments define who an automation targets. An automation can use a segment to:- Include users — the target audience for a communication.
- Exclude users — people who should not receive it.