---
title: "Compare Document Versions"
method: GET
path: "/files/{file_id}/compare-versions"
tags: ["files"]
---

# Compare Document Versions

`GET /files/{file_id}/compare-versions`

Compare two versions of a document, showing the diff.
If previous_version_id is not provided, it will compare with the second most recent version.

## Path parameters

- `file_id` string, uuid, required

## Query parameters

- `previous_version_id` string, uuid, nullable

## Response `200`

Successful Response

- DocumentDiff
  - `html_diff` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/kobaltlabs/apis/fastapi.md) · [All operations](https://skmtc.dev/kobaltlabs/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kobaltlabs/fastapi/revisions/425d5b8a3c17/schema)
