Skip to content

Delete Segment

DELETE /cdp/segments/{id} — delete one of your brand’s segments.

By default the delete is impact-validated: if other items (e.g. other segments) depend on this segment, the delete is refused with 409 and the list of dependents, so you never silently break a dependent definition. Re-issue with ?force=true to delete anyway.

Only dependents owned by your brand are identified in the 409 body; dependents owned by other brands are counted in dependentCount but never named.

A segment owned by another brand is indistinguishable from a missing one: both return 404.

DELETE /cdp/segments/{id}[?force=true]
Authorization: Bearer vyg_…
Query paramTypeDefaultDescription
forcebooleanfalseSkip impact validation and delete unconditionally.
{
"id": "seg__your-shop.myshopify.com__high-value",
"deleted": true,
"scope": "your-shop.myshopify.com"
}
{
"error": "segment_in_use",
"error_description": "The segment is referenced by other items and was not deleted. Re-issue with ?force=true to delete anyway.",
"dependents": [{ "id": "seg__your-shop.myshopify.com__vips", "name": "VIPs", "scope": "your-shop.myshopify.com" }],
"dependentCount": 1
}
Terminal window
curl -s -X DELETE "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value?force=true" \
-H "Authorization: Bearer vyg_your_key_here"
StatusWhen
401Missing or invalid credential.
403No connected shop resolves a scope.
404The segment does not exist — or belongs to another brand.
409segment_in_use — dependents exist and force=true was not set.
502upstream_error — the segment could not be deleted from the CDP.
503The CDP is temporarily unavailable (retry).