> ## Documentation Index
> Fetch the complete documentation index at: https://opensandbox-oc-s-762ac928075c46d2828bcb22.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# oc preview

> Manage preview URLs

Expose sandbox ports to the internet.

## `oc preview create <sandbox-id>`

[HTTP API →](/api-reference/preview/create)

<ParamField query="--port" type="int" required>
  Container port to expose
</ParamField>

<ParamField query="--domain" type="string">
  Custom domain
</ParamField>

```bash theme={null}
oc preview create sb-abc --port 3000
```

***

## `oc preview list <sandbox-id>`

[HTTP API →](/api-reference/preview/list)

Output columns: `PORT`, `HOSTNAME`, `SSL`, `CREATED`

***

## `oc preview delete <sandbox-id> <port>`

[HTTP API →](/api-reference/preview/delete)

***

## `oc preview rotate-auth <sandbox-id>`

[HTTP API →](/api-reference/preview/rotate-auth)

Mint a new bearer token for the sandbox's preview URLs. The old token stops working immediately. The new plaintext is printed once — capture it before moving on; the server will not return it again.

```bash theme={null}
oc preview rotate-auth sb-abc
# New preview auth token (shown once): qx2sSi5IYX...
```

Calling this on a sandbox that was created without `--preview-auth` installs a token and starts enforcing the gate from that point on.

See [`oc sandbox create --preview-auth`](/reference/cli/sandbox#oc-sandbox-create) to enable at create time, or [`--preview-auth-token`](/reference/cli/sandbox#oc-sandbox-create) to bring your own.
