Named, reusable filters over user and subscription facts. A segment is resolved at send time, so a campaign reaches the audience as it stands when it goes out.
List segments
Every segment for one app — rules, a human-readable rendering of them, and a live subscription count evaluated at request time, so a large app pays for that count on every call. The default target segment sorts first.
The response also carries the field catalogue (fields): the filterable fields, their
operators and hints, which is what a rule builder needs.
path Parameters
app_idList segments › Responses
Segments with live counts, plus the filterable field catalogue
Create a segment
Creates a segment from a name and a rule list. Rules are compiled before
anything is written, so a malformed rule is a 400 naming the problem rather than a
segment that silently matches everything.
Setting is_target_default: true moves the default off whichever segment currently holds
it — there is exactly one default target per app.
path Parameters
app_idCreate a segment › Request Body
nameNon-empty segment display name.
is_target_defaultMove the app's default targeting flag to this segment.
Filter rows; an empty list matches every subscribed device.
statusWhether the segment may be targeted.
Create a segment › Responses
The created segment with its rule text and live count
Delete a segment
Deletes a segment. Managed segments cannot be deleted — the built-in
ones an app is created with are a 409.
If the deleted segment held the default target, the default falls back to Total Subscriptions, or to the oldest remaining segment, so an app is never left without one.
path Parameters
app_idseg_idDelete a segment › Responses
The segment id and confirmation of deletion
Update a segment
Updates a segment's name, status (Active or Paused), rules, or
its default-target flag. Replacement rules are compiled before they are stored.
The default target can only be moved, never cleared: is_target_default: false is a
400 telling you to make another segment the default instead. A patch that changes nothing
is also a 400.
path Parameters
app_idseg_idUpdate a segment › Request Body
Only true is accepted; move the default rather than clearing it.
Replacement display name.
Replacement filter rows.
Replacement lifecycle status.
Update a segment › Responses
The segment id and confirmation of the update