Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api-quick-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ A compact summary of all Aegis API endpoints. For detailed documentation, exampl
| Method | Path | Auth | Summary |
|--------|------|------|---------|
| `GET` | `/v1/sessions/{id}` | Bearer | Get session details |
| `PATCH` | `/v1/sessions/{id}` | Bearer | Update session metadata (pin/unpin) |
| `GET` | `/v1/sessions/{id}/status` | Bearer | Lightweight status (id, status, lastActivity) |
| `GET` | `/v1/sessions/{id}/health` | Bearer | Single session health check |
| `GET` | `/v1/sessions/{id}/cost` | Bearer | Per-session cost summary with burn rate |
Expand Down
43 changes: 43 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,49 @@ curl http://localhost:9100/v1/sessions/abc123 \

---

### Update Session Metadata

```
PATCH /v1/sessions/:id
```

Updates mutable session metadata fields. Currently supports pinning sessions to protect them from automatic reaping.

| Role | Required |
|------|----------|
| admin, operator | Yes |

```bash
# Pin a session (reapers will never kill it)
curl -X PATCH http://localhost:9100/v1/sessions/abc123 \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"isPinned": true}'

# Unpin a session
curl -X PATCH http://localhost:9100/v1/sessions/abc123 \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"isPinned": false}'
```

**Request body:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isPinned` | boolean | yes | Pin (`true`) or unpin (`false`) the session. Pinned sessions are skipped by stale and zombie reapers. |

**Response:** Updated session object with `actionHints`. The `isPinned` field appears in the session metadata.

**Errors:**

| Status | Code | Condition |
|--------|------|------------|
| 400 | `INVALID_UPDATE` | No valid fields in request body |
| 404 | `NOT_FOUND` | Session not found |

---

### Batch Create Sessions

```
Expand Down
Loading