Subscribe to interventions
const url = 'https://your-tenant-host/edgekit/v1/decide/interventions?domain_userid=7d3f2a1c-5b8e-4f60-9c2d-1e4a6b8c0f37';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://your-tenant-host/edgekit/v1/decide/interventions?domain_userid=7d3f2a1c-5b8e-4f60-9c2d-1e4a6b8c0f37'Server-sent events for Snowplow’s signals browser plugin, at /edgekit/v1/decide/interventions only. EventSource holds no key and sets no header, so the site comes from the Host, or from x-edgekit-site-id when present. The site proxy sends that header, because behind the proxy the Host is the tenant’s. The stream opens before anything is verified; a failure closes it and the client reconnects (retry: 15–25 s, jittered per stream). Rate limited as POST /edgekit/v1/decide.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Snowplow’s device id; the socket is addressed by it.
Example
7d3f2a1c-5b8e-4f60-9c2d-1e4a6b8c0f37Snowplow’s device id; the socket is addressed by it.
Snowplow’s user attribute key. Its value is ignored: the user comes from the signed access cookie. One of the two keys is required (400).
Snowplow’s user attribute key. Its value is ignored: the user comes from the signed access cookie. One of the two keys is required (400).
Responses
Section titled “Responses”An open stream. Each unnamed message event’s data is one JSON intervention in the plugin’s own shape — intervention_id, name, version, target_attribute_key: { name, id }, attributes (always {}); : ping comments keep it alive.
Example
data: {"intervention_id":"…","name":"trial_banner","version":1,"target_attribute_key":{"name":"domain_userid","id":"…"},"attributes":{}}Invalid request.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request validation failed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Too many requests. Retry-After says when to retry.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Unexpected error.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}With Retry-After, briefly unavailable; without it, not configured.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}