Segments
Update a segment
Renames a segment or replaces its conditions, written by the rules of create_segment, and returns the segment. A field left out stays as it is; a field sent unchanged is not a change, so the segment as read can be sent back with a new name. New conditions are checked in full, nested segments included. Automations triggered by joining the segment follow new conditions by themselves. A request that changes nothing writes nothing and keeps updated_at.
patch/v1/sites/{site_id}/segments/{segment_id}
Request
- Base URLhttps://api.getsitecontrol.com
- AuthHTTP bearer
Path parameters
site_idinteger required
segment_idinteger required
Segment id from list_segments
Request body
Example request
{
"conditions": {
"op": "and",
"args": [
{
"op": "and",
"args": [
{
"op": "=",
"args": [
"{{$contact.isSubscribed}}",
"S"
]
},
{
"op": "ina",
"args": [
"{{$contact.tags}}",
[
12,
15
]
]
}
]
},
{
"op": "or",
"args": [
{
"op": ">",
"args": [
"{{$contact.date}}",
"2026-01-01"
]
},
{
"op": "in",
"args": [
"{{$contact.email}}",
"@example.com"
]
}
]
}
]
}
}Response
Successful Response
Example response
{
"conditions": {
"op": "and",
"args": [
{
"op": "and",
"args": [
{
"op": "=",
"args": [
"{{$contact.isSubscribed}}",
"S"
]
},
{
"op": "ina",
"args": [
"{{$contact.tags}}",
[
12,
15
]
]
}
]
},
{
"op": "or",
"args": [
{
"op": ">",
"args": [
"{{$contact.date}}",
"2026-01-01"
]
},
{
"op": "in",
"args": [
"{{$contact.email}}",
"@example.com"
]
}
]
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.