Create segment
create_segmentSave a segment (a named audience filter over contacts). Returns the segment. Errors: invalid_filter (read the fix), segment_name_taken, segment_limit. Next: preview_segment, then use the id as the audience of a campaign.
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": {
"name": "<name>",
"filter": "<filter>"
},
"name": "create_segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Segment name, unique in the workspace. | |
| filter | Yes | The filter: {"type":"group","op":"and"|"or","children":[...]}. Conditions: {"type":"tag","tag":"vip","has":true}, {"type":"status","is":["active"]}, {"type":"list","list_id":"lst_..","member":true}, {"type":"field","field":"email|first_name|last_name|fields.<key>","op":"eq|ne|contains|starts_with|gt|gte|lt|lte|is_set|is_not_set","value":".."}, {"type":"engagement","action":"sent|opened|clicked|engaged","within_days":30,"min_count":1,"negate":false}, {"type":"event","name":"..","within_days":14}, {"type":"date","field":"created_at","op":"within_last_days|older_than_days|before|after","days":7}. | |
| description | No | What it is for. |