POST
/v1/auth/otp/update/email

Update Email Address of Existing User

Update the email of an existing end user by sending an OTP code to the new email address. After successfully verifying the code the new email address will be used to deliver new OTP messages via email. The bearer token requires both the ProjectId and refresh JWT in the format \<Project ID\>:<JWT>, and can therefore only be run for end users who are currently signed-in.

This endpoint will return an empty response object when it completes successfully.

Descope allows you to associating multiple login IDs for a user during API update calls. For details on how this feature works, please review the details here.

Next Steps

Verify the OTP code using the Verify OTP Code endpoint to complete the update process. After successfully verifying the code the new email address will replace the original email address.

See Also

  • See The User Object for further details on how to identify users and their contact information such as email address and phone number.
  • See the Verify OTP Code endpoint, which will return the Refresh Jwt needed.

Endpoint Authentication

Use authorization bearer header with the following format:

Authorization: Bearer <Project ID:Refresh JWT>

Try it

/v1/auth/otp/update/email

The Authorization access token

Authorization

Authorization
Required
Bearer <token>

In: header

Request Body

loginIdstring

emailstring

addToLoginIDsboolean

Default: false

onMergeUseExistingboolean

Default: false

providerIdstring

templateOptionsobject

localestring

Status codeDescription
200OK
curl -X POST "https://api.descope.com/v1/auth/otp/update/email" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Project ID:Refresh JWT>" \
  -d '{
  "loginId": "string",
  "email": "string",
  "addToLoginIDs": false,
  "onMergeUseExisting": false,
  "providerId": "string",
  "templateOptions": {
    "property1": "string",
    "property2": "string"
  },
  "locale": "string"
}'

{
  "maskedEmail": "string"
}

Was this helpful?