LiveRecoverVYG Developer Docs
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's Origin). Any Authorization header you send is ignored — the server builds the outgoing credential from scratch.
  • Body cap: 64 KB. A larger body is rejected 413 before it is parsed or forwarded.
  • Body shape: a JSON object (the Unomi context.json event envelope). A non-JSON or non-object body is rejected 400.
  • Scope binding: every tenancy-bearing scope in the payload (source.scope, events[].scope, events[].target.scope) must equal the shop bound to the requesting Origin, or the request is rejected 403.

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 Accepted as 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

Statuserror codeWhen
400bad_requestBody is not valid JSON, or not a JSON object.
403forbiddenOrigin not allowed, or a payload scope does not match the requesting storefront.
405method_not_allowedMethod other than POST / OPTIONS.
413payload_too_largeBody exceeds the 64 KB cap.
502bad_gatewayIngest target unconfigured, or the upstream forward failed.

See Errors for the full envelope.

On this page