POST /cdp/query/{itemType}/{property}/metrics — compute a requested subset of
sum / avg / min / max over a numeric property, for the items matching a condition.
itemType is profile or event; anything else returns 404.
Your brand’s scope is AND-ed into the condition server-side , so the metrics only ever
cover your brand’s data. The condition (optional) uses the same public condition subset as
Query Count .
itemType Addressable properties profileproperties.*eventproperties.*, flattenedProperties.*, timeStamp, eventType
systemProperties and scope/shopDomain paths are rejected with 400.
POST /cdp/query/{itemType}/{property}/metrics
Authorization: Bearer vyg_…
Content-Type: application/json
Field Type Required Description metricsstring[] yes Non-empty subset of sum, avg, min, max. conditionobject no Unomi condition (public subset). Omit for in-scope.
"metrics" : [ " sum " , " avg " ],
"type" : " eventTypeCondition " ,
"parameterValues" : { "eventTypeId" : " order " }
"property" : " properties.total " ,
"metrics" : { "_sum" : 125430.5 , "_avg" : 87.2 },
"scope" : " your-shop.myshopify.com "
Field Type Description itemTypestring The queried item type. propertystring The property the metrics were computed over. metricsobject Metric map as computed by the CDP (keys like _sum, _avg, …). scopestring Your brand’s connected shop domain.
curl -s -X POST " https://cdp.vyg.app/cdp/query/event/properties.total/metrics " \
-H " Authorization: Bearer vyg_your_key_here " \
-H " Content-Type: application/json " \
-d ' {"metrics":["sum","avg","max"]} '
Status When 400Missing/unknown metrics, property not in the allowlist, or bad condition. 401Missing or invalid credential. 403No connected shop resolves a scope. 404Unknown itemType (only profile and event are supported). 429Query throttle exceeded — retry with backoff. 502The CDP could not evaluate the query. 503The CDP is temporarily unavailable (retry).