ByCloud Docs
GuidesCLIAPISDK
post/v1/subnets

Create subnet

Create a new subnet in a network

Request Body

required

Content-Type: application/json

name

stringoptional

description

stringoptional

network_id

string<uuid>required

ip_version

integerrequired

Enum: 4, 6

cidr

stringrequired

gateway_ip

stringoptional

nullable

Gateway IP (auto-assigned if omitted, null to disable)

dns_nameservers

arrayoptional

allocation_pools

arrayoptional

host_routes

arrayoptional

enable_dhcp

booleanoptional

Default: true

ipv6_ra_mode

stringoptional

Enum: "slaac", "dhcpv6-stateful", "dhcpv6-stateless"

ipv6_address_mode

stringoptional

Enum: "slaac", "dhcpv6-stateful", "dhcpv6-stateless"

tags

arrayoptional

Responses

201

Subnet created

Content-Type: application/json

subnet

objectoptional
400

Invalid request parameters

Content-Type: application/json

error

objectrequired
401

Authentication required or token invalid

Content-Type: application/json

error

objectrequired
404

Network not found

Content-Type: application/json

error

objectrequired
409

Resource conflict (e.g., already exists, invalid state)

Content-Type: application/json

error

objectrequired
500

Internal server error

Content-Type: application/json

error

objectrequired
curl -X POST "https://api.spo1.mycloud.com/v1/subnets" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "private-subnet",
"description": "string",
"network_id": "550e8400-e29b-41d4-a716-446655440000",
"ip_version": 4,
"cidr": "192.168.1.0/24",
"gateway_ip": "string",
"dns_nameservers": [
"string"
],
"allocation_pools": [
{
"start": "192.168.1.100",
"end": "192.168.1.200"
}
],
"host_routes": [
{
"destination": "10.0.0.0/8",
"nexthop": "192.168.1.1"
}
],
"enable_dhcp": true,
"ipv6_ra_mode": "slaac",
"ipv6_address_mode": "slaac",
"tags": [
"web",
"frontend"
]
}'