User password requests
User password requests
This documentation applies to Redis Software versions 7.4.x.
Method |
Path |
Description |
PUT |
/v1/users/password |
Change an existing password |
POST |
/v1/users/password |
Add a new password |
DELETE |
/v1/users/password |
Delete a password |
Update password
PUT /v1/users/password
Reset the password list of an internal user to include a new password.
Request
Example HTTP request
PUT /users/password
Example JSON body
{
"username": "johnsmith",
"old_password": "a password that exists in the current list",
"new_password": "the new (single) password"
}
Key |
Value |
Description |
Host |
cnm.cluster.fqdn |
Domain name |
Accept |
application/json |
Accepted media type |
Request body
The request must contain a single JSON object with the following fields:
Field |
Type |
Description |
username |
string |
Affected user (required) |
old_password |
string |
A password that exists in the current list (required) |
new_password |
string |
The new password (required) |
Response
Returns a status code to indicate password update success or failure.
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code |
Description |
password_not_complex |
The given password is not complex enough (Only work when the password_complexity feature is enabled). |
new_password_same_as_current |
The given new password is identical to one of the already existing passwords. |
Status codes
Add password
POST /v1/users/password
Add a new password to an internal user's passwords list.
Request
Example HTTP request
POST /users/password
Example JSON body
{
"username": "johnsmith",
"old_password": "an existing password",
"new_password": "a password to add"
}
Key |
Value |
Description |
Host |
cnm.cluster.fqdn |
Domain name |
Accept |
application/json |
Accepted media type |
Request body
The request must contain a single JSON object with the following fields:
Field |
Type |
Description |
username |
string |
Affected user (required) |
old_password |
string |
A password that exists in the current list (required) |
new_password |
string |
The new (single) password (required) |
Response
Returns a status code to indicate password creation success or failure. If an error occurs, the response body may include a more specific error code and message.
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code |
Description |
password_not_complex |
The given password is not complex enough (Only work when the password_complexity feature is enabled). |
new_password_same_as_current |
The given new password is identical to one of the already existing passwords. |
Status codes
Delete password
DELETE /v1/users/password
Delete a password from an internal user's passwords list.
Request
Example HTTP request
DELETE /users/password
Example JSON body
{
"username": "johnsmith",
"old_password": "an existing password"
}
Key |
Value |
Description |
Host |
cnm.cluster.fqdn |
Domain name |
Accept |
application/json |
Accepted media type |
Request body
The request must contain a single JSON with the following fields:
Field |
Type |
Description |
username |
string |
Affected user (required) |
old_password |
string |
Existing password to be deleted (required) |
Response
Error codes
When errors are reported, the server may return a JSON object with
error_code
and message
fields that provide additional information.
The following are possible error_code
values:
Code |
Description |
cannot_delete_last_password |
Cannot delete the last password of a user |
Status codes