Skip to main content

Update Password

Sets a new password for a specified user account.

Endpoint

POST /v2/users/password
note

This is an administrative operation that requires NetworkAdmin or higher AuthLevel. Use Generate Password to create a compliant random password before calling this endpoint if needed.

Request Body

FieldTypeRequiredConstraintsDescription
userIdintegerYesMust be an existing userID of the user whose password to change
newPasswordstringYesSee password pattern belowThe new password to set

Password pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).+$

Must contain at least one lowercase letter, one uppercase letter, one digit, and one special character.

{
"userId": 1042,
"newPassword": "NewPassw0rd!"
}

Response

Returns a boolean indicating whether the password was successfully updated.

{
"success": true,
"data": true
}

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/users/password" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "userId": 1042, "newPassword": "NewPassw0rd!" }'

See Also