Create segment
createSegmentSave a segment: a name and the conditions a contact has to meet. It holds no contacts of its own, so who matches is worked out each time it is used. previewSegment counts the matches first without saving anything. Nothing is sent.
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>",
"conditions": "<conditions>"
},
"name": "createSegment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| match | No | all (the default) when a contact has to meet every condition, any when one is enough. | |
| conditions | Yes | Each condition names a `field` and an `operator`: `email` (`is`, `is_not`, `contains`, `not_contains`, `ends_with`), `name` (`is`, `is_not`, `contains`, `not_contains`, `is_set`, `is_not_set`), `source` (`is`, `is_not`), `created` (`within_days`, `not_within_days`), `audience` (`in`, `not_in`), `opened` (`within_days`, `not_within_days`), `clicked` (`within_days`, `not_within_days`), `engaged` (`within_days`, `not_within_days`), `event` (`within_days`, `not_within_days`), `attribute` (`is`, `is_not`, `contains`, `not_contains`, `is_set`, `is_not_set`). Text is compared without regard to case, and `value` holds what it is compared with. `source` compares how the contact was added. `created`, `opened`, `clicked` and `engaged` take `days`: when the contact was added, the last time they opened or clicked a tracked email from this workspace, and the later of those two. A contact who never opened has not opened within any number of days. `audience` takes `audienceId` and counts only subscribed members. `event` takes `event`, a name recorded with `POST /events`, and `days`. `attribute` takes `key`, the name of a custom field on the contact. | |
| description | No |