sendsend.email

Update a segment

PATCH/v1/segments/{id}

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

NameInDescription
idrequiredpathThe segment id.

Request body

FieldType
nameoptionalstring
matchoptional"all" | "any"
rulesoptionalany[]

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

StatusCodeWhen
400validation_errorThe request body or parameters are invalid. The message says which field.
404not_foundNo such resource in this project.
401unauthorizedThe API key is missing, invalid or revoked.
403forbiddenThe key does not have the scope this endpoint needs.

Every error has the same shape. See Errors.