POST /cdp/segments — define a rule-based segment over a native Unomi condition. The brand
scope predicate is AND-injected into the condition and the segment is tagged with the owning
scope, so membership can never span shops and the segment is visible only to your brand.
Authorization: Bearer vyg_…
Content-Type: application/json
Field Type Required Description namestring yes Non-empty segment name. conditionobject yes A Unomi condition object (must be a JSON object, not an array). keystring no Optional segment key. descriptionstring no Optional description.
"id" : " segment-scoped-id " ,
"name" : " High-value customers " ,
"scope" : " your-shop.myshopify.com "
Field Type Description idstring The resolved (scope-namespaced) segment id. namestring The segment name you supplied. scopestring Your brand’s connected shop domain.
curl -s -X POST " https://cdp.vyg.app/cdp/segments " \
-H " Authorization: Bearer vyg_your_key_here " \
-H " Content-Type: application/json " \
"name": "High-value customers",
"condition": { "type": "profilePropertyCondition", "parameterValues": {} }
Status When 400Missing/empty name, or a missing/non-object condition. 401Missing or invalid credential. 403No connected shop resolves a scope. 405Unsupported method (use POST to define, GET to list/read). 502upstream_error — the segment could not be persisted to the CDP.
See Tenant Isolation & Scope for how segment scope is
enforced.