Skip to content

Open a web preview of a port at https://<sandbox-id>-<port>.<region>.<domain>

PUT
/sandboxes/{id}/previews/{port}
curl --request PUT \
--url https://api.global.stillbox.example/v1/sandboxes/ws-7k2m9q4x8w3z5r6t/previews/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "visibility": "private" }'

Ports are closed until a preview opens them. A private preview (the default) needs your API key in an Authorization: Bearer header; the gateway removes the key before relaying. A public preview is open to anyone with its address. Port 49100 is reserved.

id
required
string
port
required
integer
>= 1 <= 65535
Media typeapplication/json
object
visibility
string
default: private
Allowed values: private public

The preview

Media typeapplication/json
object
port
required
integer
visibility
required
string
Allowed values: private public
url

The preview’s address; absent while the region has no domain yet.

string

Example

{
"visibility": "private"
}

The request is invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

The API key is missing or invalid

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}

No such sandbox in your organization (or no such file)

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}