Skip to content

Open a terminal in a sandbox (WebSocket)

GET
/sandboxes/{id}/terminal
curl --request GET \
--url https://api.global.stillbox.example/v1/sandboxes/ws-7k2m9q4x8w3z5r6t/terminal \
--header 'Authorization: Bearer <token>'

Upgrades to a WebSocket connected to a login shell in the sandbox (sandboxes made from Stillbox agent types). Binary messages carry terminal input and output; a text message {"type":"resize","cols":120,"rows":40} resizes the terminal. When the shell exits, the server closes with code 1000 and reason exit <code>.

id
required
string
cols
integer
rows
integer
cmd
string

Run this command instead of an interactive shell

Switching to the WebSocket protocol

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"
}

The sandbox isn’t running, or its server is unreachable right now

Media typeapplication/json
object
code
required
string
message
required
string

Example

{
"code": "not_found"
}