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

# Compare Document Versions

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

## Request

- Base URL: `https://api.kobaltlabs.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kobaltlabs.com/files/{file_id}/compare-versions`
- Auth: none declared

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/kobaltlabs-api.md) - [All operations](https://skmtc.dev/kobaltlabs/apis/kobaltlabs-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kobaltlabs/apis/kobaltlabs-api/revisions/8587332d5e43?raw)
