Reference / Segments

See who a filter would select

preview_segmentocmgr segments previewPOST /v1/segments/previewREAD

Run a filter without saving it: how many members it selects, and up to ten of them. This is the call to make while you are building a filter — it compiles through the same compiler a saved segment does, so the default count matches the saved community headline. Pass team: true to preview everyone, including staff; saved headline counts still exclude staff. A filter that is not valid comes back as USAGE naming the path in the tree that is wrong, so you can fix the one condition rather than guessing. Returns the shared sentence, excluded staff count (unless team:true), and each sample member’s organisation where known. No addresses are returned: a preview is a read like any other.

Parameters

filterobjectREQUIRED

The filter to try. An empty object previews manual-only membership: zero matches. Nothing is saved.

teamboolean

Include staff in the preview. Defaults to false, matching saved headline counts.

CLI flags

--filter <json>REQUIRED

The filter tree; see ocmgr segments fields

--team

Include staff in the preview

--no-team

Exclude staff from the preview (default)

Also in Segments