CDP REST APIAPI Reference
Delete Segment
Delete a segment with impact validation — refused with 409 and the dependents list when referenced, unless ?force=true.
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.
Request
DELETE /cdp/segments/{id}[?force=true]
Authorization: Bearer vyg_…| Query param | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Skip impact validation and delete unconditionally. |
Response 200
{
"id": "seg__your-shop.myshopify.com__high-value",
"deleted": true,
"scope": "your-shop.myshopify.com"
}Response 409 (segment_in_use)
{
"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
}Example
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"Errors
| Status | When |
|---|---|
401 | Missing or invalid credential. |
403 | No connected shop resolves a scope. |
404 | The segment does not exist — or belongs to another brand. |
409 | segment_in_use — dependents exist and force=true was not set. |
502 | upstream_error — the segment could not be deleted from the CDP. |
503 | The CDP is temporarily unavailable (retry). |