Server Side API

Change User Email

Available For: Enterprise Plans

This endpoint is intented to admiinister a user's account by changinbg the user's email address.
For security purposes, if the User Pool requires email verification then upon changing a user's email address the user is Signed Out everywhere.
The user will then need to use the new email address to Sign In.

CAUTION: Only change a user's email address to something that you know they own and can access!
Only call the API from your secure backend server environment.
Never call this from a client such as Web or Mobile.
URL
https://www.justsignin.com/api/v1/server/updateEmail
Protocol
HTTPS
Method
POST
Header
Content-Type: application/json; charset=utf-8

Request Body

The request body is a JSON object sent as the body of the HTTPS POST. The request body should include the following pramaters.

appId
String
Required
The ID of your Just Sign In website configured in the dashboard.
appSecret
String
Required
One of the App Secrets you created for the website referenced by the appId.
userId
String
Required
The ID of the user who wants to change their password. The user's ID is available when the user Signs In, or when you Verify the user's Session. Typically, you will save the User ID in your application's database.
email
String
Required

The user's new email address.

Example JSON POST Body (with pretend example values)
{
  "appId": "131889432817531002",
  "appSecret": "FCGAYPQP73U47ASKOWRPIOP7DPIY",
  "userId": "111770523408422991",
  "email": "kevin@flynns-arcade.com"
}

Responses

200 - Success

A successful call will return an HTTP 200 status code. The user will be Signed Out everywhere, and will need to Sign In using the new email address.

HTTP 200 JSON Response
{
  "success": true
}

400 - Invalid User

User ID was not of a valid user within your User Pool.

HTTP 400 JSON Response
{ 
  "error": "INVALID_USER",
  "message": "User doesn't exist"
}

403 - Email Already In Use

A user already exists in your user pool with the new email address.

HTTP 403 JSON Response
{
  error: "USER_WITH_EMAIL_ALREADY_EXISTS",
  message: "User with email already exists"
}

401 - Access Denied

An Access Denied response can occur from passing an invalid or expired sessionId, as well as an invalid appId or appSecret.

HTTP 401 JSON Response
{
  "error": "Access Denied!"
}