Skip to main content

Update user email

POST/api/v1/users

Updates the email address of an existing user. The email can be changed at any time, even if the user has active cases.

cv-api-key
Productionhttps://api.care360-next.carevalidate.com/api/v1/users
Staginghttps://api-staging.care360-next.carevalidate.com/api/v1/users

Headers

Headers
cv-api-keystringrequired

Your unique API key for authentication.

Content-Typestringrequired

Must be application/json.

Example: application/json

Request Body

Body Parameters
actionstringrequired

The action to be performed. Must be UPDATE_EMAIL.

Values:UPDATE_EMAIL
dataobjectrequired

An object containing the current and new email addresses.

Show 2 child properties
currentEmailstringrequired

The user's current email address.

Example: john.doe@example.com
newEmailstringrequired

The new email address for the user.

Example: doe.john@example.com

Example Request

curl --location '<BASE_URL>/api/v1/users' \
--header 'cv-api-key: <redacted>' \
--header 'Content-Type: application/json' \
--data-raw '{
"action": "UPDATE_EMAIL",
"data": {
"currentEmail": "john.doe@example.com",
"newEmail": "doe.john@example.com"
}
}'

Responses

200Email updated successfullyThe email was updated successfully. Returns the updated user object.
{
"status": 200,
"success": true,
"message": "Email updated successfully",
"data": {
"user": {
"email": "doe.john@example.com",
"firstName": "John",
"lastName": "Doe",
"dob": "2000-10-01",
"phoneNumber": "+11111111111",
"gender": "MALE",
"address": "1 ABC St",
"address2": "Apt 3",
"city": "NYC",
"state": "NY",
"country": "US",
"postalCode": "10101"
}
}
}
400User does not existThe currentEmail does not match an existing user.
{
"status": 400,
"success": false,
"message": "User {currentEmail} does not exist"
}
400User not in organizationThe user exists but is not part of the organization associated with the API key.
{
"status": 400,
"success": false,
"message": "User {currentEmail} does not exist in the organization"
}
400Not allowed to update emailThe user's role is not USER, so they cannot update their email.
{
"status": 400,
"success": false,
"message": "Not allowed to update the email"
}
400New email already existsThe newEmail is already associated with another user.
{
"status": 400,
"success": false,
"message": "New Email {newEmail} already exists"
}
400Email exists in databaseThe new email is already associated with an existing user in the database with a different ID.
{
"status": 400,
"success": false,
"message": "User with email {newEmail} already exists in database"
}
400Email exists in auth serviceThe new email is already linked to a different user account in the authentication system.
{
"status": 400,
"success": false,
"message": "User with email {newEmail} already exists in authentication"
}

Try It Out