update_user
Change Nextcloud user account fields in one call: display name, email, password, quota, language, manager, groups, and subadmin groups. Only supplied fields change; invalid fields reject all changes.
Instructions
Change several fields of a user account in one call. Needs Nextcloud 34 or newer.
Only the fields you pass are changed. Nextcloud validates all of them first and applies none if one fails; the error then names each rejected field. A few requests are skipped without an error, so compare the returned "groups" and "subadmin" with what you asked for: a sub-admin cannot take the user out of groups they do not administer, only full admins can add someone to "admin", and nobody can be made sub-admin of "admin".
Changing another user needs admin rights, or sub-admin rights over one of their groups; sub-admin groups need admin rights. Any user can change their own display name (if the instance allows it), email, language and password. Nextcloud only accepts this call from admins and sub-admins, though, so for a regular user's own account the fields are set one by one instead, and a rejected field then no longer undoes the ones set before it.
After changing your own password, the old one stops working, including for this server if it logs in with it; app passwords keep working.
Args: user_id: The user to change. Example: "john.doe" display_name: New display name. An empty string resets it to the user ID. email: New primary email address. An empty string removes it. password: New password. Must satisfy the instance's password policy. Needs the destructive permission level, since the old password is gone afterwards. quota: Storage quota, e.g. "5 GB", "500 MB", a byte count, "none" (unlimited) or "default". language: Language code, e.g. "en", "de", "fr". manager: User ID of the user's manager (Nextcloud does not check that it exists). An empty string removes it. groups: The complete list of group IDs the user should be in: groups missing from it are left, new ones joined, and [] leaves every group. Get the current ones with get_user and IDs with list_groups. Needs the destructive permission level, since it can remove memberships. Taking your own account out of "admin" this way is refused. subadmin_groups: The complete list of groups the user should administer as a sub-admin; [] removes all. Needs the destructive permission level.
Returns: JSON with the user's details after the change, as get_user returns them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | |||
| quota | No | ||
| groups | No | ||
| manager | No | ||
| user_id | Yes | ||
| language | No | ||
| password | No | ||
| display_name | No | ||
| subadmin_groups | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |