/gate/magic-link/sendSend Magic Link
Sends a single-use magic link to the end-user's email address to initiate passwordless sign-in.
The magic link token has a 15-minute TTL.
Returns 202 Accepted regardless of whether the email matches an existing end-user, preventing enumeration.
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| email * | string <email> | The address to send the sign-in link to. The response is the same whether or not an active end user has this address; a link is only sent when one does. |
| redirectUrl | string | The page the link opens. It must exactly match an entry on the project's magic-link redirect list, or the request gets 400 Omitted, the project's default redirect is used. The link adds |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 404 | K9O_END_USER_NOT_FOUND | No end-user account is registered for the supplied email address. |
| data * | object | The result of the send request. If the address belongs to an end user of the project, a sign-in link is emailed to it. |
| magicLink * | object | The send request was accepted. The answer is the same for every address. |
| sent * | true | Always |
| expiresAt * | string <date-time> | When the link expires, 15 minutes from now. Present for every address, registered or not. |
| debugLink | string | The sign-in link itself. Only in a test deployment that turns this on; a production deployment never includes it. |
| meta * | any | Request metadata: cost, timing and the request and trace ids. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.passwordless.requestMagicLink({
email: '[email protected]'
})Showing example in TypeScript
{
"email": "[email protected]"
}{
"data": {
"magicLink": {
"sent": true,
"expiresAt": "string"
},
"debugLink": "string"
}
}