This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

user.update

Description

object user.update(object/array users)

This method allows to update existing users.

Parameters

(object/array) User properties to be updated.

The userid property must be defined for each user, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard user properties, the method accepts the following parameters.

Parameter Type Description
passwd string User's password.
usrgrps array User groups to replace existing user groups.

The user groups must have the usrgrpid property defined.

Return values

(object) Returns an object containing the IDs of the updated users under the userids property.

Examples

Renaming a user

Rename a user to John Doe.

Request:

{
           "jsonrpc": "2.0",
           "method": "user.update",
           "params": {
               "userid": "1",
               "name": "John",
               "surname": "Doe"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }
Copy
✔ Copied

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "userids": [
                   "1"
               ]
           },
           "id": 1
       }
Copy
✔ Copied

See also

Source

CUser::update() in frontends/php/include/classes/api/services/CUser.php.

To toggle search highlight, press Ctrl+Alt+H
Have an improvement suggestion for this page? Select the text that could be improved and press Ctrl+Enter to send it to the editors.