LiveRecoverVYG Developer Docs
CDP REST APIAPI Reference

Segment Count

Read a segment's membership count without paging profiles.

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.

Request

GET /cdp/segments/{id}/count
Authorization: Bearer vyg_…

Response 200

{
	"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.

Example

curl -s "https://cdp.vyg.app/cdp/segments/seg__your-shop.myshopify.com__high-value/count" \
  -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).

On this page