Skip to content

API reference

The HTTP API runs on your own tmux-rc daemon. Its default address is http://127.0.0.1:18030; use your authenticated tunnel address when connecting remotely.

Machine-readable reference

GET /openapi.json describes the exact version you are running. The interactive pages (/apidocs Swagger UI, /apiredoc ReDoc) are off by default because FastAPI’s pages load JavaScript from a third-party CDN on the origin that controls your terminals; set TMUXRC_API_DOCS=1 in the daemon’s environment and restart to serve them. The public documentation website does not proxy your daemon’s API.

Endpoints

Every pane endpoint takes a tmux pane id (%3); send also accepts session:window.pane or the pane’s label. Agents and scripts should start with /api/digest; /api/state is shaped for the phone and carries only the events new since the last parse.

Read the fleet

EndpointPurpose
GET /api/digestPer pane: headline, activity, idle time, pending question, idle summary, recent events. The one call that gives the whole picture
GET /api/stateThe phone’s deck; ?v=<version> long-polls until something changes (~25s)
GET /api/panes/{id}/eventsA pane’s activity log (design )
GET /api/panes/{id}/snapshots, /snapshots/{snap_id}Saved screen captures; the second returns one as text
GET /api/panes/{id}/liveCurrent colored frame; long-polls with ?frame=
GET /api/panes/{id}/historyColored scrollback rows above a live frame (?before=&lines=)
GET /api/historyFleet activity over time; ?before=<epoch ms> pages back
GET /api/usageEach Claude and Codex account’s plan windows, trend and projection (design )
GET /api/open-loopsWaiting on you / Moving / Dropped, by workstream (design )
GET /api/recentPanes and scratch pages last opened
GET /api/versionWeb-asset hash plus feature flags the client gates on (live_enabled, docs, scratch)

Act on a pane

EndpointPurpose
POST /api/panes/{id}/sendType text or keys, including an answer to the pending question
POST /api/panes/{id}/composeSend a draft of text and files (any type, 50MB each); a file goes in as a path the agent opens
POST /api/panes/{id}/imageAttach one image (clipboard paste, falling back to a path)
POST /api/panes/{id}/click, /wheelMouse click and scroll for apps that take them
POST /api/panes/{id}/fitFit the pane’s window width to the phone (fit width )
POST /api/panes/{id}/selectFocus the pane in tmux on the host
POST /api/panes/{id}/renameRename the pane, its session, or both
POST /api/panes/{id}/closeKill the window that contains the pane
GET/POST /api/panes/{id}/expungePreview, then kill the window and delete the agent session’s local files (design )
POST /api/panes/{id}/move, /exitResume the agent session on another account; type /exit into the pane left behind (design )

Sessions, accounts, workspace

EndpointPurpose
GET /api/launchersThe + menu’s entries (labels only; commands stay in the daemon, TMUXRC_LAUNCHERS)
POST /api/windows, POST /api/sessions, GET /api/sessions/dirsOpen a window or session running a configured launcher; directory suggestions
GET/POST/PUT /api/accounts, /accounts/login, /accounts/defaultAgent accounts and their sign-in windows
GET/POST /api/restore, POST /api/restore/dismissOffer and restore the workspace of a dead tmux server (design )
GET /api/export?part=…The parts named (repeat part; none means only what every archive carries), as a .tgz, like tmux-rc export’s flags
GET /api/export/partsJSON: each part’s name, label, default and size on disk, what Settings › Export all… shows
PUT /api/history/goalThe goal line shown on the dashboard

Previews and push

EndpointPurpose
GET /scratch/, POST /api/scratch, GET/PUT /api/pins, GET /api/panes/{id}/scratch, GET /api/scratch/{name}/paneThe scratch gallery : listing, archive/delete, pins, and which pane made a page
GET /api/push/config, POST /api/push/subscribe, /unsubscribe, /revoke-all, /presence, /answerWeb push (design )
WS /api/live-modeLive Mode’s voice and chat socket (design )
POST /api/client-errorBrowser-side failure reports, forwarded to telemetry

The web app is served at /m/; its assets also live under /v/{version}/, an immutable prefix so a deploy never runs new code against cached old modules.

For agent-driven coordination, start with orchestrating agents . The architecture explains how observation and input reach tmux.

Access

The daemon itself has no authentication. API access can control real terminals, so keep it on a single-user machine and use an authenticating front end for remote access. See remote access . Every state-changing call is audited to the journal and to telemetry (see telemetry hints ).