Update a segment
Rename it, or change its rules or match. Rules replace the old ones. Each rule has a field (email, first_name, last_name, status, created_at, property with a key, or topic with a topic_id), an op and usually a value. Text operators: equals, not_equals, contains, not_contains, starts_with, ends_with, is_set, is_not_set (case-insensitive). Number properties also take gt, gte, lt, lte. status is subscribed or unsubscribed. created_at takes before or after with a date, or within_days or older_than_days with a number. topic takes subscribed or not_subscribed. match is all (every rule) or any (at least one). Up to 10 rules.
Required scope: contacts:manage
Parameters
| Name | In | Description |
|---|---|---|
idrequired | path | The segment id. |
Request body
| Field | Type |
|---|---|
nameoptional | string |
matchoptional | "all" | "any" |
rulesoptional | any[] |
Unknown fields are rejected, so a typo never silently does nothing.
Example
curl -X PATCH 'https://api.sendsend.email/v1/segments/ID' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "Pro and trial"
}'Response 200
{
"id": "seg_Pm4…",
"object": "segment",
"audience_id": "aud_7Qe2…",
"name": "Pro and trial",
"match": "all",
"rules": [
{
"field": "property",
"key": "plan",
"op": "equals",
"value": "pro"
},
{
"field": "status",
"op": "is",
"value": "subscribed"
}
],
"created_at": "2026-10-06T15:00:00.000Z",
"updated_at": "2026-10-06T15:00:00.000Z"
}Errors
| Status | Code | When |
|---|---|---|
| 400 | validation_error | The request body or parameters are invalid. The message says which field. |
| 404 | not_found | No such resource in this project. |
| 401 | unauthorized | The API key is missing, invalid or revoked. |
| 403 | forbidden | The key does not have the scope this endpoint needs. |
Every error has the same shape. See Errors.