Create segment
plunk_create_segmentCreate a reusable audience segment: dynamic filters re-evaluate continuously so contacts join and leave automatically, while static holds a manual member list.
Instructions
Purpose: Create a reusable audience. A DYNAMIC segment re-evaluates its filter continuously, so contacts join and leave on their own; a STATIC one holds a membership you manage by hand.
Not for: A one-off audience for a single campaign — plunk_create_campaign accepts an inline filter via audienceType FILTERED, with no segment to maintain afterwards.
Returns: The created segment including its id.
Use when: The same audience will be reused, or the user wants to see it in the dashboard.
Note: DYNAMIC requires a condition. trackMembership emits entry and exit events that workflows can trigger on.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| type | No | DYNAMIC: auto-recomputed via condition. STATIC: manual member list. | |
| condition | No | Required for DYNAMIC segments. | |
| description | No | ||
| trackMembership | No |