Change User Password
Allows administrators to update a user's password. This endpoint requires the administrator's credentials and adheres to the organization's password policy.
Resource name: /api/v1/users/changePassword
Request Method: PUT
Request parameters:
| Parameter | Type | Description |
|---|---|---|
| adminPassword
mandatory |
string | Administrator's password. |
| password
mandatory |
string | Temporary password for the user based on the password policy. |
| userName
mandatory |
string | Username of the user. |
Request example:
{
"userName": "algotest",
"password": "1234567",
"adminPassword": "string"
}
cURL Example:
curl -X PUT "https://<localhost>/api/v1/users/changePassword" \
-H "Content-Type: application/json" \
-d '{
"userName": "algotest",
"password": "newTempPass456",
"adminPassword": "admin123"
}'
Status codes:
| Code | Description |
|---|---|
| 200 | OK - Password successfully updated |
| 400 | Bad Request - Validation error or invalid input |
| 401 | Unauthorized - Invalid administrator credentials |
| 403 | Forbidden - Access denied |
| 404 | Not Found - User not found |
| 500 | Internal Server Error |
Response parameters:
| Parameter | Type | Description |
|---|---|---|
| successUsers | array of objects | List of users whose passwords were successfully updated. Each object includes details like the user's email (string) and username (string). |
| status | string | Indicates the status of the operation. It can reflect standard HTTP-like status codes and messages (for example, "200 OK" for a successful operation). |
| failedUsers | array of objects | List of users whose password updates failed. Each object in the array includes details such as the user's email (string) and username (string). |
| errorDetails | object | Contains additional error information if any issues occurred during the operation. Each property key is an identifier and its corresponding value is an error message. |
Response example success 200:
{
"successUsers": [
{
"username": "algotest"
}
],
"status": "OK"
}
Response example failure 400:
{
"failedUsers": [
{
"username": "algotest"
}
],
"errorDetails": {
"username": "algotest"
},
"status": "Bad Request"
}