Skip to content
POST /auth/send-magic-link

Emails the user a one-time sign-in link. Protected by Turnstile (cf_token) and one request per email address a minute (429).

An email with no account is answered 404 with truto_error_code account_not_found. A turned-off account is answered 403 with account_deactivated. A sign-up still waiting for verification gets no link (403): it signs in through its verification link.

Request Body

cf_tokenstring

The Turnstile token from the sign-in page.

emailstring
redirectstring

An app path to open after sign-in.

Response Body

expires_ininteger

Seconds the link works.

resend_afterinteger

Seconds until another link can be requested.

successboolean

Errors

StatusDescription
400A missing cf_token or email, or a cf_token Turnstile refused.
403The account is turned off (truto_error_code account_deactivated), the sign-up is not verified yet, or password and magic-link sign-in are disabled for the organization (use SSO).
404No account uses this email (truto_error_code account_not_found).
429Another link for this email in the last 60 seconds.
curl -X POST 'https://api.truto.one/auth/send-magic-link' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "cf_token": "your_cf_token",
  "email": "your_email",
  "redirect": "your_redirect"
}'
const body = {
  "cf_token": "your_cf_token",
  "email": "your_email",
  "redirect": "your_redirect"
};

const response = await fetch('https://api.truto.one/auth/send-magic-link', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/auth/send-magic-link"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "cf_token": "your_cf_token",
    "email": "your_email",
    "redirect": "your_redirect"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())