---
updatedAt: 2026-05-27T20:00:17.000Z
agentTools:
  projectIndex: https://replicated-vendor-api.readme.io/llms.txt
---

# Exposes a port on a vm.

Required RBAC Policy: kots/vm/[:vmid]/port/expose

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "List, create, update, archive customers and fetch customer licenses",
    "title": "Vendor API V3",
    "contact": {
      "name": "Replicated, Inc.",
      "url": "http://www.replicated.com/",
      "email": "info@replicated.com"
    },
    "version": "3.0.0"
  },
  "paths": {
    "/vm/{vm_id}/port": {
      "post": {
        "security": [
          {
            "api_key": []
          }
        ],
        "description": "Required RBAC Policy: kots/vm/[:vmid]/port/expose",
        "tags": [
          "vms"
        ],
        "summary": "Exposes a port on a vm.",
        "operationId": "createVMPort",
        "parameters": [
          {
            "x-go-name": "VMID",
            "description": "VM identifier",
            "name": "vm_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/createClusterPortBody"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/createVMPortResponse"
          },
          "401": {
            "$ref": "#/components/responses/responseErrUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/responseErrForbidden"
          },
          "404": {
            "$ref": "#/components/responses/responseErrNotFound"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.replicated.com/vendor/v3"
    }
  ],
  "components": {
    "responses": {
      "createVMPortResponse": {
        "description": "CreateVMPortResponse contains the response to a create vm port request",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "addon": {
                  "$ref": "#/components/schemas/VMAddon"
                },
                "port": {
                  "$ref": "#/components/schemas/VMPort"
                }
              }
            }
          }
        }
      },
      "responseErrForbidden": {
        "description": "Returned if the caller does not have the needed permission",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "x-go-name": "Message"
                    },
                    "messageCode": {
                      "type": "string",
                      "x-go-name": "MessageCode"
                    }
                  },
                  "x-go-name": "Error"
                }
              }
            }
          }
        }
      },
      "responseErrNotFound": {
        "description": "Returned on resource not found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "x-go-name": "Message"
                }
              }
            }
          }
        }
      },
      "responseErrUnauthorized": {
        "description": "Return if the caller is not authorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "x-go-name": "Message"
                }
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "createClusterPortBody": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "port",
                "protocols"
              ],
              "properties": {
                "is_wildcard": {
                  "description": "IsWildcard",
                  "type": "boolean",
                  "x-go-name": "IsWildcard"
                },
                "port": {
                  "description": "Port Number",
                  "type": "integer",
                  "format": "int64",
                  "x-go-name": "Port"
                },
                "protocols": {
                  "description": "Protocols",
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PortProtocol"
                  },
                  "x-go-name": "Protocols"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "PortProtocol": {
        "type": "string",
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/cmx/types"
      },
      "VMAddon": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "x-go-name": "CreatedAt"
          },
          "guid": {
            "type": "string",
            "x-go-name": "GUID"
          },
          "id": {
            "type": "string",
            "x-go-name": "ShortID"
          },
          "port": {
            "$ref": "#/components/schemas/VMAddonPort"
          },
          "ready_at": {
            "type": "string",
            "format": "date-time",
            "x-go-name": "ReadyAt"
          },
          "status": {
            "$ref": "#/components/schemas/VMAddonStatus"
          },
          "terminated_at": {
            "type": "string",
            "format": "date-time",
            "x-go-name": "TerminatedAt"
          },
          "total_credits": {
            "type": "integer",
            "format": "int64",
            "x-go-name": "TotalCredits"
          },
          "vm_guid": {
            "type": "string",
            "x-go-name": "VMGUID"
          },
          "vm_id": {
            "type": "string",
            "x-go-name": "VMShortID"
          }
        },
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/vm/types"
      },
      "VMAddonPort": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "x-go-name": "Name"
          },
          "protocol_http": {
            "type": "boolean",
            "x-go-name": "ProtocolHTTP"
          },
          "protocol_https": {
            "type": "boolean",
            "x-go-name": "ProtocolHTTPS"
          },
          "protocol_ws": {
            "type": "boolean",
            "x-go-name": "ProtocolWS"
          },
          "protocol_wss": {
            "type": "boolean",
            "x-go-name": "ProtocolWSS"
          },
          "upstream_port": {
            "type": "integer",
            "format": "int64",
            "x-go-name": "UpstreamPort"
          }
        },
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/vm/types"
      },
      "VMAddonStatus": {
        "type": "string",
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/vm/types"
      },
      "VMExposedPort": {
        "type": "object",
        "properties": {
          "exposed_port": {
            "type": "integer",
            "format": "int64",
            "x-go-name": "ExposedPort"
          },
          "protocol": {
            "$ref": "#/components/schemas/PortProtocol"
          }
        },
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/vm/types"
      },
      "VMPort": {
        "type": "object",
        "properties": {
          "addon_guid": {
            "type": "string",
            "x-go-name": "AddonGUID"
          },
          "addon_id": {
            "type": "string",
            "x-go-name": "AddonShortID"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "x-go-name": "CreatedAt"
          },
          "exposed_ports": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VMExposedPort"
            },
            "x-go-name": "ExposedPorts"
          },
          "hostname": {
            "type": "string",
            "x-go-name": "Hostname"
          },
          "port_name": {
            "type": "string",
            "x-go-name": "PortName"
          },
          "state": {
            "$ref": "#/components/schemas/VMAddonStatus"
          },
          "upstream_port": {
            "type": "integer",
            "format": "int64",
            "x-go-name": "UpstreamPort"
          },
          "vm_guid": {
            "type": "string",
            "x-go-name": "VMGUID"
          },
          "vm_id": {
            "type": "string",
            "x-go-name": "VMShortID"
          }
        },
        "x-go-package": "github.com/replicatedhq/vandoor/pkg/vendor-api/vm/types"
      }
    }
  }
}
```