List shell sessions for a device
const url = 'https://example.com/api/devices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/sessions?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&page=1&per_page=20';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/devices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/sessions?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0&page=1&per_page=20' \ --header 'Authorization: Bearer <token>'Return all session records for a device (metadata only; no secrets).
Requires org viewer access.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Query Parameters
Section titled “ Query Parameters ”Responses
Section titled “ Responses ”Successful Response
Paginated list of session records.
object
Public representation of a shell session.
Secret / sensitive fields (client_ip, user_agent, recording_uri, recording_sha256) are intentionally EXCLUDED from this schema.
WebSocket connection fields (ws_url, ws_token, ws_expires_at) are populated only when the gateway is configured and the session was opened via POST /devices/{id}/sessions. They are None in list/get responses and in dev environments where the gateway is not running.
ws_token is included so the browser can supply it as a WebSocket subprotocol (Sec-WebSocket-Protocol) when opening ws_url — never appended to the URL query string, so it does not land in proxy access logs (GAP-FE-007). It is short-lived (~60 s) and single-use; do NOT persist it.
object
Example
{ "items": [ { "recording": false } ]}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}