---
title: "Line-level diff between two revisions"
method: GET
path: "/reports/{id}/diff"
tags: ["Revisions"]
---

# Line-level diff between two revisions

`GET /reports/{id}/diff`

## Request

- Base URL: `https://commareports.com/api/v1`
- URL: `https://commareports.com/api/v1/reports/{id}/diff`
- Auth: HTTP bearer

Classifies lines via an LCS walk into `added`, `removed`, and `unchanged`. Both revisions must belong to the report; missing/unauthorized returns 404. Scope: `reports:read`.

## Query parameters

- `from` string, uuid, required
- `to` string, uuid, required

## Response `200`

The diff.

- Diff
  - `from` string, uuid, required
  - `to` string, uuid, required
  - `added` string[], required
  - `removed` string[], required
  - `unchanged` string[], required

## Other responses

- `400`: Malformed body or invalid field.
- `401`: Missing, invalid, revoked, or expired token.
- `403`: Token missing the required scope, or no access to the resource.
- `404`: Resource not found (also returned instead of 403 where existence must not leak).
- `429`: Rate limit exceeded. Rate limit: per-token sliding window (plan-aware — Free 60 req/min, Pro 600, Team/Enterprise 6000 by default); 429 responses carry a Retry-After header.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/commareports/apis/comma-api.md) · [All operations](https://skmtc.dev/commareports/apis/comma-api/llms.txt) · [OpenAPI document](https://skmtc.dev/commareports/apis/comma-api/revisions/cd5263522ade?raw)
