PUT {{NEXT_PUBLIC_API_BASE_URL}}/api/user/update/password

Update User Password

Allows an authenticated user to update their password. The user must give their current password and a new password. Their current password’s hash must match their account’s password hash. The user’s new password must also be at least 8 characters long, but less than 255 characters.

Request Headers

  • Content-Type: application/json
  • X-CSRFToken: The CSRF token of the user

Request Body

  • password (string, required): The current password of the user
  • new_password (string, required): The user’s new password

Example:

{
  "password": "currentPassword123",
  "new_password": "newPassword456"
}

Responses

200

The user’s password has been successfully updated.

Example:

{
  "message": "Password updated!"
}

400

The current password does not match the account’s password.

Example:

{
  "message": "Current password does not match"
}

500

An error occurred while updating the user’s password.

Example:

{
  "message": "Error updating user password",
  "error": "Some descriptive error message"
}
Last updated on