Segments Overview
Segments are named, rule-based audiences. Once computed, membership is available at millisecond latency via the delivery API.
What Are Segments?#
A segment defines a population of users who satisfy a set of behavioral conditions. For example: “users who placed more than 3 orders in the last 90 days and haven't visited in 30 days.”
When you compute a segment, SegOps runs a query over your entire event history in the analytics warehouse and stores the matching user IDs in the segment_memberships table. Those IDs can then be queried at runtime for personalization, feature flags, or activation.
Three Ways to Create a Segment#
Point-and-click interface. Choose condition types from a dropdown, fill in values, toggle AND/OR logic.
🤖AI BuilderDescribe your audience in plain English and let the AI produce the segment definition.
⚙️REST APIPOST or PATCH a segment with a JSON definition. Best for CI/CD pipelines or programmatic creation.
Segment Types#
The segment_type field controls how the segment was created and how it is displayed in the UI:
rule— manually defined conditions via the visual rule builder or API.ai— the AI builder generated the definition from a natural language prompt.lookalike— audience expansion from a seed segment (roadmap feature).
Segment Lifecycle#
A segment moves through these states:
Versioning#
Every time you save a segment definition, SegOps creates a version snapshot. This means you can always view the definition that was in effect during any past compute, which is useful for auditing why a user was or wasn't in a segment at a point in time.
Access the version history in the UI via the History panel on any segment detail page, or via the API at GET /api/segments/<id>/versions/.
Learn More#
- Rule Builder — visual condition editor walkthrough
- AI Builder — natural language segment creation
- Condition Reference — every condition type and operator