Skip to content

Get a session

GET
/api/sessions/{session_id}
Code sample: Shell / cURL
curl --request GET \
--url http://127.0.0.1:8004/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'
session_id
required
string format: uuid

Session ID

The session with its windows, panes, and layouts

Media typeapplication/json
object
id
required
string format: uuid
name
required
string
runtime

Where a session’s shells run.

One of:
object
type
required
string
Allowed values: local
windows
required
Array<object>
object
id
required
string format: uuid
name
required
string
panes
required
Array<object>
object
id
required
string format: uuid
title
string | null
cwd
string | null
cwd_remote

cwd is on another host.

boolean
agent_status
object
state
required

Lifecycle states for an agent occupying a pane.

This intentionally follows Herdr’s small semantic vocabulary. Failure and permission details belong in the accompanying message/notification instead of multiplying lifecycle states.

string
Allowed values: unknown idle working waiting blocked done
agent
string | null
source
string | null
message
string | null
background

Background work the agent’s screen shows, such as “2 shells, 1 monitor”.

string | null
agent_id

Names the running agent instance, so a client can target it.

integer | null format: int64
agent_since

When the agent entered its current state, in Unix seconds.

integer | null format: int64
unread
One of:

A pane notification nobody has viewed yet.

object
level
required
string
Allowed values: info attention success error
title
string | null
body
string | null
git
One of:

A pane’s place in a git repo.

object
repo_id
required

The repo’s common git dir, shared by all its worktrees.

string
repo_name
required
string
worktree_root
required
string
branch

None when HEAD is detached.

string | null
main_worktree
required

The repo’s main worktree rather than a linked one.

boolean
editor

The native editor over a pane, the same in every tab.

object
shown
required
boolean
files
required

Open files (absolute paths), in tab order.

Array<string>
active
string | null
active_pane
required
integer
layout
required
One of:
object
pane_id
required
string format: uuid
type
required
string
Allowed values: leaf
zoomed_pane
string | null format: uuid
active_window
required
integer

Example

{
"runtime": {
"type": "local"
},
"windows": [
{
"panes": [
{
"agent_status": {
"state": "unknown"
},
"unread": {
"level": "info"
}
}
],
"layout": {
"type": "leaf"
}
}
]
}

A malformed ID

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