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.

userdirectory.create

Description

object userdirectory.create(object/array userDirectory)

This method allows to create new user directories.

This method is only available to Super admin user type.

Parameters

(object/array) User directories to create.

The method accepts user directories with the standard user directory properties.

Return values

(object) Returns an object containing the IDs of the created user directories under the userdirectoryids property. The order of the returned IDs matches the order of the passed user directories.

Examples

Creating a user directory

Create a user directory to authenticate users with StartTLS over LDAP.

Request:

{
           "jsonrpc": "2.0",
           "method": "userdirectory.create",
           "params": {
               "name": "LDAP API server #1",
               "host": "ldap://local.ldap",
               "port": "389",
               "base_dn": "ou=Users,dc=example,dc=org",
               "bind_dn": "cn=ldap_search,dc=example,dc=org",
               "bind_password": "ldapsecretpassword",
               "search_attribute": "uid",
               "start_tls": "1"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "userdirectoryids": [
                   "2"
               ]
           },
           "id": 1
       }

Source

CUserDirectory::create() in ui/include/classes/api/services/CUserDirectory.php.