Skip to main content
GET
/
api
/
networks
curl -X GET 'https://your-dockhand.com/api/networks?env=1' \
  -H 'Cookie: session=your-session-cookie'
{
  "error": "Permission denied"
}

Overview

Returns a list of all Docker networks in the specified environment. This endpoint requires an environment ID to be provided as a query parameter.

Authentication

This endpoint requires authentication via cookies. The user must have the networks:view permission for the specified environment.

Query Parameters

env
integer
required
The environment ID to list networks from. Required parameter.

Response

networks
array
Array of network objects

Error Responses

{
  "error": "Permission denied"
}
curl -X GET 'https://your-dockhand.com/api/networks?env=1' \
  -H 'Cookie: session=your-session-cookie'
[
  {
    "Id": "c7b9a6e5f8d3",
    "Name": "app-network",
    "Driver": "bridge",
    "Scope": "local",
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Config": [
        {
          "Subnet": "172.18.0.0/16",
          "Gateway": "172.18.0.1",
          "IPRange": "172.18.5.0/24"
        }
      ],
      "Options": {}
    },
    "Containers": {
      "a1b2c3d4e5f6": {
        "Name": "web-server",
        "IPv4Address": "172.18.5.10/16",
        "IPv6Address": "",
        "MacAddress": "02:42:ac:12:05:0a"
      }
    },
    "Options": {
      "com.docker.network.bridge.name": "br-app",
      "com.docker.network.bridge.enable_icc": "true"
    },
    "Labels": {
      "app": "myapp",
      "environment": "production"
    }
  },
  {
    "Id": "bridge",
    "Name": "bridge",
    "Driver": "bridge",
    "Scope": "local",
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Config": [
        {
          "Subnet": "172.17.0.0/16",
          "Gateway": "172.17.0.1"
        }
      ],
      "Options": null
    },
    "Containers": {},
    "Options": {},
    "Labels": {}
  }
]

Notes

  • Returns an empty array if no environment ID is provided
  • Built-in networks (bridge, host, none) are always included in the response
  • Requires authentication to be enabled and the user to have proper permissions
  • Enterprise users must have access to the specified environment
  • Network data is retrieved directly from the Docker API

Build docs developers (and LLMs) love