---
title: "Get message diff"
method: GET
path: "/session/{sessionID}/diff"
---

# Get message diff

`GET /session/{sessionID}/diff`

Get the file changes (diff) that resulted from a specific user message in the session.

## Path parameters

- `sessionID` string, required

## Query parameters

- `directory` string
- `workspace` string
- `messageID` string

## Response `200`

Successfully retrieved diff

- SnapshotFileDiff[]
  - `file` string, required
  - `patch` string, required
  - `additions` number, required
  - `deletions` number, required
  - `status` 'added' | 'deleted' | 'modified'

## Changes

- **2026-04-25** `0a2d50cb4204` — 3 breaking, 5 info
  - added the pattern `^ses.*` to the `path` request parameter `sessionID`
  - removed the required property `items/after` from the response with the `200` status
  - removed the required property `items/before` from the response with the `200` status
  - added the new optional `query` request parameter `workspace`
  - …4 more
- **2025-12-16** `dc065d96c390` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kaaass/apis/opencode/changes/session/:sessionID/diff/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)
