create_network
Create a VLAN on a UniFi site with network_config specifying VLAN ID, DHCP, subnet, and access policies to segment network traffic.
Instructions
Create a new network/VLAN on a site.
host: console name, ID, or composite ID (MAC:numericId format). site: site name or ID.
Validated locally before the request (a missing field raises ValueError naming it):
management — the discriminator the controller validates first. The rest of the
required schema is management-mode-specific and enforced by the controller.
network_config: for management='GATEWAY' the controller also requires (verified live):
name (str, max 32 chars)
vlanId (int, 1-4094)
enabled (bool)
internetAccessEnabled (bool)
isolationEnabled (bool)
cellularBackupEnabled (bool)
ipV4Configuration: {'dhcpMode': 'SERVER'|'RELAY'|'NONE', 'subnet': str CIDR, 'hostAddress': str, 'netmask': str, 'broadcastAddress': str, 'dhcpRangeStart': str, 'dhcpRangeStop': str} Optional: zoneId (str, zone UUID from list_firewall_zones_proxy), mdnsForwardingEnabled (bool). Field names are camelCase; there is no 'purpose' field in the Network Integration API.
D12 auto-exclusion: UniFi silently adds every new network to the
excluded_networkconf_ids of ALL custom-tagged port profiles
(tagged_vlan_mgmt == 'custom'), blackholing the VLAN at the host uplink.
When that happens this response carries a warnings entry (code
D12_AUTO_EXCLUSION) naming each affected profile; run
allow_network_on_port_profile on each to restore tagging.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| site | Yes | ||
| network_config | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||