Skip to content

Opens a browser preview of one port the run listens on and returns its URL, which expires within the hour and when the session stops.

POST
/v1/m/sessions/runs/{ref}/preview
curl --request POST \
--url https://example.com/v1/m/sessions/runs/example/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "port": 1 }'

Opens a browser preview of one port the run listens on and returns its URL, which expires within the hour and when the session stops.

ref
required
string

Path parameter ref.

X-Olivares-Tenant
string format: uuid

Target tenant id; required when the principal can act in more than one tenant.

Media type application/json
object
port
required

A port the session’s own processes listen on (GET /runs/{ref}/preview).

integer
>= 1 <= 65535
Example generated
{
"port": 1
}

The preview’s URL on this engine

Media type application/json
object
expires_at
required
string format: date-time
port
required
integer
url
required

Same-origin path of the preview; the token in it is its only credential.

string
Example generated
{
"expires_at": "2026-04-15T12:00:00Z",
"port": 1,
"url": "example"
}

Bad request

Media type application/json
object
Example generated
{}

Unauthenticated

Media type application/json
object
Example generated
{}

Forbidden

Media type application/json
object
Example generated
{}

No process of this session listens on the port

Media type application/json
object
Example generated
{}

The session is not running on this node

Media type application/json
object
Example generated
{}

Too many previews are open on this node

Media type application/json
object
Example generated
{}

The session’s ports cannot be read on this host

Media type application/json
object
Example generated
{}