Skip to content

Switch windows

POST
/api/sessions/{session_id}/windows/switch
Code sample: Shell / cURL
curl --request POST \
--url http://127.0.0.1:8004/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/windows/switch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "index": 1 }'

Makes another window active: index is absolute, or -1 for the next window and -2 for the previous.

session_id
required
string format: uuid

Session ID

Media typeapplication/json
object
index
required

Absolute window index, or the sentinels -1 (next) / -2 (prev) also used by the /ws/control protocol.

integer format: int32

Example generated

{
"index": 1
}

Done

A malformed ID or JSON body

Media typetext/plain
string

Missing or wrong access token

Media typetext/plain
string

The request’s Host or Origin isn’t allowed, or the caller can’t use this route (a guest token, or btmux connect)

No such session

A body over the size limit

Media typetext/plain
string

No Content-Type: application/json

Media typetext/plain
string

A body that doesn’t match its schema

Media typetext/plain
string