Skip to content

Testing a segment

POST /v1/segments/preview runs a definition that does not exist yet over one app’s existing profiles, and answers with the match count and a small sample of members:

Terminal window
cow segments preview --app-id app_website \
--definition '{"match": "all", "predicates": [{"kind": "trait", "name": "plan", "op": "eq", "value": "free"}]}'

The app is the one the segment would belong to, so the count is the count you get when you save it. The scan is bounded: 1,000 profiles per call, rate-limited per organization. When it hits the cap the count comes back truncated, which is a floor rather than the exact number. A saved segment’s memberCount is always exact.

The dashboard runs the same preview as you build a definition, so the count under the form is the count you will get.

Editing a definition recomputes membership across the app the segment belongs to, and so does a push that changes a journey’s inlined segment. Every entry and exit that finds is real and lands on the person’s timeline.

The people already inside a segment enter its journey at one moment only: when somebody turns that journey on and ticks the box, with the count in front of them. See Enable, disable, observe.