Skip to content

Get 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.

GET /cdp/segments/{id}
Authorization: Bearer vyg_…
Path paramTypeDescription
idstringThe segment id returned by Define Segment / List Segments.
{
"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
}
}
]
}
}
}
FieldTypeDescription
idstringThe segment id.
namestringThe segment name.
descriptionstringOptional description (omitted when not set).
scopestringYour brand’s connected shop domain.
conditionobjectThe STORED condition, including the server-injected scope wrapper.
Terminal window
curl -s "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value" \
-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.
503The CDP is temporarily unavailable (retry).

See Tenant Isolation & Scope for how segment scope is enforced.