Documentation
POST /api/auth/request-link
Request a magic sign-in link.
| Request | POST /api/auth/request-link |
|---|---|
| Authentication | No authentication |
| Handler | flowfinds-organ/app/api/auth/request-link/route.ts |
What it does
The response is `{ ok: true }` regardless of whether the address has an account or the send succeeded, so account existence never leaks. A guest who already owns generated pages has their id passed through, which is what lets redemption upgrade that row rather than starting a second, empty account. A signed-in user passes nothing, because there is nothing to claim. `GET` answers 405 with an `Allow: POST` header.
Authentication
No authentication. The response does not depend on a session.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
email | body | string | Required | The address to send the link to. |
returnTo | body | string | Optional | Where to land after redemption. Validated before use. |
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 '{"email":"<string>","returnTo":"<string>"}' \
"https://flowfinds.ai/api/auth/request-link"const res = await fetch("https://flowfinds.ai/api/auth/request-link", {
method: "POST",
credentials: "include",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"email": "<string>",
"returnTo": "<string>"
}),
});
const data = await res.json();import requests
s = requests.Session()
r = s.post("https://flowfinds.ai/api/auth/request-link", json={
"email": "<string>",
"returnTo": "<string>"
})
data = r.json()Recorded example
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
-d '{"email":"[email protected]"}' \
"$FLOWFINDS_ORIGIN/api/auth/request-link"Responses
200 — Always, for a well-formed body.
| Field | Type | Description |
|---|---|---|
ok | boolean | True, uniformly. |
Errors
| Status | Reason | When |
|---|---|---|
400 | — | The body is not JSON. |
405 | — | The method is GET. |
Related
POST /api/intent— Ask the commerce assistant, or resolve a navigation intent.POST /api/pages— Generate a page from an intent.POST /api/journey— Issue a single-use journey carrier.POST /api/journey/[id]/consume— Redeem a journey carrier once.GET /api/walkthrough— The walkthrough's steps and this user's position in it.POST /api/walkthrough/advance— Move forward or back a step.POST /api/walkthrough/dismiss— Dismiss the walkthrough.GET /api/auth/callback— Redeem a magic link.
Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.