User Segments
Create rule-based user segments with 12 operators for targeting push campaigns and analytics.
Segments let you define groups of users based on rules. Use them to target push campaigns or analyze engagement patterns.
How it works
A segment has a set of rules with an AND or OR operator combining conditions. Each condition evaluates a user property against a value using one of 12 operators.
Segment membership is re-evaluated within 15 minutes of a change to your users' data. Rules with a time window (within / not_within) also follow the clock: a user who crosses a window under a day joins or leaves within 15 minutes, and within the hour for longer windows. See Evaluation cadence.
Operators
| Operator | Description | Example |
|---|---|---|
eq | Equals | entitlements.is_active eq true |
neq | Not equals | entitlements.product_id neq "premium_monthly" |
gt | Greater than | created_at gt "2026-01-01" |
gte | Greater than or equal | entitlements.expiration_date gte "2026-12-01" |
lt | Less than | last_seen_at lt "2026-06-01" |
lte | Less than or equal | first_seen_at lte "2026-03-31" |
contains | String/array contains | properties.tags contains "fitness" |
not_contains | Does not contain | properties.tags not_contains "churned" |
exists | Property exists | email exists |
not_exists | Property does not exist | email not_exists |
within | Within time window | last_seen_at within "7d" |
not_within | Outside time window | last_seen_at not_within "30d" |
Available fields
You can target any field on the user record:
last_seen_at— last activity timestampcreated_at— account creation dateemail— user emailproperties.*— custom user properties (e.g.,properties.plan,properties.age). Aproperties.*comparison follows the type of the rule'svalue: a string compares with the property's text ({ field: "properties.plan", op: "eq", value: "pro" }matchesplan: "pro"), a number compares numerically and counts a JSON number or a numeric string (gt 9matches10), and a boolean matchestrue/falseor the strings"true"/"false". An object or array value supportseq/neqagainst the whole JSON value. A user without the property matches none of these operators.entitlements.is_active— active entitlement status
Admin API reference
| Method | Path | Description |
|---|---|---|
POST | /v1/admin/projects/:projectId/segments | Create segment |
GET | /v1/admin/projects/:projectId/segments | List all segments |
GET | /v1/admin/projects/:projectId/segments/:id | Get segment details |
PATCH | /v1/admin/projects/:projectId/segments/:id | Update segment rules |
DELETE | /v1/admin/projects/:projectId/segments/:id | Delete segment |
POST | /v1/admin/projects/:projectId/segments/:id/evaluate | Trigger immediate re-evaluation |
POST /v1/admin/projects/:projectId/segments — Create segment
Body:
System segments
Every project comes with built-in system segments that cannot be edited or deleted:
- All Users — every user in the project
- Active (7d) — users seen in the last 7 days
- Active (30d) — users seen in the last 30 days
- New Users — users created in the last 7 days
MCP tools
| Tool | Description |
|---|---|
amba_segments_list | List all segments including system segments |
amba_segments_create | Create a custom segment with rule-based filters |
Example
What can target a segment
| Feature | How it uses segments |
|---|---|
| Push campaigns | POST /v1/admin/projects/:projectId/push/campaigns accepts segment_id to limit the audience. |
| Remote config conditions | Each remote_configs.conditions[] entry can carry a segment_id. GET /v1/client/config returns that entry's value to signed-in members of the segment. |
| Content scheduling | A content_schedule with segment_id set writes its rotated value into the per-segment slot of remote_configs.conditions, which signed-in members of the segment read from GET /v1/client/config. |