Skip to main content
POST
/
virtual_networks
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os


with Latitudesh(
    bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:

    res = latitudesh.private_networks.create(data={
        "type": latitudesh_python_sdk.CreateVirtualNetworkPrivateNetworksType.VIRTUAL_NETWORK,
        "attributes": {
            "description": "São Paulo VLAN",
            "site": latitudesh_python_sdk.CreateVirtualNetworkPrivateNetworksSite.MIA,
            "project": "enormous-paper-clock",
        },
    })

    # Handle response
    print(res)
{
  "data": {
    "id": "vlan_3YjJOLQjdvZ87",
    "type": "virtual_networks",
    "attributes": {
      "tags": [],
      "vid": 2000,
      "name": "MIA-2000",
      "description": "São Paulo VLAN",
      "site": "MIA",
      "created_at": "2025-07-16T18:37:16+00:00"
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

data
object
meta
object
I