---
title: "Get session"
method: GET
path: "/session/{sessionID}"
tags: ["Session"]
---

# Get session

`GET /session/{sessionID}`

Retrieve detailed information about a specific OpenCode session.

## Path parameters

- `sessionID` string, required

## Query parameters

- `directory` string
- `workspace` string

## Response `200`

Get session

- Session
  - `id` string, required
  - `slug` string, required
  - `projectID` string, required
  - `workspaceID` string
  - `directory` string, required
  - `parentID` string
  - `summary` object
    - `additions` number, required
    - `deletions` number, required
    - `files` number, required
    - `diffs` SnapshotFileDiff[]
      - `file` string, required
      - `patch` string, required
      - `additions` number, required
      - `deletions` number, required
      - `status` 'added' | 'deleted' | 'modified'
  - `share` object
    - `url` string, required
  - `title` string, required
  - `version` string, required
  - `time` object, required
    - `created` number, required
    - `updated` number, required
    - `compacting` number
    - `archived` number
  - `permission` PermissionRule[]
    - `permission` string, required
    - `pattern` string, required
    - `action` 'allow' | 'deny' | 'ask', required
  - `revert` object
    - `messageID` string, required
    - `partID` string
    - `snapshot` string
    - `diff` string
  - `metadata` object
    - `managedBy` 'tui' | 'tui-debugger' | 'sdk' | 'cc-companion'
    - `extraInfo` object

## Other responses

- `400` — Bad request
- `404` — Not found

## Changes

- **2026-04-25** `0a2d50cb4204` — 2 breaking, 7 info
  - removed the required property `summary/diffs/items/after` from the response with the `200` status
  - removed the required property `summary/diffs/items/before` from the response with the `200` status
  - added the new optional `query` request parameter `workspace`
  - added the optional property `metadata` to the response with the `200` status
  - …5 more
- **2026-01-15** `101bbaa394c4` — 2 info
  - added the optional property `permission` to the response with the `200` status
  - added the required property `slug` to the response with the `200` status

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/session/:sessionID/get.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) · [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kaaass/opencode/revisions/8bb9a15bd144/schema)
