Create a segment
Create a custom segment from conditions such as Did not open a campaign.
MCP tool privy_write → create_segment
write
Creates the segment and returns its id and current mailable_count. Privy cannot edit the conditions of a segment after creation, so a wrong condition means a new segment; a custom segment can be deleted in Contacts > Segments. It reaches no one, so it does not wait for your OK. Campaigns in a "Did not open" condition are listed by their name, not their subject line.
Parameters
| Name | Type | Description |
|---|---|---|
| name string required | string | Segment name. Only you see it, contacts do not |
| match string | string | all (Match all, the default) or any (Match any) |
| conditions array required | array | Objects with category, rule and value as in Privy's Choose Category picker, for example Email Engagement, Did not open, and a campaign name |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "privy_write",
"arguments": {
"operation": "create_segment",
"arguments": {
"name": "Jane Doe",
"conditions": "conditions"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"segment_id": "seg_7d20",
"name": "Did not open October sale",
"match": "all",
"conditions": [
{
"category": "Email Engagement",
"rule": "Did not open",
"value": "October sale announcement"
}
],
"mailable_count": 2890
},
"isError": false
}