Skip to content

signInWithMagicLink

POST
/sign-in/magic-link
curl --request POST \
--url http://localhost:4000/api/auth/sign-in/magic-link \
--header 'Content-Type: application/json' \
--data '{ "email": "example", "name": "example", "callbackURL": "example", "newUserCallbackURL": "example", "errorCallbackURL": "example", "metadata": { "additionalProperty": "example" } }'

Sign in with magic link

Signs in an existing account only, never creates one. The link works once, for 5 minutes. No email is sent for an address with no account, and one address gets at most one link a minute, but the answer is the same. callbackURL, newUserCallbackURL and errorCallbackURL must be on BASE_URL or an ALLOWED_HOSTS name.

Media typeapplication/json
object
email
required

Email address to send the magic link

string
name

User display name. Only used if the user is registering for the first time. Eg: “my-name”

string
callbackURL

URL to redirect after magic link verification

string
newUserCallbackURL

URL to redirect after new user signup. Only used if the user is registering for the first time.

string
errorCallbackURL

URL to redirect after error.

string
metadata

Additional metadata to pass to sendMagicLink.

object
key
additional properties

Example generated

{
"email": "example",
"name": "example",
"callbackURL": "example",
"newUserCallbackURL": "example",
"errorCallbackURL": "example",
"metadata": {
"additionalProperty": "example"
}
}

Success

Media typeapplication/json
object
status
boolean

Example generated

{
"status": true
}

Bad Request. Usually due to missing parameters, or invalid parameters.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}

Unauthorized. Due to missing or invalid authentication.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}

Forbidden. You do not have permission to access this resource or to perform this action.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Too Many Requests. You have exceeded the rate limit. Try again later.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Internal Server Error. This is a problem with the server that you cannot fix.

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}