v1

latestSwagger 2.02026-07-175445133.1 KB
sessions

Get session by ID

Returns complete session data for a specific session ID within a workspace

get/v1/sessions/workspace/{workspace}/session/{sessionId}

Path parameters

workspacestring required

Workspace directory path

sessionIdstring required

Session ID (UUID)

Response

OK

latestMessagestring

Latest assistant message text (always populated when available)

latestSessionTitlestring

Latest session title (from PTY escape sequences or session history)

latestThoughtstring

Latest thinking/reasoning content (always populated when available)

latestUserPromptstring

Latest user prompt from history (always populated when available)

messageCountinteger

Total message count in full data

Example response

{
  "allSessions": [
    {
      "endTime": "2024-01-15T16:45:30Z",
      "lastModified": "2024-01-15T16:45:30Z",
      "sessionId": "abc123-def456-ghi789",
      "startTime": "2024-01-15T14:30:00Z"
    }
  ],
  "sessionInfo": {
    "allSessions": [
      {
        "endTime": "2024-01-15T16:45:30Z",
        "lastModified": "2024-01-15T16:45:30Z",
        "sessionId": "abc123-def456-ghi789",
        "startTime": "2024-01-15T14:30:00Z"
      }
    ],
    "currentSessionId": "xyz789-ghi012",
    "header": "Fix bug in user authentication",
    "isActive": true,
    "lastCost": 0.25,
    "lastDuration": 3600,
    "lastSessionId": "abc123-def456",
    "lastTotalInputTokens": 15000,
    "lastTotalOutputTokens": 8500,
    "sessionEndTime": "2024-01-15T16:45:30Z",
    "sessionStartTime": "2024-01-15T14:30:00Z",
    "turnCount": 15,
    "worktreePath": "/workspace/my-project"
  },
  "stats": {
    "activeDurationSeconds": 1800.25,
    "apiCallCount": 12,
    "assistantMessages": 27,
    "cacheCreationTokens": 30000,
    "cacheReadTokens": 120000,
    "compactionCount": 1,
    "humanPromptCount": 10,
    "imageCount": 2,
    "lastContextSizeTokens": 125000,
    "sessionDurationSeconds": 3600.5,
    "subAgentCount": 3,
    "thinkingBlockCount": 8,
    "toolCallCount": 35,
    "totalInputTokens": 150000,
    "totalMessages": 42,
    "totalOutputTokens": 85000,
    "userMessages": 15
  },
  "todos": [
    {
      "content": "Fix authentication bug",
      "id": "1",
      "priority": "high",
      "status": "in_progress"
    }
  ]
}