Skip to main content

Set an account's password

POST 

/users/:userId/password

Required role: admin. Only an account or token with the admin role can call this operation.

Example request
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/users/{userId}/password"

Writes the UI credential hash and the Samba passdb entry together: if the Samba write fails, the UI credential is rolled back to its previous value, and nothing is left updated on only one side. This is the ordinary admin-driven password action on /users — distinct from resetUserPassword, which is root-only recovery for a locked-out account over the Unix socket and never touches the Samba passdb.

Request​

Responses​

Password set on both the UI credential and the Samba account.