Skip to content
Skip to Content
Coder Docs

Upsert workspace agent port share

POST
/api/v2/workspaces/{workspace}/port-share

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

workspace*string

Workspace ID

Formatuuid

Request Body

Upsert port sharing level request

application/json
  1. body
agent_name?string
port?integer
protocol?string
Value in"http""https"
share_level?string
Value in"owner""authenticated""organization""public"

Response Body

OK

application/json
  1. response
agent_name?string
port?integer
protocol?string
Value in"http""https"
share_level?string
Value in"owner""authenticated""organization""public"
workspace_id?string
Formatuuid

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X POST \	"$CODER_URL/api/v2/workspaces/{workspace}/port-share" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "agent_name": "string",  "port": 0,  "protocol": "http"}'
Example Response200
{  "agent_name": "string",  "port": 0,  "protocol": "http",  "share_level": "owner",  "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"}