[comment]: # ({07099686-07099686})
# proxy.create

[comment]: # ({/07099686-07099686})

[comment]: # ({31fbd044-e0abed38})
### Description

`object proxy.create(object/array proxies)`

This method allows to create new proxies.

::: noteclassic
This method is only available to *Super admin* user type. Permissions to call the method can be revoked in user role
settings. See [User roles](/manual/web_interface/frontend_sections/users/user_roles) for more information.
:::

[comment]: # ({/31fbd044-e0abed38})

[comment]: # ({a829480f-fc26a415})
### Parameters

`(object/array)` Proxies to create.

Additionally to the [standard proxy properties](object#proxy), the method accepts the following parameters.

|Parameter|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|hosts|array|[Hosts](/manual/api/reference/host/object) to be monitored by the proxy.<br>If a host is already monitored by a different proxy, it will be reassigned to the current proxy.<br><br>The hosts must have only the `hostid` property defined.|

[comment]: # ({/a829480f-fc26a415})

[comment]: # ({41544960-606a1465})
### Return values

`(object)` Returns an object containing the IDs of the created proxies under the `proxyids` property. The order of the
returned IDs matches the order of the passed proxies.

[comment]: # ({/41544960-606a1465})

[comment]: # ({b41637d2-b41637d2})
### Examples

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({764b3ef4-86fb9238})
#### Create an active proxy

Create an action proxy "Active proxy" and assign a host to be monitored by it.

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxy.create",
    "params": {
        "name": "Active proxy",
        "operating_mode": "0",
        "hosts": [
            {
                "hostid": "10279"
            }
        ]
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "proxyids": [
            "10280"
        ]
    },
    "id": 1
}
```

[comment]: # ({/764b3ef4-86fb9238})

[comment]: # ({d78d12a8-8e1098f9})
#### Create a passive proxy

Create a passive proxy "Passive proxy" and assign two hosts to be monitored by it.

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxy.create",
    "params": {
        "name": "Passive proxy",
        "operating_mode": "1",
        "address": "127.0.0.1",
        "port": "10051",
        "hosts": [
            {
                "hostid": "10192"
            },
            {
                "hostid": "10139"
            }
        ]
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "proxyids": [
            "10284"
        ]
    },
    "id": 1
}
```

[comment]: # ({/d78d12a8-8e1098f9})

[comment]: # ({592f2c7c-10f6235e})
#### Creating a proxy and adding it to a proxy group

Create an active proxy "Active proxy" and add it to proxy group with ID "1".

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxy.create",
    "params": {
        "name": "Active proxy",
        "proxy_groupid": "1",
        "operating_mode": "0"
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "proxyids": [
            "5"
        ]
    },
    "id": 1
}
```

[comment]: # ({/592f2c7c-10f6235e})

[comment]: # ({dcdf3e50-530f2dc3})
#### Creating a proxy with certificate-based encryption

Create an active proxy with certificate-based [encryption](/manual/encryption/using_certificates#zabbix-proxy). The proxy is configured to monitor host "10785".

[Request](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "proxy.create",
    "params": {
        "name": "Active proxy",
        "operating_mode": "0",
        "hosts": [
            {
                "hostid": "10785"
            }
        ],
        "tls_accept": "4",
        "tls_issuer": "CN=Signing CA,OU=Development group,O=Zabbix SIA,DC=zabbix,DC=com",
        "tls_subject": "CN=Zabbix server,OU=Development group,O=Zabbix SIA,DC=zabbix,DC=com"
    },
    "id": 1
}
```

Response:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "proxyids": [
            "2"
        ]
    },
    "id": 1
}
```

[comment]: # ({/dcdf3e50-530f2dc3})

[comment]: # ({ffb6ee14-273e0fd8})
### See also

-   [Host](/manual/api/reference/host/object#host)
-   [Proxy group](/manual/api/reference/proxygroup/object#proxy-group)

[comment]: # ({/ffb6ee14-273e0fd8})

[comment]: # ({453e4545-453e4545})
### Source

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

[comment]: # ({/453e4545-453e4545})
