Update a contact segment
curl --request PUT \
--url https://api.orbit.devotel.io/api/v1/contacts/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High-value EU customers",
"auto_refresh": true,
"filters": {
"op": "AND",
"conditions": [
{
"field": "lifecycle_stage",
"op": "equals",
"value": "customer"
},
{
"field": "country_code",
"op": "equals",
"value": "DE"
}
]
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}"
payload = {
"name": "High-value EU customers",
"auto_refresh": True,
"filters": {
"op": "AND",
"conditions": [
{
"field": "lifecycle_stage",
"op": "equals",
"value": "customer"
},
{
"field": "country_code",
"op": "equals",
"value": "DE"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High-value EU customers',
auto_refresh: true,
filters: {
op: 'AND',
conditions: [
{field: 'lifecycle_stage', op: 'equals', value: 'customer'},
{field: 'country_code', op: 'equals', value: 'DE'}
]
}
})
};
fetch('https://api.orbit.devotel.io/api/v1/contacts/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'High-value EU customers',
'auto_refresh' => true,
'filters' => [
'op' => 'AND',
'conditions' => [
[
'field' => 'lifecycle_stage',
'op' => 'equals',
'value' => 'customer'
],
[
'field' => 'country_code',
'op' => 'equals',
'value' => 'DE'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.orbit.devotel.io/api/v1/contacts/segments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/contacts/segments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"meta": {}
}Contacts
Update a contact segment
Edit a contact segment’s name, description, rule definition (the filters AST or the legacy rules shape) or auto-refresh cadence. Changing the rule definition re-materialises membership immediately — so the contact count and members are live without waiting for the refresh scheduler — and snapshots the superseded definition so the edit can be rolled back from the definition history.
PUT
/
api
/
v1
/
contacts
/
segments
/
{id}
Update a contact segment
curl --request PUT \
--url https://api.orbit.devotel.io/api/v1/contacts/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High-value EU customers",
"auto_refresh": true,
"filters": {
"op": "AND",
"conditions": [
{
"field": "lifecycle_stage",
"op": "equals",
"value": "customer"
},
{
"field": "country_code",
"op": "equals",
"value": "DE"
}
]
}
}
'import requests
url = "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}"
payload = {
"name": "High-value EU customers",
"auto_refresh": True,
"filters": {
"op": "AND",
"conditions": [
{
"field": "lifecycle_stage",
"op": "equals",
"value": "customer"
},
{
"field": "country_code",
"op": "equals",
"value": "DE"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High-value EU customers',
auto_refresh: true,
filters: {
op: 'AND',
conditions: [
{field: 'lifecycle_stage', op: 'equals', value: 'customer'},
{field: 'country_code', op: 'equals', value: 'DE'}
]
}
})
};
fetch('https://api.orbit.devotel.io/api/v1/contacts/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'High-value EU customers',
'auto_refresh' => true,
'filters' => [
'op' => 'AND',
'conditions' => [
[
'field' => 'lifecycle_stage',
'op' => 'equals',
'value' => 'customer'
],
[
'field' => 'country_code',
'op' => 'equals',
'value' => 'DE'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.orbit.devotel.io/api/v1/contacts/segments/{id}"
payload := strings.NewReader("{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.orbit.devotel.io/api/v1/contacts/segments/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbit.devotel.io/api/v1/contacts/segments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High-value EU customers\",\n \"auto_refresh\": true,\n \"filters\": {\n \"op\": \"AND\",\n \"conditions\": [\n {\n \"field\": \"lifecycle_stage\",\n \"op\": \"equals\",\n \"value\": \"customer\"\n },\n {\n \"field\": \"country_code\",\n \"op\": \"equals\",\n \"value\": \"DE\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {},
"meta": {}
}Authorizations
BearerApiKey
Dashboard JWT token from Clerk
Path Parameters
Body
application/json
New display name (1-200 chars).
New description (up to 1000 chars).
AND/OR filter AST that defines the segment's membership.
Legacy { operator, conditions } rule shape, still accepted for backwards compatibility.
Whether the scheduler re-materialises membership automatically.
Per-segment refresh cadence in minutes (1-1440).
⌘I