Documentation

API reference

Every endpoint, parameter, field and response.

FlowFinds is two HTTP surfaces. The sourcing engine serves everything under /api/… — finding a product, holding it, pricing it, building the store and running what happens after the sale. The product surface serves the conversational routes: the commerce assistant, generated pages, the walkthrough and sign-in. Both are documented here, from their handlers.

This reference is generated from a single typed array. Each page below is one entry in lib/api-spec.ts, so the reference cannot describe an endpoint the spec does not hold, and an endpoint added to the spec appears here without anybody writing a page.

Authentication in one paragraph

There is no API key. The engine identifies a caller by an ff_session cookie: if the request carries one it is used, and if it does not, the handler mints a fresh identifier, serves the request under it, and returns it in Set-Cookie. Every session-scoped resolver then filters on that value, which is why a client is, in practice, a cookie jar. Read the authentication guide for the full treatment.

# The first call mints a session. Keep the cookie jar for every call after it.
curl -s -c cookies.txt -b cookies.txt "$FLOWFINDS_ORIGIN/api/find"

# The same jar now carries ff_session, so the hold and the claim resolve.
curl -s -c cookies.txt -b cookies.txt "$FLOWFINDS_ORIGIN/api/offer"

Reading a response

One authentication scheme, and it is a cookie

The engine identifies a caller by an `ff_session` cookie. `_session()` reads it from the request; if there is none it mints a UUID hex string, uses it for the request, and returns it in `Set-Cookie`. Every session-scoped resolver then filters on that value. There is no API key or bearer token in the handlers, so a client is a cookie jar.

Non-200 means 'no API here'

The engine treats a non-200 answer as a signal that no API is mounted at the path, and the product surface reads it that way. Consequently many refusals are returned as HTTP 200 with a `status` of `refused`, `abstained`, `not_claimed` or similar, plus a `reason` and a human-readable `explanation`. Branch on `status`, not only on the HTTP code.

Every route fails as JSON

`do_GET` and `do_POST` both delegate through `_guarded`, which converts an uncaught exception in any handler into a structured JSON error rather than the stdlib HTML 500 page.

Refusal reasons are a closed set

`GET /api/reasons` serves the whole `REASONS` table the engine can cite, and `GET /api/controls` serves the `CONTROLS` table naming the method and path behind each control. A client can enumerate both rather than hardcoding strings.

Query strings never fall through

`_do_GET_inner` splits the path on `?` before dispatching, so cache busters and UTM parameters cannot push a request into the static file handler and 404.

The consequence for a client is concrete: check status in the body before you check the HTTP code. A great many of the engine’s refusals are successful HTTP responses that say, in a named field, why they could not do what was asked. Errors covers the codes; GET /api/reasons serves the closed set of reason strings.

Discovery

Being shown a product, holding it, passing on it and claiming it. The exclusivity contract lives here.

EndpointAuthWhat it does
GET /api/findsessionServe this session's product, minting a hold if it does not have one.
GET /api/feedsessionServe the whole field: this session's find first, then what it beat.
POST /api/selectsessionMove this session's hold onto a named product from the field.
POST /api/passsessionClaim the held product, or pass on it and be shown the next one.
POST /api/analyzesessionRun the analyser over any product description, claimed or not.
GET /api/analysissessionThe analysis of the product this session holds.
POST /api/asksessionAsk a question against one or more catalog products.
POST /api/discoversessionRun the discovery script and return its terminal output verbatim.
GET /api/discovery-researchsessionRead the state of the external discovery research job.
POST /api/discovery-researchsessionStart an external discovery research run.
GET /api/research-workspacesessionRead the research workspace for the signed-in account.
POST /api/research-workspacesessionMutate the research workspace.
GET /api/reasonspublicEvery refusal reason the engine can cite.
GET /api/controlspublicEvery control the product exposes, with the method and path behind it.
GET /api/track-recordpublicThe published hit rate, wins and misses, with its own basis stated.
GET /api/briefpublicThe nightly research brief, or the fact that it has never run here.
GET /api/modelsessionThe model behind the session's product.
GET /api/curriculumsessionCurriculum material for a named subject.
GET /api/notify_mesessionRead the watches this session has placed.
POST /api/notify_mesessionWatch a product that is currently unavailable.

Offer and dashboard

The researched price for a held product, the facts a dashboard renders, and the verdict computed over them.

EndpointAuthWhat it does
GET /api/offersessionThe researched offer for the session's product, or the refusal that says why there is none.
GET /api/dashboardsessionThe verdict, the facts behind it, and where each figure came from.
GET /api/launchsessionThe launch facts, each with whether it is true today.
POST /api/outcomesessionDeclare what happened with a claimed product.
POST /api/productsessionPublish a product of the founder's own into the store engine.
POST /api/product-launchsessionDrive the launch state machine for a product.
POST /api/presencesessionRecord which screen the operator is on.

Store and intents

Generating a storefront, editing it through guided intents, and the domain and checkout paths attached to it.

EndpointAuthWhat it does
GET /api/storesessionThe state of the session's storefront.
POST /api/storesessionStart generating the storefront for the session's product.
POST /api/store/publishsessionVerify and publish the storefront, regenerating it if verification demands.
POST /api/intentsessionAsk the engine what it would change on a surface, and why.
POST /api/intent/applysessionApply a proposed intent, regenerating the store.
POST /api/intent/ordersessionOverride the section the storefront leads with.
POST /api/intent/revertsessionUndo the last applied intent.
POST /api/ai/editsessionEdit the storefront in natural language.
GET /api/editor/sessionRead editor state and store metrics.
POST /api/editor/publishsessionPublish the editor's draft.
GET /api/domainssessionDomain suggestions or a quote for a named domain.
POST /api/domains/checkoutsessionStart payment for a domain.
POST /api/store/checkoutsessionOpen a customer order against a published store.
GET /api/store/confirmpublicConfirm an order with the payment provider and credit the revenue.
POST /api/tracksessionRecord a storefront funnel event.

Growth

Ad artifacts, the ad balance ledger, organic research and approval, and the referral link.

EndpointAuthWhat it does
GET /api/adsessionThe ad artifact for the session's product, with its pass criteria.
POST /api/ad/editsessionOverride the ad copy, or reset it to the generated version.
POST /api/growth/editsessionEdit a growth artifact in natural language.
GET /api/ads-managersessionThe campaign book.
POST /api/ads-managersessionSave the campaign book.
GET /api/adbalancesessionThe advertising balance, its ledger and any pending top-ups.
POST /api/adbalancesessionStart a balance top-up.
GET /api/adbalance/confirmpublicRetired. Balance confirmation is no longer client-driven.
POST /api/organic/researchsessionResearch an organic campaign for named platforms.
POST /api/organic/approvesessionApprove a researched campaign for a platform and scope.
GET /api/organic/logsessionThe approval log.
GET /api/sharesessionThe referral link, the people it brought, and the milestones they reached.
POST /api/sharesessionRecord that the share control was used, unlocking the next find.
GET /api/usagesessionThe tier, what it includes, and how referrals change it.

Supplier

Sourcing terms, the supplier connection, and sample ordering.

EndpointAuthWhat it does
GET /api/supplierssessionSourcing options for a named product.
GET /api/supplier-connectionsessionWhich supplier this account is connected to.
POST /api/supplier-connectionsessionConnect or disconnect a supplier.
POST /api/samples/checkoutsessionOrder a physical sample of a product.

Activity

Orders, revenue, satisfaction sampling, the support desk and the operator's task list.

EndpointAuthWhat it does
GET /api/trackingsessionThis founder's orders, and nobody else's.
GET /api/revenuesessionConfirmed revenue, per store and per currency.
GET /api/satisfactionsessionThe satisfaction sample.
GET /api/helpdesksessionThe support desk: tickets, replies and the agent's state.
POST /api/helpdesksessionAct on a support ticket.
POST /api/supportsessionAsk the support agent a question.
GET /api/todossessionThe operator's task list.
POST /api/todossessionAdd, complete or delete a task.

Account and settings

Creating the account a claim is credited to, signing in and out, and the settings the desk reads.

EndpointAuthWhat it does
POST /api/accountsessionSave the account a claim is credited to.
POST /api/login/requestpublicRequest a sign-in link.
POST /api/logoutsessionSign out.
GET /api/settings/businesssessionThe business settings the support desk reads.
POST /api/settings/businesssessionSave the business settings.
GET /api/settings/payoutsessionThe payout destination.
POST /api/settings/payoutsessionSave the payout destination.
POST /api/settings/rulessessionManage the support desk's keyword rules.

Fix

The standalone store-repair tool: submit a URL, watch the run, adopt the result.

EndpointAuthWhat it does
POST /api/fixpublicSubmit a store URL for repair.
GET /api/fix/mineoptionalThe state of a Fix run, or this account's Fix subscriptions.
POST /api/fix/adoptsessionAttach a Fix run to this session.
POST /api/fix/eventoptionalRecord an event or a piece of feedback against a Fix run.

Assistant and session (product surface)

The Next.js routes on the product surface: the commerce assistant, generated pages, the journey carrier, the walkthrough and magic-link sign-in.

EndpointAuthWhat it does
POST /api/intentsessionAsk the commerce assistant, or resolve a navigation intent.
POST /api/pagessessionGenerate a page from an intent.
POST /api/journeypublicIssue a single-use journey carrier.
POST /api/journey/[id]/consumesessionRedeem a journey carrier once.
GET /api/walkthroughoptionalThe walkthrough's steps and this user's position in it.
POST /api/walkthrough/advancesessionMove forward or back a step.
POST /api/walkthrough/dismisssessionDismiss the walkthrough.
POST /api/auth/request-linkpublicRequest a magic sign-in link.
GET /api/auth/callbackcallbackRedeem a magic link.
GET /api/healthpublicLiveness, and which build is answering.

Internal and administrative paths

These exist in the running server and are listed so the surface is accounted for rather than quietly trimmed. They are not part of the developer interface: they are authenticated separately, called by a payment provider, or serve generated HTML rather than JSON. Their shapes follow the console or the provider that calls them, so no contract is documented for them here.

EndpointAuthWhat it does
GET /adminadminThe founder admin console.
GET /marketingadminThe marketing lane and its own admin.
GET /simplepaycallbackPayment-provider callbacks and assets.
POST /api/billing/webhookcallbackBilling provider webhook.
GET /store/publicGenerated HTML: storefronts, previews, profiles and coded links.

What this reference covers

The extracted surface lists 99 distinct paths across the engine's handler files, many of them repeated across scratch copies of `server.py`. This reference documents the developer-facing paths in full and accounts for the remainder — the admin console, the marketing lane, the payment-provider callbacks and the prefixes that serve generated HTML — as internal entries rather than omitting them.

Distinct paths extracted from the handlers99
Endpoints documented in full90
Internal groupings accounted for5

Next

  • Quickstart — from nothing to a first successful call.
  • Agents and tools — the tools the commerce agent can call, and the evidence each one returns.
  • Cookbook — recipes that compose these endpoints into a working sequence.

90 endpoints are documented above. Start with GET /api/find.

Next: Quickstart · Agents and tools · Cookbook