Login or Create User by Email OTP
Create an OTP (one-time passcode) to the provided email for login verification. If no user account exists for the provided email, a new user will be created and email OTP sent.
HTTP Request
POST /v1/auth/otps/email/login_or_create
Returns
A successful response returns an object with user_id, user_created status indicating if the user has been newly created, and email_id properties.
Body
-
Email that uniquely identifies the user.
Minimum length is
1. -
Expiration time of the OTP in minutes. Must be between 1 to 10 minutes, defaults to 1 minute.
-
Determines if verification for the authentication method (email, phone_number) is required before marking the user as active.
-
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 OTPstep by matching fields in thedevice_fingerprintsuch as IP, User Agent or the combination of them (more fraud detection features coming soon!)
curl \
--request POST 'https://api.streambird.io/v1/auth/otps/email/login_or_create' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"email":"sandbox@streambird.io","expires_in":3}'
{
"email": "sandbox@streambird.io",
"expires_in": 3
}
{
"status": "pending",
"user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2",
"email_id": "email_24oXBL3PufzHkH1Jzyjc2EXYeo7",
"user_created": true
}