New
The Gartner Hype Cycle Emerging Technologies Report is out!

Download now

Home
/
API
/
PortSharing

PortSharing

PortSharing

Get workspace agent port shares

Code samples

# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \
  -H 'Content-Type: application/json' \
  -H 'Coder-Session-Token: API_KEY'

DELETE /workspaces/{workspace}/port-share

Body parameter

{
  "agent_name": "string",
  "port": 0
}

Parameters

NameInTypeRequiredDescription
workspacepathstring(uuid)trueWorkspace ID
bodybodycodersdk.DeleteWorkspaceAgentPortShareRequesttrueDelete port sharing level request

Responses

StatusMeaningDescriptionSchema
200OKOK

To perform this operation, you must be authenticated. Learn more.

Upsert workspace agent port share

Code samples

# Example request using curl
curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Coder-Session-Token: API_KEY'

POST /workspaces/{workspace}/port-share

Body parameter

{
  "agent_name": "string",
  "port": 0,
  "share_level": "owner"
}

Parameters

NameInTypeRequiredDescription
workspacepathstring(uuid)trueWorkspace ID
bodybodycodersdk.UpsertWorkspaceAgentPortShareRequesttrueUpsert port sharing level request

Example responses

200 Response

{
  "agent_name": "string",
  "port": 0,
  "share_level": "owner",
  "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}

Responses

StatusMeaningDescriptionSchema
200OKOKcodersdk.WorkspaceAgentPortShare

To perform this operation, you must be authenticated. Learn more.

See an opportunity to improve our docs? Make an edit.