---
title: "Get Session Diff"
method: GET
path: "/v1/sessions/{id}/diff"
tags: ["v1"]
---

# Get Session Diff

`GET /v1/sessions/{id}/diff`

## Request

- Base URL: `https://api.ellipsis.dev`
- URL: `https://api.ellipsis.dev/v1/sessions/{id}/diff`
- Auth: HTTP bearer

Return the session's uncommitted changes as a patch.

One unified-diff section per changed file, captured from the
environment's working tree when the session ended. The per-file
counts ride on the session itself (`git.repos[].files`); this
is the text behind them. Empty when the tree was clean. A
session token may read only its own session's diff.

## Path parameters

- `id` string, required

## Headers

- `user-agent` string, nullable

## Response `200`

Successful Response

- SessionDiffResponse: A session's uncommitted changes, one patch per file.
  - `files` SessionGitPatchFile[], required: One unified-diff section per changed file, `diff --git` header included, exactly as git emitted it. Join to the per-file counts on `git.repos[].files` by (full_name, path). Empty when the tree was clean or no capture ran.
    - `full_name` string, required
    - `patch` string, required
    - `path` string, required
  - `omitted_paths` string[], required: Paths whose hunks were dropped to fit the storage cap, so a viewer can name what is missing instead of showing a silently partial diff.

## Other responses

- `401`: The bearer token is missing, invalid, or revoked.
- `403`: The credential may not perform this action, or the account is blocked.
- `404`: No such session in your account.
- `422`: Validation Error

---

[API](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api.md) - [All operations](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ellipsis/apis/ellipsis-rest-api/revisions/344b16df9a1a?raw)
