Docker Hub Network API

Networks are user-defined networks that containers can be attached to. See the networking documentation for more information.

GitHub OpenAPI

Operations 7

GET /networks List networks #
GET /networks/{id} Inspect a network #
DELETE /networks/{id} Remove a network #
POST /networks/create Create a network #
POST /networks/{id}/connect Connect a container to a network #
POST /networks/{id}/disconnect Disconnect a container from a network #
POST /networks/prune Delete unused networks #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/docker-hub:docker-hub-network-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

docker-hub-network-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Docker Engine Network API
  version: '1.33'
  x-logo:
    url: https://docs.docker.com/images/logo-docker-main.png
  description: 'The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.


    Most of the client''s commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.


    # Errors


    The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:


    ```

    {

    "message": "page not found"

    }

    ```


    # Versioning


    The API is usually changed in each release of Docker, so API calls are versioned to ensure that clients don''t break.


    For Docker Engine 17.09, the API version is 1.32. To lock to this version, you prefix the URL with `/v1.32`. For example, calling `/info` is the same as calling `/v1.32/info`.


    Engine releases in the near future should support this version of the API, so your client will continue to work even if it is talking to a newer Engine.


    In previous versions of Docker, it was possible to access the API without providing a version. This behaviour is now deprecated will be removed in a future version of Docker.


    The API uses an open schema model, which means server may add extra properties to responses. Likewise, the server will ignore any extra query parameters and request body properties. When you write clients, you need to ignore additional properties in responses to ensure they do not break when talking to newer Docker daemons.


    This documentation is for version 1.33 of the API. Use this table to find documentation for previous versions of the API:


    Docker version | API version | Changes

    ----------------|-------------|---------

    17.09.x | 1.31 | API changes

    17.07.x | 1.31 | API changes

    17.06.x | 1.30 | API changes

    17.05.x | 1.29 | API changes

    17.04.x | 1.28 | API changes

    17.03.1 | 1.27 | API changes

    1.13.1 & 17.03.0 | 1.26 | API changes

    1.13.0 | 1.25 | API changes

    1.12.x | 1.24 | API changes

    1.11.x | 1.23 | API changes

    1.10.x | 1.22 | API changes

    1.9.x | 1.21 | API changes

    1.8.x | 1.20 | API changes

    1.7.x | 1.19 | API changes

    1.6.x | 1.18 | API changes


    # Authentication


    Authentication for registries is handled client side. The client has to send authentication details to various endpoints that need to communicate with registries, such as `POST /images/(name)/push`. These are sent as `X-Registry-Auth` header as a Base64 encoded (JSON) string with the following structure:


    ```

    {

    "username": "string",

    "password": "string",

    "email": "string",

    "serveraddress": "string"

    }

    ```


    The `serveraddress` is a domain/IP without a protocol. Throughout this structure, double quotes are required.


    If you have already got an identity token from the `/auth` endpoint, you can just pass this instead of credentials:


    ```

    {

    "identitytoken": "9cbaf023786cd7..."

    }

    ```'
servers:
- url: /v1.33
tags:
- name: Network
  x-displayName: Networks
  description: Networks are user-defined networks that containers can be attached to. See the networking documentation for more information.
paths:
  /networks:
    get:
      summary: List networks
      description: 'Returns a list of networks. For details on the format, see the network inspect endpoint.


        Note that it uses a different, smaller representation of a network than inspecting a single network. For example,

        the list of containers attached to the network is not propagated in API versions 1.28 and up.'
      operationId: NetworkList
      responses:
        200:
          description: No error
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Network'
              example:
              - Name: bridge
                Id: f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566
                Created: '2016-10-19T06:21:00.416543526Z'
                Scope: local
                Driver: bridge
                EnableIPv6: false
                Internal: false
                Attachable: false
                Ingress: false
                IPAM:
                  Driver: default
                  Config:
                  - Subnet: 172.17.0.0/16
                Options:
                  com.docker.network.bridge.default_bridge: 'true'
                  com.docker.network.bridge.enable_icc: 'true'
                  com.docker.network.bridge.enable_ip_masquerade: 'true'
                  com.docker.network.bridge.host_binding_ipv4: 0.0.0.0
                  com.docker.network.bridge.name: docker0
                  com.docker.network.driver.mtu: '1500'
              - Name: none
                Id: e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794
                Created: '0001-01-01T00:00:00Z'
                Scope: local
                Driver: 'null'
                EnableIPv6: false
                Internal: false
                Attachable: false
                Ingress: false
                IPAM:
                  Driver: default
                  Config: []
                Containers: {}
                Options: {}
              - Name: host
                Id: 13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e
                Created: '0001-01-01T00:00:00Z'
                Scope: local
                Driver: host
                EnableIPv6: false
                Internal: false
                Attachable: false
                Ingress: false
                IPAM:
                  Driver: default
                  Config: []
                Containers: {}
                Options: {}
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: filters
        in: query
        description: 'JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters:


          - `driver=<driver-name>` Matches a network''s driver.

          - `id=<network-id>` Matches all or part of a network ID.

          - `label=<key>` or `label=<key>=<value>` of a network label.

          - `name=<network-name>` Matches all or part of a network name.

          - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`).

          - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks.

          '
        schema:
          type: string
      tags:
      - Network
  /networks/{id}:
    get:
      summary: Inspect a network
      operationId: NetworkInspect
      responses:
        200:
          description: No error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Network'
        404:
          description: Network not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: id
        in: path
        description: Network ID or name
        required: true
        schema:
          type: string
      - name: verbose
        in: query
        description: Detailed inspect output for troubleshooting
        schema:
          type: boolean
          default: false
      - name: scope
        in: query
        description: Filter the network by scope (swarm, global, or local)
        schema:
          type: string
      tags:
      - Network
    delete:
      summary: Remove a network
      operationId: NetworkDelete
      responses:
        204:
          description: No error
        403:
          description: operation not supported for pre-defined networks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: no such network
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: id
        in: path
        description: Network ID or name
        required: true
        schema:
          type: string
      tags:
      - Network
  /networks/create:
    post:
      summary: Create a network
      operationId: NetworkCreate
      responses:
        201:
          description: No error
          content:
            application/json:
              schema:
                type: object
                properties:
                  Id:
                    description: The ID of the created network.
                    type: string
                  Warning:
                    type: string
                example:
                  Id: 22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30
                  Warning: ''
        403:
          description: operation not supported for pre-defined networks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: plugin not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Network
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - Name
              properties:
                Name:
                  description: The network's name.
                  type: string
                CheckDuplicate:
                  description: Check for networks with duplicate names. Since Network is primarily keyed based on a random ID and not on the name, and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, there is no guaranteed way to check for duplicates. CheckDuplicate is there to provide a best effort checking of any networks which has the same name but it is not guaranteed to catch all name collisions.
                  type: boolean
                Driver:
                  description: Name of the network driver plugin to use.
                  type: string
                  default: bridge
                Internal:
                  description: Restrict external access to the network.
                  type: boolean
                Attachable:
                  description: Globally scoped network is manually attachable by regular containers from workers in swarm mode.
                  type: boolean
                Ingress:
                  description: Ingress network is the network which provides the routing-mesh in swarm mode.
                  type: boolean
                IPAM:
                  description: Optional custom IP scheme for the network.
                  $ref: '#/components/schemas/IPAM'
                EnableIPv6:
                  description: Enable IPv6 on the network.
                  type: boolean
                Options:
                  description: Network specific options to be used by the drivers.
                  type: object
                  additionalProperties:
                    type: string
                Labels:
                  description: User-defined key/value metadata.
                  type: object
                  additionalProperties:
                    type: string
              example:
                Name: isolated_nw
                CheckDuplicate: false
                Driver: bridge
                EnableIPv6: true
                IPAM:
                  Driver: default
                  Config:
                  - Subnet: 172.20.0.0/16
                    IPRange: 172.20.10.0/24
                    Gateway: 172.20.10.11
                  - Subnet: 2001:db8:abcd::/64
                    Gateway: 2001:db8:abcd::1011
                  Options:
                    foo: bar
                Internal: true
                Attachable: false
                Ingress: false
                Options:
                  com.docker.network.bridge.default_bridge: 'true'
                  com.docker.network.bridge.enable_icc: 'true'
                  com.docker.network.bridge.enable_ip_masquerade: 'true'
                  com.docker.network.bridge.host_binding_ipv4: 0.0.0.0
                  com.docker.network.bridge.name: docker0
                  com.docker.network.driver.mtu: '1500'
                Labels:
                  com.example.some-label: some-value
                  com.example.some-other-label: some-other-value
        description: Network configuration
        required: true
  /networks/{id}/connect:
    post:
      summary: Connect a container to a network
      operationId: NetworkConnect
      responses:
        200:
          description: No error
        403:
          description: Operation not supported for swarm scoped networks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Network or container not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: id
        in: path
        description: Network ID or name
        required: true
        schema:
          type: string
      tags:
      - Network
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: object
              properties:
                Container:
                  type: string
                  description: The ID or name of the container to connect to the network.
                EndpointConfig:
                  $ref: '#/components/schemas/EndpointSettings'
              example:
                Container: 3613f73ba0e4
                EndpointConfig:
                  IPAMConfig:
                    IPv4Address: 172.24.56.89
                    IPv6Address: 2001:db8::5689
        required: true
  /networks/{id}/disconnect:
    post:
      summary: Disconnect a container from a network
      operationId: NetworkDisconnect
      responses:
        200:
          description: No error
        403:
          description: Operation not supported for swarm scoped networks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Network or container not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
            text/plain:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      parameters:
      - name: id
        in: path
        description: Network ID or name
        required: true
        schema:
          type: string
      tags:
      - Network
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Container:
                  type: string
                  description: The ID or name of the container to disconnect from the network.
                Force:
                  type: boolean
                  description: Force the container to disconnect from the network.
        required: true
  /networks/prune:
    post:
      summary: Delete unused networks
      operationId: NetworkPrune
      parameters:
      - name: filters
        in: query
        description: 'Filters to process on the prune list, encoded as JSON (a `map[string][]string`).


          Available filters:

          - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.

          - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels.

          '
        schema:
          type: string
      responses:
        200:
          description: No error
          content:
            application/json:
              schema:
                type: object
                properties:
                  NetworksDeleted:
                    description: Networks that were deleted
                    type: array
                    items:
                      type: string
        500:
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - Network
components:
  schemas:
    NetworkContainer:
      type: object
      properties:
        Name:
          type: string
        EndpointID:
          type: string
        MacAddress:
          type: string
        IPv4Address:
          type: string
        IPv6Address:
          type: string
    EndpointSettings:
      description: Configuration for a network endpoint.
      type: object
      properties:
        IPAMConfig:
          $ref: '#/components/schemas/EndpointIPAMConfig'
        Links:
          type: array
          items:
            type: string
          example:
          - container_1
          - container_2
        Aliases:
          type: array
          items:
            type: string
          example:
          - server_x
          - server_y
        NetworkID:
          description: 'Unique ID of the network.

            '
          type: string
          example: 08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a
        EndpointID:
          description: 'Unique ID for the service endpoint in a Sandbox.

            '
          type: string
          example: b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b
        Gateway:
          description: 'Gateway address for this network.

            '
          type: string
          example: 172.17.0.1
        IPAddress:
          description: 'IPv4 address.

            '
          type: string
          example: 172.17.0.4
        IPPrefixLen:
          description: 'Mask length of the IPv4 address.

            '
          type: integer
          example: 16
        IPv6Gateway:
          description: 'IPv6 gateway address.

            '
          type: string
          example: 2001:db8:2::100
        GlobalIPv6Address:
          description: 'Global IPv6 address.

            '
          type: string
          example: 2001:db8::5689
        GlobalIPv6PrefixLen:
          description: 'Mask length of the global IPv6 address.

            '
          type: integer
          format: int64
          example: 64
        MacAddress:
          description: 'MAC address for the endpoint on this network.

            '
          type: string
          example: 02:42:ac:11:00:04
        DriverOpts:
          description: 'DriverOpts is a mapping of driver options and values. These options

            are passed directly to the driver and are driver specific.

            '
          type:
          - object
          - 'null'
          additionalProperties:
            type: string
          example:
            com.example.some-label: some-value
            com.example.some-other-label: some-other-value
    IPAM:
      type: object
      properties:
        Driver:
          description: Name of the IPAM driver to use.
          type: string
          default: default
        Config:
          description: 'List of IPAM configuration options, specified as a map: `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}`'
          type: array
          items:
            type: object
            additionalProperties:
              type: string
        Options:
          description: Driver-specific options, specified as a map.
          type: array
          items:
            type: object
            additionalProperties:
              type: string
    ErrorResponse:
      description: Represents an error.
      type: object
      required:
      - message
      properties:
        message:
          description: The error message.
          type: string
      example:
        message: Something went wrong.
    EndpointIPAMConfig:
      description: 'EndpointIPAMConfig represents an endpoint''s IPAM configuration.

        '
      type:
      - object
      - 'null'
      properties:
        IPv4Address:
          type: string
          example: 172.20.30.33
        IPv6Address:
          type: string
          example: 2001:db8:abcd::3033
        LinkLocalIPs:
          type: array
          items:
            type: string
          example:
          - 169.254.34.68
          - fe80::3468
    Network:
      type: object
      properties:
        Name:
          type: string
        Id:
          type: string
        Created:
          type: string
          format: dateTime
        Scope:
          type: string
        Driver:
          type: string
        EnableIPv6:
          type: boolean
        IPAM:
          $ref: '#/components/schemas/IPAM'
        Internal:
          type: boolean
        Attachable:
          type: boolean
        Ingress:
          type: boolean
        Containers:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/NetworkContainer'
        Options:
          type: object
          additionalProperties:
            type: string
        Labels:
          type: object
          additionalProperties:
            type: string
      example:
        Name: net01
        Id: 7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99
        Created: '2016-10-19T04:33:30.360899459Z'
        Scope: local
        Driver: bridge
        EnableIPv6: false
        IPAM:
          Driver: default
          Config:
          - Subnet: 172.19.0.0/16
            Gateway: 172.19.0.1
          Options:
            foo: bar
        Internal: false
        Attachable: false
        Ingress: false
        Containers:
          19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c:
            Name: test
            EndpointID: 628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a
            MacAddress: 02:42:ac:13:00:02
            IPv4Address: 172.19.0.2/16
            IPv6Address: ''
        Options:
          com.docker.network.bridge.default_bridge: 'true'
          com.docker.network.bridge.enable_icc: 'true'
          com.docker.network.bridge.enable_ip_masquerade: 'true'
          com.docker.network.bridge.host_binding_ipv4: 0.0.0.0
          com.docker.network.bridge.name: docker0
          com.docker.network.driver.mtu: '1500'
        Labels:
          com.example.some-label: some-value
          com.example.some-other-label: some-other-value