You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API.md
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# lazyagent API
2
2
3
-
lazyagent exposes an HTTP API for monitoring Claude Code sessions. The API is read-only and designed for building external clients (mobile apps, dashboards, integrations).
3
+
lazyagent exposes an HTTP API for monitoring and managing Claude Code sessions, designed for building external clients (mobile apps, dashboards, integrations).
4
4
5
5
## Starting the API server
6
6
@@ -47,6 +47,7 @@ List all visible sessions within the configured time window.
47
47
"session_id": "abc123",
48
48
"cwd": "/Users/me/projects/myapp",
49
49
"short_name": "…/projects/myapp",
50
+
"custom_name": "my-api-project",
50
51
"activity": "thinking",
51
52
"is_active": true,
52
53
"model": "claude-sonnet-4-20250514",
@@ -73,6 +74,7 @@ Get full details for a specific session.
73
74
"session_id": "abc123",
74
75
"cwd": "/Users/me/projects/myapp",
75
76
"short_name": "…/projects/myapp",
77
+
"custom_name": "my-api-project",
76
78
"activity": "writing",
77
79
"is_active": true,
78
80
"model": "claude-sonnet-4-20250514",
@@ -107,6 +109,50 @@ Get full details for a specific session.
107
109
108
110
---
109
111
112
+
### PUT /api/sessions/{id}/name
113
+
114
+
Set a custom name for a session. Names are persisted in `~/.config/lazyagent/session-names.json` and synced across TUI, tray, and API in real-time.
115
+
116
+
**Request body:**
117
+
118
+
```json
119
+
{
120
+
"name": "my-api-project"
121
+
}
122
+
```
123
+
124
+
An empty `"name"` resets the session to its default path-based name.
125
+
126
+
**Response:**`200 OK`
127
+
128
+
```json
129
+
{
130
+
"session_id": "abc123",
131
+
"custom_name": "my-api-project"
132
+
}
133
+
```
134
+
135
+
Triggers an SSE `update` event to all connected clients.
136
+
137
+
---
138
+
139
+
### DELETE /api/sessions/{id}/name
140
+
141
+
Remove the custom name from a session (reset to default path-based name).
142
+
143
+
**Response:**`200 OK`
144
+
145
+
```json
146
+
{
147
+
"session_id": "abc123",
148
+
"custom_name": ""
149
+
}
150
+
```
151
+
152
+
Triggers an SSE `update` event to all connected clients.
0 commit comments