Update Segment
update-segmentRename a segment, change its description, or replace its full rule tree; omitted fields remain unchanged.
Instructions
Rename a segment, change its description or replace its rules. Omitted fields are unchanged.
filter REPLACES the whole rule tree: to change one rule, read the tree with get-segment, edit it and send all of it back. New rules change who the campaigns and automations using the segment reach, scheduled campaigns included, so before sending filter you MUST confirm with the user, naming the segment. The members are then recomputed in the background, and status is processing until they are.
Look up what the rules will name before writing them. Property keys come from list-contact-properties, event names and their fields from list-events, list and tag ids from list-lists and list-tags, and campaign ids from the channel's campaign list tool. A filter naming a property or an event field the organization has not defined is refused.
Shape. filter is a tree whose root is always a group. A group joins its conditions with and or or, and a condition is a rule or another group, so "A and (B or C)" is an and group holding A and an or group of B and C. A filter needs at least one rule and holds at most 100, in groups nested at most 10 deep.
Choosing a rule.
Who they are, or a custom property:
attribute.The lists they are in or the tags they carry:
list_membership,tag.Whether a channel can reach them (subscribed, deliverable):
channel_status.How often they engaged with messages, optionally in a recent window:
engagement_count.When they last engaged, or that they never did:
last_engagement.What they did with one specific campaign or automation:
message_engagement.What they did in the app, site or store:
event.
Recent activity. Only engagement_count and event take a rolling time_window. Dates in attribute and last_engagement are fixed and do not move with time, so "opened an email in the last 30 days" is an engagement_count of at least 1 with a 30-day window, not a last_engagement date.
Absence. negate: true on list_membership, tag, message_engagement or event matches the contacts the rule would leave out, and last_engagement with does_not_exist matches contacts who never did the action. "Ordered before, but not in the last 90 days" is an and group of a plain event rule and the same rule with a 90-day window and negate: true.
Reaching people. A segment holds every contact its rules match, whatever their consent. Add a channel_status rule when it should hold only contacts a channel can message.
If the filter is refused, the error gives the path of each problem inside the tree (e.g. conditions.1.operator). Fix those and call again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "update-segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The segment id. | |
| name | No | ||
| filter | No | ||
| description | No |