Update segment
Segment
Update Segment
Update a segment’s name, description, audience, filters, tags, or status. Passing status=2 soft-deletes the segment.
POST
Update segment
Use this endpoint to update a segment’s name, description, audience, filters, tags, or status. Passing
When
status: 2 soft-deletes the segment.
Endpoint
POST/segment/update
Content-Type: application/json
Authentication: Required (workspace auth)
Request Body
Update fields
Soft-delete
Response
status: 2 is passed:
Behavior
segment_idmust be an existing, non-deleted segment owned by the caller’s company/workspace — you cannot use this endpoint to “undelete” a segment.- Renaming checks name-uniqueness against other non-deleted segments in the workspace (skipped while soft-deleting).
- Changing
audience_idre-validates ownership of the new audience via the same check used by Create Segment and Preview Segment. - Sending
conditions/filter_conditionsormatch_typere-parses and stores the filter in the flat{ match_type, conditions: [...] }shape — this replaces (and is a different shape from) the CONDITIONLIST tree that Create Segment writes. - When the audience or filter actually changed (and the request isn’t a delete),
total_contactsis recomputed by evaluating the new filter against the (possibly new) audience’s contacts in memory.
Recomputing
total_contacts here only updates the cached count — it does not re-materialize the segment’s underlying contact mapping. List Segment Contacts, Export Segment Contacts, and any campaign already attached to this segment keep dialing/reading the contact set that was materialized at Create Segment time, until the segment is deleted and a new one is created in its place.Error Cases
Example cURL
Headers
API token for authentication
Body
application/json
Segment identifier
New name. Must be unique within the workspace (among non-deleted segments, excluding this one).
Re-scope the segment to a different audience.
New filter, flat format. Alias: filter_conditions.
Available options:
all, any 0 = Inactive, 1 = Active, 2 = Deleted (soft-delete)
Available options:
0, 1, 2 
