LoguDocs
Open Logu

Sign-in · requestMagicLink

Email a magic link

POST /api/auth/magic-link

Emails a one-time link (15 minutes) to sign in, create the account, or reset the password. The answer is the same whether or not the address has an account. Rate limited per IP and per email. When the server uses Cloudflare Turnstile the app sends its token in the Turnstile-Token header (403 forbidden without a valid one). For an address with no account, or with an unconfirmed email, a global daily cap applies (429 rate_limited, calm text, Retry-After to 00:00 UTC); an address that exists with a confirmed email is never capped.

Who may call it
Anyone (no credentials)
Server
https://api.logu.dev

Request body#

Content type application/json (required).

Who to email a magic link to, and why. Strict.

FieldTypeRequiredNotes
emailstringrequired0–254 chars
namestringoptional
intent"sign-in" | "sign-up" | "reset"optionaldefault "sign-in"
locale"en" | "pt-BR"optionaldefault "en"
{
  "email": "ana@example.com",
  "intent": "sign-in",
  "locale": "en"
}

Example#

curl -s -X POST "https://api.logu.dev/api/auth/magic-link" \
  -H "Content-Type: application/json" \
  -d '{"email":"ana@example.com","intent":"sign-in","locale":"en"}'

Responses#

200

Sent (or would have been).

{
  "ok": true
}
Response fields
FieldTypeRequiredNotes
oktruerequired

Errors#

Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.

StatusCodeMeaning
400unknown_fieldThe body has a field the endpoint doesn't know (often a typo or snake_case).
400bad_requestThe request is malformed or a field is invalid (see issues).
403forbiddenThe caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint).
429rate_limitedThis API key sent too many requests, or a human did too much too fast: sign-in attempts, workspaces created in a day, or a global daily cap on new accounts was reached.
500internal_errorSomething went wrong on Logu's side.
503service_unavailableA dependency is down or a feature isn't configured on this server.