# Testing a segment

> Part of the Cowliss docs. Markdown for every page: append `index.md` to its URL. Site map: /llms.txt

## Preview before you save

`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:

```sh
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.

## Widening a rule reaches nobody

Editing a definition recomputes membership across the app the segment belongs to, and so does a push that changes an automation'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 automation at one moment only: when somebody turns that automation on and ticks the box, with the count in front of them. See [Enable, disable, observe](/automations/#enable-disable-observe).

## Where next

- [Predicate reference](/segments/api/): what you can express.
- [Testing automations](/automations/testing/): the same question one step later, for the automation a segment starts.
