Documentation

POST /api/auth/request-link

Request a magic sign-in link.

RequestPOST /api/auth/request-link
AuthenticationNo authentication
Handlerflowfinds-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

ParameterInTypeRequiredDescription
emailbodystringRequiredThe address to send the link to.
returnTobodystringOptionalWhere 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

200Always, for a well-formed body.

FieldTypeDescription
okbooleanTrue, uniformly.

Errors

StatusReasonWhen
400The body is not JSON.
405The method is GET.

Related

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