Update a segment
Partial update: an omitted field is left untouched. Changing a DYNAMIC segment's condition recomputes member_count in the same call, so the returned object never states a size that belongs to the previous filter. condition is ignored on a STATIC segment, whose membership is the explicit list.
type is not accepted here — see the create operation.
Requires the segments:write scope — Create, edit, and delete your segments.
AuthorizationBearer <API Key>API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.
id*stringResource id.
uuidapplication/json- body
Body for PATCH /api/v1/segments/{id}. type is deliberately absent — it is fixed at creation. condition is ignored on a STATIC segment.
name?string1 <= length <= 100description?stringlength <= 500condition?A filter condition: one or more groups combined with logic.
track_membership?booleanThe updated segment
application/json- response
A segment as exposed on the v1 API.
id*stringuuidname*stringdescription*string|nulltype*string"DYNAMIC""STATIC"condition*|nulltrack_membership*booleanmember_count*integercreated_at*stringdate-timeupdated_at*stringdate-timecurl -X PATCH 'https://api.sendly.now/api/v1/segments/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "type": "DYNAMIC", "condition": { "logic": "AND", "groups": [ { "filters": [ { "field": "string", "operator": "equals", "value": null, "unit": "days" } ], "conditions": {} } ] }, "track_membership": true, "member_count": 0, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}