---
title: "Share a workspace port at its preview URL."
method: PUT
path: "/v0/workspaces/{workspaceId}/preview"
tags: ["Workspaces"]
---

# Share a workspace port at its preview URL.

`PUT /v0/workspaces/{workspaceId}/preview`

## Request

- Base URL: `https://api.conductor.build` (the document declares no server; this is the origin it was published from)
- URL: `https://api.conductor.build/v0/workspaces/{workspaceId}/preview`
- Auth: HTTP bearer

Each workspace has at most one preview URL; setting a different port keeps the URL and points it at the new port. Something must be listening on that port inside the workspace (for example `python3 -m http.server <port> --bind 127.0.0.1`). Viewers sign in with Conductor and need read access to the workspace. While the workspace sleeps, the URL offers to wake it, and waking restarts the server last seen on the port. The URL is deleted when the workspace is archived.

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `port` integer, required

## Response `200`

Default Response

- object
  - `preview` object, required
    - `port` number, required
    - `url` string, required

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid bearer token.
- `404`: Resource not found.
- `default`: Error response.

---

[API](https://skmtc.dev/conductor-build/apis/roundhouse-public-api.md) - [All operations](https://skmtc.dev/conductor-build/apis/roundhouse-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/conductor-build/apis/roundhouse-public-api/revisions/1f39c7f7f219?raw)
