Skip to content

Get a private network

GET /api/v2/private-networks/{id}

Get one private network with its subnets and the VPSes attached to it. Each subnet shows its range, VLAN tag, gateway and status. A VPS counts as attached when it has an interface in one of the subnets. unusedAddressReservationCount counts private addresses that are reserved but not used by any VPS.

Authentication: An API key with the scope read:network. About keys and scopes

Request

Path parameters

idstringrequired
The private network ID (pnet_…).

Example

GET /api/v2/private-networks/{id}
curl "https://cloud.hostup.se/api/v2/private-networks/pnet_01hxa3b4c5d6e7f8g9h0j1k2m3" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The private network.

Response 200
{
"id": "pnet_01hxa3b4c5d6e7f8g9h0j1k2m3",
"name": "production-private",
"parentCidr": "10.201.40.0/21",
"region": "dc1r28",
"status": "active",
"subnetCount": 1,
"attachedVpsCount": 1,
"subnets": [
{
"id": "subnet_01hxa3b4c5d6e7f8g9h0j1k2m3",
"subnetCidr": "10.201.40.0/24",
"vlanTag": 214,
"gateway": "10.201.40.1",
"status": "active"
}
],
"attachedVps": [
{
"id": "vps_01hxa3b4c5d6e7f8g9h0j1k2m3",
"name": "web-01",
"primaryIp": "192.0.2.10"
}
],
"actions": {
"canAddSubnet": {
"allowed": false,
"reason": "Private network limit reached."
}
},
"createdAt": "2026-04-27T12:00:00.000Z",
"unusedAddressReservationCount": 0
}
Response fields
idstring
The private network ID (pnet_…).
namestring
Name given when the network was created. parentCidr when it has none.
parentCidrstring
The network’s IPv4 range, a /21. Each subnet is a /24 inside it.
regionstringdeprecated
Deprecated. Location slug of the network. Private networks span the whole Hostup network. You can ignore it.
statusstring
provisioning: being set up on the network. active: ready. deprovisioning: being removed. retired: no longer in use. unknown: the state could not be read. One of provisioning, active, deprovisioning, retired, unknown.
subnetCountinteger
Number of subnets that are not retired.
attachedVpsCountinteger
Number of VPSes with an interface in one of the subnets.
subnetsarray of object
Every subnet in the network, retired ones included.
idstring
The subnet ID (subnet_…).
subnetCidrstring
The subnet’s range, a /24.
vlanTaginteger or null
VLAN tag of the subnet. null until one is assigned.
gatewaystring or null
First usable address in the subnet. null when not known yet.
statusstring
provisioning: being set up on the network. active: ready. deprovisioning: being removed. retired: no longer in use. unknown: the state could not be read. One of provisioning, active, deprovisioning, retired, unknown.
attachedVpsarray of object
VPSes with an interface in one of the subnets.
idstring
The VPS ID (vps_…).
namestring
Hostname or label of the VPS.
primaryIpstring or null
Main public IPv4 address of the VPS. null when not known.
actionsobject
canAddSubnetobject
Whether POST /api/v2/private-networks can add another subnet now. allowed is false with a reason when the subnet quota is full.
allowedboolean
reasonstring or null
Why no subnet can be added. null when allowed is true.
createdAtstring or null
When the network was created.
unusedAddressReservationCountinteger
Private addresses reserved in the network that no VPS interface uses. Free them with POST /api/v2/private-networks/{id}/actions/cleanup-unused-reservations.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404No private network with this ID in your account. code is private_network_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.