Documentation

POST /api/walkthrough/advance

Move forward or back a step.

RequestPOST /api/walkthrough/advance
AuthenticationSession cookie required
Handlerflowfinds-organ/app/api/walkthrough/advance/route.ts

What it does

`expectedStepIndex` is a compare-and-swap: the move is refused with 409 when the caller's idea of the current step disagrees with the stored one, so two tabs cannot advance the walkthrough twice. Moving back returns the `href` of the page that step produced, resolved from the user's own generated pages, or `/` when there is none.

Authentication

Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.

Parameters

ParameterInTypeRequiredDescription
expectedStepIndexbodyintegerRequiredThe step the caller believes it is on.
directionbodystringOptional`back` to rewind. Any other value is refused.

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 '{"expectedStepIndex":"<integer>","direction":"<string>"}' \
  "https://flowfinds.ai/api/walkthrough/advance"
const res = await fetch("https://flowfinds.ai/api/walkthrough/advance", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "expectedStepIndex": "<integer>",
    "direction": "<string>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/walkthrough/advance", json={
    "expectedStepIndex": "<integer>",
    "direction": "<string>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"expectedStepIndex":2}' \
  "$FLOWFINDS_ORIGIN/api/walkthrough/advance"

Responses

200The move was applied.

FieldTypeDescription
okbooleanTrue.
stepIndexnumberThe new position.
hrefstring | undefinedWhere to navigate when rewinding.

Errors

StatusReasonWhen
400The body is malformed, `expectedStepIndex` is not an integer, or `direction` is neither absent nor `back`.
404disabledThe walkthrough feature flag is off.
409`expectedStepIndex` does not match the stored step. The body carries `reason`.

Related

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