---
title: "Read one session workspace file and its git diff"
method: GET
path: "/api/v1/sessions/{sessionId}/workspace/file"
tags: ["sessions"]
---

# Read one session workspace file and its git diff

`GET /api/v1/sessions/{sessionId}/workspace/file`

## Path parameters

- `sessionId` string, required — Session identifier, e.g. project-1.

## Query parameters

- `path` string — Session-worktree-relative file path.
- `section` 'committed' | 'staged' | 'unstaged' | 'untracked' — Git-state section the file was opened from (see WorkspaceFileSections). staged diffs the index against HEAD; unstaged diffs the worktree against the index; omitted/committed/untracked diff the worktree against the compare base.

## Response `200`

OK

- WorkspaceFileResponse
  - `additions` integer, required
  - `binary` boolean, required
  - `compareBaseRef` string
  - `compareBaseSha` string
  - `compareMode` 'base' | 'head_fallback'
  - `content` string, required
  - `contentTruncated` boolean, required
  - `deleted` boolean, required
  - `deletions` integer, required
  - `diff` string, required
  - `diffTruncated` boolean, required
  - `imageMediaType` string
  - `path` string, required
  - `previousPath` string
  - `sessionId` string, required
  - `size` integer, required
  - `status` 'unmodified' | 'modified' | 'added' | 'deleted' | 'renamed', required

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal Server Error
- `501` — Not Implemented

## Changes

- **2026-09-03** `d31a2d019c47` — 4 info
  - added the optional property `reporting_owner` to the response with the `400` status
  - added the optional property `reporting_owner` to the response with the `404` status
  - added the optional property `reporting_owner` to the response with the `500` status
  - added the optional property `reporting_owner` to the response with the `501` status
- **2026-08-25** `14fb9cddd7ab` — 1 info
  - added the new optional `query` request parameter `section`
- **2026-08-21** `7d395fb30522` — 1 info
  - added the optional property `imageMediaType` to the response with the `200` status
- **2026-07-31** `0d1e03674bc2` — 4 info
  - added the optional property `compareBaseRef` to the response with the `200` status
  - added the optional property `compareBaseSha` to the response with the `200` status
  - added the optional property `compareMode` to the response with the `200` status
  - added the optional property `previousPath` to the response with the `200` status
- **2026-07-18** `afa8f1f796c2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/changes/api/v1/sessions/:sessionId/workspace/file/get.md)

---

[API](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon.md) · [All operations](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/composiohq/agent-orchestrator-http-daemon/revisions/9d68955a2566/schema)
