CDP REST APIAPI Reference
Get Segment
Read one segment's metadata and stored condition. 404 for a missing or out-of-scope segment.
GET /cdp/segments/{id} — read one of your brand's segments: its metadata plus the stored
match condition. The condition is returned exactly as persisted, which includes the
server-injected scope predicate (your shop domain, AND-combined at define/update time) —
so a define → get round-trip is exact and the returned condition can be edited and sent
back via Update Segment.
A segment owned by another brand is indistinguishable from a missing one: both return 404.
Request
GET /cdp/segments/{id}
Authorization: Bearer vyg_…| Path param | Type | Description |
|---|---|---|
id | string | The segment id returned by Define Segment / List Segments. |
Response 200
{
"id": "seg__your-shop.myshopify.com__high-value",
"name": "High-value customers",
"description": "LTV ≥ 250",
"scope": "your-shop.myshopify.com",
"condition": {
"type": "booleanCondition",
"parameterValues": {
"operator": "and",
"subConditions": [
{
"type": "profilePropertyCondition",
"parameterValues": {
"propertyName": "properties.shopDomain",
"comparisonOperator": "equals",
"propertyValue": "your-shop.myshopify.com"
}
},
{
"type": "profilePropertyCondition",
"parameterValues": {
"propertyName": "properties.totalSpend",
"comparisonOperator": "greaterThanOrEqualTo",
"propertyValueDouble": 250
}
}
]
}
}
}| Field | Type | Description |
|---|---|---|
id | string | The segment id. |
name | string | The segment name. |
description | string | Optional description (omitted when not set). |
scope | string | Your brand's connected shop domain. |
condition | object | The STORED condition, including the server-injected scope wrapper. |
Example
curl -s "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value" \
-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. |
503 | The CDP is temporarily unavailable (retry). |
See Tenant Isolation & Scope for how segment scope is enforced.