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"
}| Field | Type | Description |
|---|---|---|
segmentId | string | The segment id. |
count | number | Number of profiles in the segment. |
scope | string | Your 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
| 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). |