Podman networks API

Actions related to networks

Operations 9

DELETE /libpod/networks/{name} Remove a network #
POST /libpod/networks/{name}/connect Connect container to network #
POST /libpod/networks/{name}/disconnect Disconnect container from network #
GET /libpod/networks/{name}/exists Network exists #
GET /libpod/networks/{name}/json Inspect a network #
POST /libpod/networks/{name}/update Update existing podman network #
POST /libpod/networks/create Create network #
GET /libpod/networks/json List networks #
POST /libpod/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/podman-networks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

podman-networks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: podman@lists.podman.io
    name: Podman
    url: https://podman.io/community/
  description: 'This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible

    API and a Libpod API providing support for Podman’s unique features such as pods.


    To start the service and keep it running for 5,000 seconds (-t 0 runs forever):


    podman system service -t 5000 &


    You can then use cURL on the socket using requests documented below.


    NOTE: if you install the package podman-docker, it will create a symbolic

    link for /run/docker.sock to /run/podman/podman.sock


    NOTE: Some fields in the API response JSON are encoded as omitempty, which means that

    if said field has a zero value, they will not be encoded in the API response. This

    is a feature to help reduce the size of the JSON responses returned via the API.


    NOTE: Due to the limitations of [go-swagger](https://github.com/go-swagger/go-swagger),

    some field values that have a complex type show up as null in the docs as well as in the

    API responses. This is because the zero value for the field type is null. The field

    description in the docs will state what type the field is expected to be for such cases.


    See podman-system-service(1) for more information.


    Quick Examples:


    ''podman info''


    curl --unix-socket /run/podman/podman.sock http://d/v6.0.0/libpod/info


    ''podman pull quay.io/containers/podman''


    curl -XPOST --unix-socket /run/podman/podman.sock -v ''http://d/v6.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman''


    ''podman list images''


    curl --unix-socket /run/podman/podman.sock -v ''http://d/v6.0.0/libpod/images/json'' | jq'
  license:
    name: Apache-2.0
    url: https://opensource.org/licenses/Apache-2.0
  termsOfService: https://github.com/containers/podman/blob/913caaa9b1de2b63692c9bae15120208194c9eb3/LICENSE
  title: supports a RESTful API for the Libpod library artifacts Networks API
  version: 5.0.0
  x-logo:
  - url: https://raw.githubusercontent.com/containers/libpod/main/logo/podman-logo.png
  - altText: Podman logo
servers:
- url: http://podman.io/
- url: https://podman.io/
tags:
- description: Actions related to networks
  name: networks
paths:
  /libpod/networks/{name}:
    delete:
      description: Remove a configured network
      operationId: NetworkDeleteLibpod
      parameters:
      - description: the name of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      - description: remove containers associated with network
        in: query
        name: force
        schema:
          type: boolean
      responses:
        '200':
          $ref: '#/components/responses/networkRmResponse'
        '404':
          $ref: '#/components/responses/networkNotFound'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Remove a network
      tags:
      - networks
  /libpod/networks/{name}/connect:
    post:
      description: Connect a container to a network.
      operationId: NetworkConnectLibpod
      parameters:
      - description: the name of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
        '404':
          $ref: '#/components/responses/networkNotFound'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Connect container to network
      tags:
      - networks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/networkConnectRequestLibpod'
          application/x-tar:
            schema:
              $ref: '#/components/schemas/networkConnectRequestLibpod'
        description: attributes for connecting a container to a network
  /libpod/networks/{name}/disconnect:
    post:
      description: Disconnect a container from a network.
      operationId: NetworkDisconnectLibpod
      parameters:
      - description: the name of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
        '404':
          $ref: '#/components/responses/networkNotFound'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Disconnect container from network
      tags:
      - networks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/networkDisconnectRequest'
          application/x-tar:
            schema:
              $ref: '#/components/schemas/networkDisconnectRequest'
        description: attributes for disconnecting a container from a network
  /libpod/networks/{name}/exists:
    get:
      description: Check if network exists
      operationId: NetworkExistsLibpod
      parameters:
      - description: the name or ID of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '204':
          description: network exists
        '404':
          $ref: '#/components/responses/networkNotFound'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Network exists
      tags:
      - networks
  /libpod/networks/{name}/json:
    get:
      description: 'Display configuration for a network.

        '
      operationId: NetworkInspectLibpod
      parameters:
      - description: the name of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/networkInspectResponse'
        '404':
          $ref: '#/components/responses/networkNotFound'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Inspect a network
      tags:
      - networks
  /libpod/networks/{name}/update:
    post:
      description: Update existing podman network
      operationId: NetworkUpdateLibpod
      parameters:
      - description: the name or ID of the network
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
        '400':
          $ref: '#/components/responses/badParamError'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Update existing podman network
      tags:
      - networks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/networkUpdateRequestLibpod'
          application/x-tar:
            schema:
              $ref: '#/components/schemas/networkUpdateRequestLibpod'
        description: attributes for updating a netavark network
  /libpod/networks/create:
    post:
      description: Create a new network configuration
      operationId: NetworkCreateLibpod
      parameters:
      - description: Ignore the request if a network with the same name already exists.
        in: query
        name: ignoreIfExists
        schema:
          type: boolean
          default: false
      responses:
        '200':
          $ref: '#/components/responses/networkCreateResponse'
        '400':
          $ref: '#/components/responses/badParamError'
        '409':
          $ref: '#/components/responses/conflictError'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Create network
      tags:
      - networks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/networkCreateLibpod'
          application/x-tar:
            schema:
              $ref: '#/components/schemas/networkCreateLibpod'
        description: attributes for creating a network
  /libpod/networks/json:
    get:
      description: "Display summary of network configurations.\n  - In a 200 response, all of the fields named Bytes are returned as a Base64 encoded string.\n"
      operationId: NetworkListLibpod
      parameters:
      - description: "JSON encoded value of the filters (a `map[string][]string`) to process on the network list. Available filters:\n  - `name=[name]` Matches network name (accepts regex).\n  - `id=[id]` Matches for full or partial ID.\n  - `driver=[driver]` Only bridge is supported.\n  - `label=[key]` or `label=[key=value]` Matches networks based on the presence of a label alone or a label and a value.\n  - `until=[timestamp]` Matches all networks that were created before the given timestamp.\n"
        in: query
        name: filters
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/networkListLibpod'
        '500':
          $ref: '#/components/responses/internalError'
      summary: List networks
      tags:
      - networks
  /libpod/networks/prune:
    post:
      description: Remove networks that do not have containers
      operationId: NetworkPruneLibpod
      parameters:
      - description: "Filters to process on the prune list, encoded as JSON (a `map[string][]string`).\nAvailable filters:\n  - `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.\n  - `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.\n"
        in: query
        name: filters
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/networkPruneResponse'
        '500':
          $ref: '#/components/responses/internalError'
      summary: Delete unused networks
      tags:
      - networks
components:
  schemas:
    LeaseRange:
      properties:
        end_ip:
          description: EndIP last IP in the subnet which should be used to assign ips.
          format: string
          type: string
          x-go-name: EndIP
          x-go-type: net.IP
        start_ip:
          description: StartIP first IP in the subnet which should be used to assign ips.
          format: string
          type: string
          x-go-name: StartIP
          x-go-type: net.IP
      title: LeaseRange contains the range where IP are leased.
      type: object
      x-go-package: go.podman.io/common/libnetwork/types
    networkUpdateRequestLibpod:
      $ref: '#/components/schemas/NetworkUpdateOptions'
      description: Network update
    NetworkPruneReport:
      description: 'NetworkPruneReport containers the name of network and an error

        associated in its pruning (removal)'
      properties:
        Error:
          type: string
          x-go-type: error
        Name:
          type: string
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/domain/entities/types
    NetworkInspectReport:
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/domain/entities
    RouteType:
      title: RouteType represents the type of a route.
      type: string
      x-go-package: go.podman.io/common/libnetwork/types
    Network:
      properties:
        created:
          description: Created contains the timestamp when this network was created.
          format: date-time
          type: string
          x-go-name: Created
        dns_enabled:
          description: 'DNSEnabled is whether name resolution is active for container on

            this Network. Only supported with the bridge driver.'
          type: boolean
          x-go-name: DNSEnabled
        driver:
          description: Driver for this Network, e.g. bridge, macvlan...
          type: string
          x-go-name: Driver
        id:
          description: ID of the Network.
          type: string
          x-go-name: ID
        internal:
          description: 'Internal is whether the Network should not have external routes

            to public or other Networks.'
          type: boolean
          x-go-name: Internal
        ipam_options:
          additionalProperties:
            type: string
          description: IPAMOptions contains options used for the ip assignment.
          type: object
          x-go-name: IPAMOptions
        ipv6_enabled:
          description: IPv6Enabled if set to true an ipv6 subnet should be created for this net.
          type: boolean
          x-go-name: IPv6Enabled
        labels:
          additionalProperties:
            type: string
          description: 'Labels is a set of key-value labels that have been applied to the

            Network.'
          type: object
          x-go-name: Labels
        name:
          description: Name of the Network.
          type: string
          x-go-name: Name
        network_dns_servers:
          description: 'List of custom DNS server for podman''s DNS resolver at network level,

            all the containers attached to this network will consider resolvers

            configured at network level.'
          items:
            type: string
          type: array
          x-go-name: NetworkDNSServers
        network_interface:
          description: NetworkInterface is the network interface name on the host.
          type: string
          x-go-name: NetworkInterface
        options:
          additionalProperties:
            type: string
          description: 'Options is a set of key-value options that have been applied to

            the Network.'
          type: object
          x-go-name: Options
        routes:
          description: Routes to use for this network.
          items:
            $ref: '#/components/schemas/Route'
          type: array
          x-go-name: Routes
        subnets:
          description: Subnets to use for this network.
          items:
            $ref: '#/components/schemas/Subnet'
          type: array
          x-go-name: Subnets
      title: Network describes the Network attributes.
      type: object
      x-go-package: go.podman.io/common/libnetwork/types
    networkCreateLibpod:
      description: Network create
      properties:
        created:
          description: Created contains the timestamp when this network was created.
          format: date-time
          type: string
          x-go-name: Created
        dns_enabled:
          description: 'DNSEnabled is whether name resolution is active for container on

            this Network. Only supported with the bridge driver.'
          type: boolean
          x-go-name: DNSEnabled
        driver:
          description: Driver for this Network, e.g. bridge, macvlan...
          type: string
          x-go-name: Driver
        id:
          description: ID of the Network.
          type: string
          x-go-name: ID
        internal:
          description: 'Internal is whether the Network should not have external routes

            to public or other Networks.'
          type: boolean
          x-go-name: Internal
        ipam_options:
          additionalProperties:
            type: string
          description: IPAMOptions contains options used for the ip assignment.
          type: object
          x-go-name: IPAMOptions
        ipv6_enabled:
          description: IPv6Enabled if set to true an ipv6 subnet should be created for this net.
          type: boolean
          x-go-name: IPv6Enabled
        labels:
          additionalProperties:
            type: string
          description: 'Labels is a set of key-value labels that have been applied to the

            Network.'
          type: object
          x-go-name: Labels
        name:
          description: Name of the Network.
          type: string
          x-go-name: Name
        network_dns_servers:
          description: 'List of custom DNS server for podman''s DNS resolver at network level,

            all the containers attached to this network will consider resolvers

            configured at network level.'
          items:
            type: string
          type: array
          x-go-name: NetworkDNSServers
        network_interface:
          description: NetworkInterface is the network interface name on the host.
          type: string
          x-go-name: NetworkInterface
        options:
          additionalProperties:
            type: string
          description: 'Options is a set of key-value options that have been applied to

            the Network.'
          type: object
          x-go-name: Options
        routes:
          description: Routes to use for this network.
          items:
            $ref: '#/components/schemas/Route'
          type: array
          x-go-name: Routes
        subnets:
          description: Subnets to use for this network.
          items:
            $ref: '#/components/schemas/Subnet'
          type: array
          x-go-name: Subnets
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/api/handlers/swagger
    NetworkRmReport:
      description: NetworkRmReport describes the results of network removal
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/domain/entities
    networkDisconnectRequest:
      $ref: '#/components/schemas/DisconnectRequest'
      description: Network disconnect
    DisconnectRequest:
      properties:
        Container:
          description: The ID or name of the container to disconnect from the network.
          example: 3613f73ba0e4
          type: string
        Force:
          description: Force the container to disconnect from the network.
          example: false
          type: boolean
      required:
      - Container
      title: DisconnectRequest NetworkDisconnectRequest represents the data to be used to disconnect a container from a network.
      type: object
      x-go-package: github.com/moby/moby/api/types/network
    NetworkConnectOptions:
      description: 'NetworkConnectOptions describes options for connecting

        a container to a network'
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/domain/entities
    ErrorModel:
      description: ErrorModel is used in remote connections with podman
      properties:
        cause:
          description: API root cause formatted for automated parsing
          example: API root cause
          type: string
          x-go-name: Because
        message:
          description: human error message, formatted for a human to read
          example: human error message
          type: string
          x-go-name: Message
        response:
          description: HTTP response code
          format: int64
          minimum: 400
          type: integer
          x-go-name: ResponseCode
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/errorhandling
    Route:
      properties:
        destination:
          description: Destination for this route in CIDR form.
          format: string
          type: string
          x-go-name: Destination
        gateway:
          description: Gateway IP for this route. Required for unicast routes, must be empty for blackhole/unreachable/prohibit.
          format: string
          type: string
          x-go-name: Gateway
          x-go-type: net.IP
        metric:
          description: Metric for this route. Optional.
          format: uint32
          type: integer
          x-go-name: Metric
        route_type:
          $ref: '#/components/schemas/RouteType'
      type: object
      x-go-package: go.podman.io/common/libnetwork/types
    Subnet:
      properties:
        gateway:
          description: Gateway IP for this Network.
          format: string
          type: string
          x-go-name: Gateway
          x-go-type: net.IP
        lease_range:
          $ref: '#/components/schemas/LeaseRange'
        subnet:
          description: Subnet for this Network in CIDR form.
          format: string
          type: string
          x-go-name: Subnet
      type: object
      x-go-package: go.podman.io/common/libnetwork/types
    NetworkUpdateOptions:
      description: NetworkUpdateOptions describes options to update a network
      properties:
        adddnsservers:
          items:
            type: string
          type: array
          x-go-name: AddDNSServers
        removednsservers:
          items:
            type: string
          type: array
          x-go-name: RemoveDNSServers
      type: object
      x-go-package: go.podman.io/podman/v6/pkg/domain/entities
    networkConnectRequestLibpod:
      $ref: '#/components/schemas/NetworkConnectOptions'
      description: Network connect
  responses:
    networkInspectResponse:
      description: Network inspect
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NetworkInspectReport'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/NetworkInspectReport'
        text/plain:
          schema:
            $ref: '#/components/schemas/NetworkInspectReport'
    badParamError:
      description: Bad parameter in request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        text/plain:
          schema:
            $ref: '#/components/schemas/ErrorModel'
    networkCreateResponse:
      description: Network create
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Network'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/Network'
        text/plain:
          schema:
            $ref: '#/components/schemas/Network'
    conflictError:
      description: Conflict error in operation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        text/plain:
          schema:
            $ref: '#/components/schemas/ErrorModel'
    networkRmResponse:
      description: Network Delete
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/NetworkRmReport'
            type: array
        application/octet-stream:
          schema:
            items:
              $ref: '#/components/schemas/NetworkRmReport'
            type: array
        text/plain:
          schema:
            items:
              $ref: '#/components/schemas/NetworkRmReport'
            type: array
    networkListLibpod:
      description: Network list
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/Network'
            type: array
        application/octet-stream:
          schema:
            items:
              $ref: '#/components/schemas/Network'
            type: array
        text/plain:
          schema:
            items:
              $ref: '#/components/schemas/Network'
            type: array
    internalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        text/plain:
          schema:
            $ref: '#/components/schemas/ErrorModel'
    networkNotFound:
      description: No such network
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        application/octet-stream:
          schema:
            $ref: '#/components/schemas/ErrorModel'
        text/plain:
          schema:
            $ref: '#/components/schemas/ErrorModel'
    networkPruneResponse:
      description: Network prune
      content:
        application/json:
          schema:
            items:
              $ref: '#/components/schemas/NetworkPruneReport'
            type: array
        application/octet-stream:
          schema:
            items:
              $ref: '#/components/schemas/NetworkPruneReport'
            type: array
        text/plain:
          schema:
            items:
              $ref: '#/components/schemas/NetworkPruneReport'
            type: array