Documentation

POST /api/journey

Issue a single-use journey carrier.

RequestPOST /api/journey
AuthenticationNo authentication
Handlerflowfinds-organ/app/api/journey/route.ts

What it does

Stores the state of a journey — the active route, the insight and the organ state — behind a 128-bit single-use identifier bound to a hash of the caller's address and user agent. The identifier travels through a redirect (including through sign-in) as `?jc=<carrierId>`, so state survives a navigation without being carried in a URL anyone can read or replay.

Authentication

No authentication. The response does not depend on a session.

Parameters

ParameterInTypeRequiredDescription
activeRoutebodystringRequiredThe route the journey is on.
insightbodystringRequiredThe insight to carry across.
organStatebodystringRequiredThe serialised organ state.
headlinebodystringOptionalThe headline to restore.
routeTitlebodystringOptionalThe route's title.
revealedbodybooleanOptionalWhether the route had been revealed.

Request

The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"activeRoute":"<string>","insight":"<string>","organState":"<string>","headline":"<string>","routeTitle":"<string>","revealed":"<boolean>"}' \
  "https://flowfinds.ai/api/journey"
const res = await fetch("https://flowfinds.ai/api/journey", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "activeRoute": "<string>",
    "insight": "<string>",
    "organState": "<string>",
    "headline": "<string>",
    "routeTitle": "<string>",
    "revealed": "<boolean>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/journey", json={
    "activeRoute": "<string>",
    "insight": "<string>",
    "organState": "<string>",
    "headline": "<string>",
    "routeTitle": "<string>",
    "revealed": "<boolean>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"activeRoute":"/","insight":"…","organState":"…"}' \
  "$FLOWFINDS_ORIGIN/api/journey"

Responses

200The carrier was issued.

FieldTypeDescription
carrierIdstringThe single-use identifier.

Errors

StatusReasonWhen
400invalid payload`activeRoute`, `insight` or `organState` is missing or not a string.
400malformed bodyThe body is not JSON.

Related

Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.