Creating a preview
preview_create tool exposes this, with capability_jws deliberately dropped from the result — see below.
Request body (PreviewCreateRequest):
integer
required
Port to expose, 1024–65535.
string
default:"token"
token or public (see below).string
Display metadata only, at most 80 UTF-8 bytes.
Idempotency-Key header — see Idempotency.
Returns 201 with PreviewCreateResponse:
object
required
The created
Preview (see fields below).string
required
A capability token for the token-mode browser exchange described below.
Preview fields
string
required
Matches
^pv-[a-z2-7]{26}$.string
required
The owning sandbox.
integer
required
The exposed port, 1024–65535.
string
required
token or public.string
Display metadata only, at most 80 UTF-8 bytes.
string
required
Token-free base preview URL.
integer
required
Creation time.
Auth modes
auth_mode is one of two values — not private/public:
token(default) — access is gated by the Roxy browser exchange described below.public— anyone with the URL can view it; no exchange required.
The token-mode browser exchange
Intoken mode, the client navigates once to preview.url with ?bonya_token=<capability_jws> appended. Roxy (the preview proxy) validates the token, sets a host-scoped Secure, HttpOnly cookie, and redirects to the same URL with bonya_token stripped — before any guest content is rendered. After that one exchange, the cookie carries the session; the token itself should not be stored in URLs or logs beyond that single navigation.
Each SDK wraps this exchange in a previewBrowserUrl-style helper, which builds the one-time URL from the capability_jws returned by create. There’s no cURL or CLI example for this step — it’s a browser navigation, not a request/response call — and no MCP tool, since preview_create’s MCP result deliberately omits capability_jws in the first place.
Listing previews
preview_list tool covers this.
Returns PreviewListResponse: { "previews": [ ...Preview ] }. As noted above, list never includes capability_jws — only create does.
Deleting a preview
preview_delete tool covers this, and is likewise idempotent.
Delete is idempotent and deliberately avoids leaking cross-org existence — deleting a preview that doesn’t exist (or belongs to another organization) behaves the same as deleting one that does, rather than distinguishing the two cases.
204 on success.