Skip to content

Segment Count

GET /cdp/segments/{id}/count — read a segment’s membership size without reading a profile page. The count is evaluated server-side against the segment’s stored condition, which structurally carries your brand’s scope predicate (injected at define/update time) — so the count only ever covers your brand’s in-scope profiles.

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

GET /cdp/segments/{id}/count
Authorization: Bearer vyg_…
{
"segmentId": "seg__your-shop.myshopify.com__high-value",
"count": 1342,
"scope": "your-shop.myshopify.com"
}
FieldTypeDescription
segmentIdstringThe segment id.
countnumberNumber of profiles in the segment.
scopestringYour brand’s connected shop domain.
Terminal window
curl -s "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value/count" \
-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).