Evaluate a journey feature and redirect
const url = 'https://your-tenant-host/v1/decide/forward?feature=registered&site=site_example';const options = {method: 'GET', headers: {'x-edgekit-site-id': 'site_example'}};
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/v1/decide/forward?feature=registered&site=site_example' \ --header 'x-edgekit-site-id: site_example'A second transport over the same engine, not a second decision path. A top-level navigation: an <a href> or location.assign, never a fetch. Answers identically at /edgekit/v1/decide/forward. No API key and no origin check on either mount; the identity is the signed access cookie, and an asserted userId is refused (403). feature must name a published, journey-purpose feature on this site. That is checked before the engine runs, so a wrong-purpose or unknown name costs only the document read that resolved the site. The publish gate guarantees a journey feature resolves only to redirect outcomes, so this route redirects (302) to the resolved url, or to fallbackUrl when url did not resolve, or fails with an error. It never guesses a destination. Rate limited to 200 requests per 10 seconds per client per site. A journey feature charges no meter (the publish gate refuses one), so a repeated navigation costs nothing but the read.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The journey-purpose feature to evaluate. Named by the caller, same as a batch entry.
Example
registeredThe journey-purpose feature to evaluate. Named by the caller, same as a batch entry.
The site, for a navigation — which cannot set x-edgekit-site-id. The header wins when both are sent; one of them is required (400).
Example
site_exampleThe site, for a navigation — which cannot set x-edgekit-site-id. The header wins when both are sent; one of them is required (400).
Header Parameters
Section titled “Header Parameters”The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
Example
site_exampleThe site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
A short-lived preview token for this site. When valid, the decision evaluates against the staged preview document instead of the live one, and the response’s preview field is true. An absent, expired or invalid token falls back to the live document, with no error.
A short-lived preview token for this site. When valid, the decision evaluates against the staged preview document instead of the live one, and the response’s preview field is true. An absent, expired or invalid token falls back to the live document, with no error.
Responses
Section titled “Responses”Redirecting to the resolved destination, in Location. The body carries no JSON payload.
Headers
Section titled “Headers”Example
https://www.example.com/welcomeInvalid request.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Not allowed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Resource not found.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request body too large.
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." }}