Create a segment
Save an audience. Pass filter (the same tree as preview_segment and search_members), or legacy definition.filter, to make it a live filter — "everyone tagged champion who was active since June" stays true as the community changes — or omit it for a segment whose members are only the ones somebody adds. Captures the calling actor as owner. An existing name returns created:false with the existing segment and keeps its original owner; none of the supplied filter, definition, description or statuses is applied. Use update_segment to change it.
Parameters
The same filter tree as preview_segment and search_members. Use either filter or definition, not both.
The segment’s name. An existing name returns that segment.
What it is for.
The saved filter. Omit for a segment whose membership is only what somebody adds to it.
The filter language (ADR 0025): a tree over the fields list_segment_fields returns. This is the one to use; the five keys below are what a segment could be saved with before the language existed and are still accepted.
Free text over name, handle, company and email.
Only members with an identity on this source.
Only members whose golden record names this company.
Only members seen at or after this instant.
Only members carrying at least one of these tags.
The segment’s status vocabulary: at most eight, in the order a menu offers them. Replaced whole. Once a segment has one, set_segment_member_status refuses a status outside it; a segment with none (the default) takes free text as it always has.
Set automatically when this member filter matches, first matching status wins. A person-held status is preserved. Cannot reference this segment directly or indirectly.
What a write names: lower case letters, digits, - and _, e.g. contacted.
What a person reads, e.g. "Contacted".
The colour, from the theme’s four: accent (new, act on it), healthy (done, going well), danger (blocked, lost), muted (parked).
CLI flags
What the segment is for
Filter: a filter tree; see ocmgr segments fields
Filter: free text over name, handle, company and email
Filter: members whose golden record names this company
Filter: members seen at or after this date
Filter: members carrying at least one of these tags
A status vocabulary: a list of {key, label, tone, filter?} (filter assigns this status automatically), at most eight; tones accent, healthy, danger, muted