---
title: "Exposes a port on a vm."
method: POST
path: "/vm/{vm_id}/port"
tags: ["vms"]
---

# Exposes a port on a vm.

`POST /vm/{vm_id}/port`

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

## Path parameters

- `vm_id` string, required

## Request body

- object
  - `is_wildcard` boolean — IsWildcard
  - `port` integer, required — Port Number
  - `protocols` PortProtocol[], required — Protocols

## Response `201`

CreateVMPortResponse contains the response to a create vm port request

- object
  - `addon` VMAddon
    - `created_at` string, date-time
    - `guid` string
    - `id` string
    - `port` VMAddonPort
      - `name` string
      - `protocol_http` boolean
      - `protocol_https` boolean
      - `protocol_ws` boolean
      - `protocol_wss` boolean
      - `upstream_port` integer
    - `ready_at` string, date-time
    - `status` string
    - `terminated_at` string, date-time
    - `total_credits` integer
    - `vm_guid` string
    - `vm_id` string
  - `port` VMPort
    - `addon_guid` string
    - `addon_id` string
    - `created_at` string, date-time
    - `exposed_ports` VMExposedPort[]
      - `exposed_port` integer
      - `protocol` string
    - `hostname` string
    - `port_name` string
    - `state` string
    - `upstream_port` integer
    - `vm_guid` string
    - `vm_id` string

## Other responses

- `401` — Return if the caller is not authorized
- `403` — Returned if the caller does not have the needed permission
- `404` — Returned on resource not found

---

[API](https://skmtc.net/replicated/apis/vendor-api-v3-2.md) · [All operations](https://skmtc.net/replicated/apis/vendor-api-v3-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/replicated/vendor-api-v3-2/versions/6fcf9e54aba4/schema)
