POST
/v1/auth/otp/signup/email

Sign-up new end user by sending an OTP code via email

Initiate a sign-up process by sending a One-Time Password (OTP) to a new end user. Descope will generate and deliver the OTP code to the email address specified. Sending multiple OTP codes (for example, when an end user tries to sign-up a second or third time) will invalidate any OTP code that has already been sent.

This endpoint will return an empty response object when it completes successfully. The endpoint will return a failure code if the email address is already registered.

Next Steps

Verify the OTP code using the Verify OTP Code endpoint to complete the user sign-up process. After successfully verifying OTP code the end user will be signed-in.

See Also

  • See The User Object for further details on how to identify users and their contact information such as email addresses and phone number.
  • Use the Sign-In endpoint to sign-in an existing end user.
  • Use the Sign-In with Auto Sign-up endpoint to create a single sign-up and sign-in flow, which will create a new end user if they are not already registered.

Endpoint Authentication

Use authorization bearer header with the following format:

Authorization: Bearer \<Project ID\>

Try it

/v1/auth/otp/signup/email

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

In: header

Request Body

emailstring

loginIdstring

userobject

providerIdstring

loginOptionsobject

Status codeDescription
200OK
curl -X POST "https://api.descope.com/v1/auth/otp/signup/email" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Project ID>" \
  -d '{
  "email": "string",
  "loginId": "string",
  "user": {
    "username": "string",
    "name": "string",
    "phone": "string",
    "icon": "string"
  },
  "providerId": "string",
  "loginOptions": {
    "customClaims": {},
    "templateOptions": {
      "property1": "string",
      "property2": "string"
    },
    "locale": "string",
    "pkceChallenge": "string"
  }
}'

{
  "maskedEmail": "string"
}

Was this helpful?