Segments
segments / segment mirror Settings → Segments — saved audience
filters used to slice your contact list for broadcasts and reporting.
Full CRUD plus per-segment introspection.
Quick start
splashify segments # list, first page
splashify segments --page 2 --limit 50 # paginate
splashify segments --search vip # server-side name search
splashify segments stats # overall stats
splashify segment <id> # one segment
splashify segment <id> contacts # contacts in this segment
splashify segment <id> contacts --page 2 --limit 100
splashify segment <id> count # current member count
splashify segment <id> refresh # recompute count (for dynamic segments)Command reference
Read
| Subcommand | Endpoint |
|---|---|
segments [--search --page --limit] | GET /api/v1/app/segments |
segments stats | GET /api/v1/app/segments/stats |
segment <id> | GET /api/v1/app/segments/:id |
segment <id> contacts [--page --limit] | GET /api/v1/app/segments/:id/contacts |
segment <id> count | GET /api/v1/app/segments/:id/count |
segment <id> refresh / recompute | POST /api/v1/app/segments/:id/refresh |
Write
# Create — --filters JSON is required (see DSL below)
splashify segment create \
--name "VIP iOS users" \
--description "Tagged VIP, on iOS, marketing-opted-in" \
--filters '{
"conditions": [
{"field": "tags", "operator": "includes", "value": "VIP"},
{"field": "hasOptedOut", "operator": "equals", "value": false}
],
"logic": "and"
}' \
--dynamic true \
--active true
# Update — every flag is optional; only what you pass is sent (PATCH semantics)
splashify segment update <id> --name "VIP — refreshed"
splashify segment update <id> --active false
splashify segment update <id> --filters '{"conditions":[…],"logic":"or"}'
# Delete
splashify segment delete <id>| Subcommand | Endpoint |
|---|---|
segment create --name --filters … | POST /api/v1/app/segments |
segment update <id> [flags…] (alias: edit) | PATCH /api/v1/app/segments/:id |
segment delete <id> (aliases: rm, remove) | DELETE /api/v1/app/segments/:id |
Filter DSL reference
The --filters JSON is shipped to the backend verbatim. Shape:
{
"conditions": [
{"field": "<field>", "operator": "<operator>", "value": "<value>"},
{"field": "<field>", "operator": "<operator>"} // value omitted for isEmpty / isNotEmpty
],
"logic": "and" // or "or"
}Fields (from CreateSegmentDialog):
| Field | Type | Notes |
|---|---|---|
displayName | text | Contact’s display name |
phoneNumber | text | E.164 phone, e.g. +91… |
email | text | |
tags | array of strings | Use includes / notIncludes |
hasOptedOut | bool | Marketing opt-in flag |
isBlocked | bool | |
createdAt | timestamp | ISO 8601 |
updatedAt | timestamp | ISO 8601 |
Operators:
| Operator | Works on |
|---|---|
equals, notEquals | text, bool |
contains, notContains | text |
startsWith, endsWith | text |
isEmpty, isNotEmpty | text (value omitted) |
includes, notIncludes | array (tags) |
The web app (
/settings/segments) is a visual builder for this DSL. Use it once to design a complex segment, thensplashify segment <id>to see the JSON it produced, then build similar segments programmatically.
Common patterns
# IDs of all active segments
splashify segments --limit 100 | jq -r '.segments[] | select(.is_active) | .id'
# Get a segment ID by exact name
splashify segments --search "VIP" | \
jq -r '.segments[] | select(.name == "VIP") | .id'
# Use a segment ID in a broadcast
SEGMENT_ID=$(splashify segments --search "VIP" | jq -r '.segments[0].id')
splashify broadcast create --name "May launch" \
--template payment_failed \
--segment-ids "$SEGMENT_ID"
# Trigger refresh on every dynamic segment (e.g. nightly cron)
splashify segments --limit 100 | \
jq -r '.segments[] | select(.is_dynamic) | .id' | \
xargs -I{} splashify segment {} refreshRelated
- Contacts — segments filter over the contact list
- Tags —
tagsis the most-used segment field - Broadcasts — pass
--segment-idsto send to a segment