Delete a dynamic Segment

Search Documentation

Search across all developer documentation

segments

Delete a dynamic Segment

DELETE /v1/segments/{id}
Auth required api.segments.manage

Deletes a managed Segment definition. On writes, {id} resolves as a UUID or, failing that, as the Segment's org-unique key.

A Segment something live still depends on is refused with 409 conflict, and the dependents are named in referenced_by as {kind, key, name}: an active workflow whose trigger enrolls on this Segment, or a broadcast that has it as an audience and has not gone out yet (draft or scheduled). Both would otherwise fail quietly and later — the workflow by simply never enrolling anyone again, the broadcast at its scheduled send. Delete or repoint the dependent, then retry.

The ClickHouse membership log is left in place, harmless once the definition is gone.

Path parameters

id string required

The Segment's UUID or, when the value does not parse as a UUID, its org-unique key. Unknown handles read as 404 not_found. Accepted on every Segment route, read and write alike.

Responses

Errors follow the RFC 7807 problem format — see the error reference.

204 Segment deleted (no content)
401 Missing, malformed, or unknown API key application/problem+json
403 Either the credential lacks the required scope (code: invalid_scope), or it is bound to the test environment and this operation is irreversible (code: test_environment_forbidden). Branch on code: the first is fixed by granting the scope, the second only by using a live credential. See the "Live and test credentials" section of the API description. application/problem+json
404 Resource not found application/problem+json
409 The write was refused by a state rule. Three cases, told apart by the extension members on the Problem: a stale expected_content_hash carries the row's current content_hash; and a delete blocked by a live dependent carries referenced_by. application/problem+json
429 Per-org rate limit exceeded application/problem+json
500 Unexpected server-side failure. The code is internal_error. The request_id field can be quoted to SendOps support to investigate. application/problem+json