Documentation

POST /api/intent

Ask the commerce assistant, or resolve a navigation intent.

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

What it does

The product surface's single conversational entry point. `surface` decides which of two paths runs. On `home` or `supplier` the request is handed to the commerce agent, which requires a resolved commerce identity — the signed-in user plus an `ff_dash_session` cookie linking to the engine — and answers with cited evidence. On the default surface it resolves a navigation intent instead, and answers a small set of counting questions directly for a signed-in user. Responses are always `Cache-Control: no-store`.

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
textbodystringRequiredThe founder's message. The agent refuses anything over 3,000 characters.
surfacebodystringOptional`home`, `supplier` or omitted for the default intent resolver.
ff_dash_sessioncookiestringOptionalLinks the signed-in user to their engine session. Required for the assistant surfaces.

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

s = requests.Session()
r = s.post("https://flowfinds.ai/api/intent", json={
    "text": "<string>",
    "surface": "<string>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"text":"What is my break-even CPA?","surface":"home"}' \
  "$FLOWFINDS_ORIGIN/api/intent"

Responses

200The assistant answered.

FieldTypeDescription
kindstring`answer`, `route`, `clarify` or `error`.
messagestringThe answer, at most 1,800 characters.
hrefstringWhere to navigate, on `kind: "route"`.
evidencearrayOnly the tool results the answer actually cited: `id`, `source`, `status`, `observed_at`.
uncertaintiesstring[]Up to four things the agent could not establish.
run_idstringThe run identifier.
enginestring`commerce-reasoning-v1`.
degradedbooleanTrue when the answer came from the deterministic fallback rather than the model.

200The intent resolver answered.

FieldTypeDescription
kindstring`clarify` among others.
confidencenumberHow confident the resolution is.
messagestringThe answer.

Errors

StatusReasonWhen
400The body is not JSON.
401An assistant surface was asked for without a resolvable commerce identity.

Related

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