Send a magic link
const url = 'https://your-tenant-host/v1/id/sign-in/magic-link';const options = { method: 'POST', headers: {'x-edgekit-site-id': 'site_example', 'Content-Type': 'application/json'}, body: '{"email":"user@example.com","name":"Ada","callbackURL":"/account"}'};
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://your-tenant-host/v1/id/sign-in/magic-link \ --header 'Content-Type: application/json' \ --header 'x-edgekit-site-id: site_example' \ --data '{ "email": "user@example.com", "name": "Ada", "callbackURL": "/account" }'Emails a link pointing at the EdgeKit interstitial, plus a code for the cross-device flow. Answers 200 whether or not a user holds the address. A retry mails again and spends the per-address limit.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
Example
site_exampleThe site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
user@example.comExample
AdaExample
/accountResponses
Section titled “Responses”The link was sent, if the address can receive one.
object
Example
{ "success": true}Invalid request.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Not allowed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Resource not found.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request validation failed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Too many requests. Retry-After says when to retry.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Unexpected error.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}With Retry-After, briefly unavailable; without it, not configured.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}