---
title: "Diff of the code reviewed by this review"
method: GET
path: "/api/v1/trails/{trail_id}/reviews/{id}/diff"
tags: ["CodeReview"]
---

# Diff of the code reviewed by this review

`GET /api/v1/trails/{trail_id}/reviews/{id}/diff`

Uses the code_version pinned to the review, then reads its immutable comparison from the repository's authoritative entire-api cell. Returns per-file change status, additions/deletions, and patch hunks.

## Path parameters

- `trail_id` string, required
- `id` string, required

## Response `200`

Per-file diff

- object
  - `code_version_id` string, required
  - `base_sha` string, nullable, required
  - `head_sha` string, nullable, required
  - `files` object[], required
    - `path` string, required
    - `previous_path` string, nullable, required
    - `status` string, required
    - `additions` number, required
    - `deletions` number, required
    - `patch` string, nullable, required
    - `patch_truncated` boolean, required

## Other responses

- `404` — code_version not found or caller lacks trail access
- `409` — code_version is missing base_sha or head_sha
- `503` — Authoritative review diff is unavailable

---

[API](https://skmtc.dev/entire/apis/entire-api.md) · [All operations](https://skmtc.dev/entire/apis/entire-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/entire/entire-api/revisions/c3d737ae064e/schema)
