MOLTED EMAIL
CLI Reference

molted segments

Manage audience segments

CommandDescription
molted segments createCreate a new segment
molted segments listList all segments
molted segments getGet a segment by ID
molted segments updateUpdate a segment
molted segments archiveArchive a segment (soft delete: status becomes archived)
molted segments computeCompute segment membership
molted segments membersList members of a segment
molted segments contactList 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 after

List 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 to

Check 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 contact

Key behaviors

  • Segments are dynamic: membership is recomputed on compute, and every active segment is queued for recompute after contacts 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]
OptionDescriptionDefault
--name <name>Segment name (required) (required)
--filters <json>Filter group as JSON (required) (required)

molted segments list

List all segments

molted segments list

molted segments get

Get a segment by ID

molted segments get <id>
ArgumentDescriptionRequired
<id>Segment IDyes

molted segments update

Update a segment

molted segments update [options] <id>
ArgumentDescriptionRequired
<id>Segment IDyes
OptionDescriptionDefault
--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>
ArgumentDescriptionRequired
<id>Segment IDyes

molted segments compute

Compute segment membership

molted segments compute <id>
ArgumentDescriptionRequired
<id>Segment IDyes

molted segments members

List members of a segment

molted segments members [options] <id>
ArgumentDescriptionRequired
<id>Segment IDyes
OptionDescriptionDefault
--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>
ArgumentDescriptionRequired
<contactId>Contact IDyes

See CLI overview for global options, credentials and output format.