LiveRecoverVYG Developer Docs
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 paramTypeDescription
idstringThe 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
					}
				}
			]
		}
	}
}
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.

Example

curl -s "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value" \
  -H "Authorization: Bearer vyg_your_key_here"

Errors

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.

On this page