molted segments
Manage audience segments
| Command | Description |
|---|---|
molted segments create | Create a new segment |
molted segments list | List all segments |
molted segments get | Get a segment by ID |
molted segments update | Update a segment |
molted segments archive | Archive a segment (soft delete: status becomes archived) |
molted segments compute | Compute segment membership |
molted segments members | List members of a segment |
molted segments contact | List segments a contact belongs to |
Agent context
Segments define dynamic groups of contacts based on filter criteria. Use them to scope an experiment (experiments create --segment), to check a contact before sending (analytics segment-check), and in journey impact breakdowns.
Create a segment with filters
molted segments create --name "Active Users" --filters '{
"logic": "and",
"filters": [
{"type": "metadata", "field": "plan", "operator": "eq", "value": "pro"},
{"type": "contact_field", "field": "lifecycleStage", "operator": "eq", "value": "lead"}
]
}'
# → { "id": "<uuid>", "name": "Active Users", "filterGroup": {...}, "status": "active", ... }- Filter types: contact_field, metadata, account_field, firmographic, behavioral
- Operators: eq, neq, gt, gte, lt, lte, contains, not_contains, in, not_in, exists, not_exists, between
The abbreviated CLI shape is also accepted and normalized at create time so stored segments always use the canonical format above:
{ "operator": "and", "conditions": [
{ "field": "email", "op": "contains", "value": "test.local" } ] }Missing "type" is inferred from the field name (known contact columns → contact_field; else → metadata).
Compute membership (re-evaluates all contacts against the filters)
molted segments compute <segmentId>
# → { "queued": true, "segmentId": "<uuid>" }: recomputation runs async,
# results available shortly afterList segment members
molted segments members <segmentId> --limit 50 --offset 0
# → [{ "id": "<uuid>", "email": "...", "name": ..., "lifecycleStage": ..., "dealStage": ... }]Check a specific contact's segments
molted segments contact <contactId>
# → [{ "id": ..., "name": ..., "status": "active" }]: the active segments
# this contact belongs toCheck segment membership for a contact (useful before sending)
molted analytics segment-check --contact alice@example.com --segment <segmentId>
# → { "isMember": true, "evaluatedLive": true }Update or archive
molted segments update <id> --name "New Name" --filters '<json>'
molted segments archive <id> # status becomes "archived": it drops out
# of segments list and segments contactKey behaviors
- Segments are dynamic: membership is recomputed on
compute, and every active segment is queued for recompute aftercontacts sync - Filters use contact fields and metadata (synced via
contacts sync)
Related: molted contacts, molted analytics segment-check, molted journeys
Commands
molted segments create
Create a new segment
molted segments create [options]| Option | Description | Default |
|---|---|---|
--name <name> | Segment name (required) (required) | |
--filters <json> | Filter group as JSON (required) (required) |
molted segments list
List all segments
molted segments listmolted segments get
Get a segment by ID
molted segments get <id>| Argument | Description | Required |
|---|---|---|
<id> | Segment ID | yes |
molted segments update
Update a segment
molted segments update [options] <id>| Argument | Description | Required |
|---|---|---|
<id> | Segment ID | yes |
| Option | Description | Default |
|---|---|---|
--name <name> | Segment name | |
--filters <json> | Filter group as JSON |
molted segments archive
Archive a segment (soft delete: status becomes archived)
molted segments archive <id>| Argument | Description | Required |
|---|---|---|
<id> | Segment ID | yes |
molted segments compute
Compute segment membership
molted segments compute <id>| Argument | Description | Required |
|---|---|---|
<id> | Segment ID | yes |
molted segments members
List members of a segment
molted segments members [options] <id>| Argument | Description | Required |
|---|---|---|
<id> | Segment ID | yes |
| Option | Description | Default |
|---|---|---|
--limit <n> | Max results (default 50) | |
--offset <n> | Offset for pagination (default 0) |
molted segments contact
List segments a contact belongs to
molted segments contact <contactId>| Argument | Description | Required |
|---|---|---|
<contactId> | Contact ID | yes |
See CLI overview for global options, credentials and output format.