Create Embeddable Magic Link
Create an embeddable token for Magic Link for a specific user. The token can be used with a custom email or any other methods of delivery to your user.
HTTP Request
POST /v1/auth/magic_links/create
Returns
A successful response returns an object with user_id
, email_id
, and token
properties.
Body
-
user_id string
Required if email not present. Given Unique ID that identifies the user.
Minimum length is
1
. -
email string
Required if user_id not present. Email that uniquely identifies the user.
Minimum length is
1
. -
expires_in number
Expiration time of the magic link in minutes. Must be between 5 to 10080 minutes (7 days).
-
device_fingerprint object
Device fingerprinting metadata for fraud detection during verification step. This is useful to ensure that the user who originated the request matches the user that verifies the token. Verification requirements can be enabled in the
Verify Token
step by matching fields in thedevice_fingerprint
such as IP, User Agent or the combination of them (more fraud detection features coming soon!)
curl \
-X POST https://api.streambird.io/v1/auth/magic_links/create \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id":"user_24wFP9pDa9YiMJLun94iKykoZs2","expires_in":60}'
{
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"expires_in": 60
}
{
"email": "sandbox@streambird.io"
}
{
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"email_id": "email_5CTLeRiJaGP3lmWN50iDI50br",
"token": "kto7dNK1tnsuCT95CTLeRiJaGP3lmWN50iDIbruTrCG6BFxz",
"request_origin_token": "8c5OHSgWbe76y8kp8g07qhuf1dcSZJ4zbC1ooFFZw4dJL3ZkXQdTvZIpJ6xbrHGjYMQchKgfNEfVp3ZbEDoELFtpcbsVLbKoLk5xSNIV4A1herVkbJyx2k73Uwmz8mz0"
}