Mail a sign-in link.
const url = 'https://example.com/api/user/v1/login-links';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","next":"example","state":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/user/v1/login-links \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "next": "example", "state": "example" }'Mails a one-time link, valid for 15 minutes, to the address. The answer is the same whether or not an account has the address: redeeming the link with the auth service registers one. Limited per client IP and per address.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A path on the web app to go to after signing in, such as /consent?request=42. Anything else is dropped.
A random value the browser keeps and the link carries back as
state, so that browser can tell the link is its own and use it at
once. The web app asks before using any other link, which may be
someone else’s (login CSRF). Anything that doesn’t match is dropped.
Example generated
{ "email": "hello@example.com", "next": "example", "state": "example"}Responses
Section titled “Responses”Accepted; the mail goes out shortly.
Nothing to report; the mail is on its way.
object
Example generated
{}The request is malformed.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The token isn’t a user’s, lacks the scope, or the request came from another origin.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The body is larger than 4 KiB.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Too many links asked for, from this client or for this address.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Headers
Section titled “Headers”Seconds until a request may succeed.
Something failed on the server; the request ID leads to the log line.
An RFC 9457 problem.
object
Written for the user.
What is wrong with each field of the request.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}