Coder PortSharing API
The PortSharing API from Coder — 1 operation(s) for portsharing.
The PortSharing API from Coder — 1 operation(s) for portsharing.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/coder:coder-portsharing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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: 3.2.0
info:
description: Coderd is the service created by running coder server. It is a thin API that connects workspaces, provisioners and users. coderd stores its state in Postgres and is the only service that communicates with Postgres.
title: Coder Port Sharing API
termsOfService: https://coder.com/legal/terms-of-service
contact:
name: API Support
url: https://coder.com
email: support@coder.com
license:
name: AGPL-3.0
url: https://github.com/coder/coder/blob/main/LICENSE
version: '2.0'
servers:
- url: /
tags:
- name: PortSharing
paths:
/api/v2/workspaces/{workspace}/port-share:
get:
tags:
- PortSharing
summary: Get workspace agent port shares
operationId: get-workspace-agent-port-shares
parameters:
- description: Workspace ID
name: workspace
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.WorkspaceAgentPortShares'
security:
- CoderSessionToken: []
post:
tags:
- PortSharing
summary: Upsert workspace agent port share
operationId: upsert-workspace-agent-port-share
parameters:
- description: Workspace ID
name: workspace
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.WorkspaceAgentPortShare'
security:
- CoderSessionToken: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.UpsertWorkspaceAgentPortShareRequest'
description: Upsert port sharing level request
required: true
delete:
tags:
- PortSharing
summary: Delete workspace agent port share
operationId: delete-workspace-agent-port-share
parameters:
- description: Workspace ID
name: workspace
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: OK
security:
- CoderSessionToken: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/codersdk.DeleteWorkspaceAgentPortShareRequest'
description: Delete port sharing level request
required: true
components:
schemas:
codersdk.WorkspaceAgentPortShareLevel:
type: string
enum:
- owner
- authenticated
- organization
- public
x-enum-varnames:
- WorkspaceAgentPortShareLevelOwner
- WorkspaceAgentPortShareLevelAuthenticated
- WorkspaceAgentPortShareLevelOrganization
- WorkspaceAgentPortShareLevelPublic
codersdk.WorkspaceAgentPortShares:
type: object
properties:
shares:
type: array
items:
$ref: '#/components/schemas/codersdk.WorkspaceAgentPortShare'
codersdk.UpsertWorkspaceAgentPortShareRequest:
type: object
properties:
agent_name:
type: string
port:
type: integer
protocol:
enum:
- http
- https
allOf:
- $ref: '#/components/schemas/codersdk.WorkspaceAgentPortShareProtocol'
share_level:
enum:
- owner
- authenticated
- organization
- public
allOf:
- $ref: '#/components/schemas/codersdk.WorkspaceAgentPortShareLevel'
codersdk.WorkspaceAgentPortShare:
type: object
properties:
agent_name:
type: string
port:
type: integer
protocol:
enum:
- http
- https
allOf:
- $ref: '#/components/schemas/codersdk.WorkspaceAgentPortShareProtocol'
share_level:
enum:
- owner
- authenticated
- organization
- public
allOf:
- $ref: '#/components/schemas/codersdk.WorkspaceAgentPortShareLevel'
workspace_id:
type: string
format: uuid
codersdk.DeleteWorkspaceAgentPortShareRequest:
type: object
properties:
agent_name:
type: string
port:
type: integer
codersdk.WorkspaceAgentPortShareProtocol:
type: string
enum:
- http
- https
x-enum-varnames:
- WorkspaceAgentPortShareProtocolHTTP
- WorkspaceAgentPortShareProtocolHTTPS
securitySchemes:
AIGatewayKey:
type: apiKey
name: X-AI-Governance-Gateway-Key
in: header
Authorization:
type: apiKey
name: Authorization
in: header
CoderSessionToken:
type: apiKey
name: Coder-Session-Token
in: header
x-provenance:
method: harvested
publisher: Coder
source: https://raw.githubusercontent.com/coder/coder/main/coderd/apidoc/swagger.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)