CDP REST APIAPI Reference
Ingest Event
The public, credential-free browser → CDP ingest proxy.
POST /cdp/ingest — the public, credential-free ingest proxy the storefront Web Pixel
posts to. The server injects the upstream Unomi credential; the browser sends none. See
Ingest for the full security model.
Request
POST /cdp/ingest
Content-Type: application/json
Origin: https://your-shop.myshopify.com- No credential. Send only
Content-Type(and the browser'sOrigin). AnyAuthorizationheader you send is ignored — the server builds the outgoing credential from scratch. - Body cap: 64 KB. A larger body is rejected
413before it is parsed or forwarded. - Body shape: a JSON object (the Unomi
context.jsonevent envelope). A non-JSON or non-object body is rejected400. - Scope binding: every tenancy-bearing
scopein the payload (source.scope,events[].scope,events[].target.scope) must equal the shop bound to the requestingOrigin, or the request is rejected403.
Body (example envelope)
{
"source": { "scope": "your-shop.myshopify.com" },
"events": [
{
"scope": "your-shop.myshopify.com",
"eventType": "view",
"properties": {}
}
]
}Response
Response contract is changing
Treat a successful ingest as 2xx:
- Today: the proxy returns the upstream Unomi status and body inline — typically
200. - Soon (CDLA-033): ingest returns
202 Acceptedas the event is forwarded asynchronously.
Branch on the 2xx class, not the exact code.
Example
curl -s -X POST "https://cdp.vyg.app/cdp/ingest" \
-H "Content-Type: application/json" \
-H "Origin: https://your-shop.myshopify.com" \
-d '{
"source": { "scope": "your-shop.myshopify.com" },
"events": [
{ "scope": "your-shop.myshopify.com", "eventType": "view", "properties": {} }
]
}'CORS
CORS is locked to storefront origins — any https://*.myshopify.com host plus configured
custom storefront domains. A disallowed Origin is rejected 403 and never reflected (no
* on this credentialed path). The proxy answers the OPTIONS preflight itself with the
locked, origin-reflecting headers.
Errors
| Status | error code | When |
|---|---|---|
400 | bad_request | Body is not valid JSON, or not a JSON object. |
403 | forbidden | Origin not allowed, or a payload scope does not match the requesting storefront. |
405 | method_not_allowed | Method other than POST / OPTIONS. |
413 | payload_too_large | Body exceeds the 64 KB cap. |
502 | bad_gateway | Ingest target unconfigured, or the upstream forward failed. |
See Errors for the full envelope.