Skip to main content
Skip table of contents

Creating a DHCP pool

Creating a DHCP pool

Creating a DHCP pool within a group

POST /api/admin/v1/dhcp-subnets

Method parameters

ipv4 network, network


integer mask, subnet mask


string relay_list, relay IP addresses


ipv4 option_routers, router address


array pools, array of subnets

object array

ipv4 pools. REQUIRED, .end_address end IP


ipv4 pools. REQUIRED, .end_address end IP


integer dhcp_subnet_group_id, ID of the DHCP pool group in which the DHCP pool should be created

200 OK

Successful response

JSON
{
    "id": 1807,
    "subnet": "192.168.204.0/24",
    "relay": "[\"192.168.204.1\"]",
    "option_routers": "192.168.204.1",
    "pools": [
        {
            "id": 1862,
            "start_address": "192.168.204.240",
            "end_address": "192.168.204.253"
        }
    ],
    "dhcp_subnet_group": {
        "id": 65,
        "title": "Group"
    }
}

401 Unauthorized

Authorization token is not provided or is invalid. Obtaining a token

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/dhcp-subnets' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "network": "ipv4",
    "mask": "integer",
    "relay_list": "string",
    "option_routers": "ipv4",
    "pools": {
        "": "ipv4"
    },
    "pools.": "void",
    "dhcp_subnet_group_id": "integer"
}'
PHP
PHP
$data = array (
  'network' => 'ipv4',
  'mask' => 'integer',
  'relay_list' => 'string',
  'option_routers' => 'ipv4',
  'pools' => 
  array (
    '' => 'ipv4',
  ),
  'pools.' => 'void',
  'dhcp_subnet_group_id' => 'integer',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/dhcp-subnets', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.