Skip to Content
kosemdocs
ReferenceAPIEnvironments

Attach terminal

Upgrades to a WebSocket attached to an interactive shell in a running environment. Authenticates with the ticket from OpenTerminal sent in Sec-WebSocket-Protocol as kosem.terminal.v1, kosem.auth.<token>. Binary frames carry terminal input and offset-prefixed output; text JSON frames carry resize, status, ready, exit and error messages.

GET
/v1/projects/{project}/environments/{environment}/terminals/{terminal}/attach

Upgrades to a WebSocket attached to an interactive shell in a running environment.

Authenticates with the ticket from OpenTerminal sent in Sec-WebSocket-Protocol as kosem.terminal.v1, kosem.auth.. Binary frames carry terminal input and offset-prefixed output; text JSON frames carry resize, status, ready, exit and error messages.

Path Parameters

project*string

The project's ID.

Match^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$
environment*string

The environment's ID.

Match^env_[0-7][0-9a-hjkmnp-tv-z]{25}$
terminal*string

The terminal session ID.

Match^trm_[0-7][0-9a-hjkmnp-tv-z]{25}$

Query Parameters

cols?integer

Initial terminal width in columns. Defaults to 80 when 0.

Formatint32
Range0 <= value <= 500
rows?integer

Initial terminal height in rows. Defaults to 24 when 0.

Formatint32
Range0 <= value <= 200
after?integer

Last output byte offset already received, for lossless replay on reattach.

Formatint64
Range0 <= value
create?boolean

Start a new shell session if this ID doesn't exist yet.

Response Body

Switching Protocols: the connection speaks the protocol that the request asked for from here on.

Example Request
curl -X GET 'https://api.kosem.ai/v1/projects/string/environments/string/terminals/string/attach'
Example Response
Empty