User password requests

User password requests

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"
}

Request headers

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

Code Description
200 OK Success, password changed
400 Bad Request Bad or missing parameters.
401 Unauthorized The user is unauthorized.
404 Not Found Attempting to reset password to a non-existing user.

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"
}

Request headers

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

Code Description
200 OK Success, new password was added to the list of valid passwords.
400 Bad Request Bad or missing parameters.
401 Unauthorized The user is unauthorized.
404 Not Found Attempting to add a password to a non-existing user.

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"
}

Request headers

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

Code Description
200 OK Success, new password was deleted from the list of valid passwords.
400 Bad Request Bad or missing parameters.
401 Unauthorized The user is unauthorized.
404 Not Found Attempting to delete a password to a non-existing user.
RATE THIS PAGE
Back to top ↑