---
title: "Diff Context"
method: GET
path: "/v1/projects/{project_id}/context/diff"
tags: ["project-context"]
---

# Diff Context

`GET /v1/projects/{project_id}/context/diff`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/projects/{project_id}/context/diff`
- Auth: none declared

Diff two versions (Viewer+); omit `to` to diff against the current document.
Returns both contents plus a server-computed unified diff. Unknown version -> 404.

## Path parameters

- `project_id` string, required

## Query parameters

- `from` integer, required
- `to` integer, nullable

## Response `200`

Successful Response

- ContextDiffOut
  - `from_version` integer, required
  - `to_version` integer, nullable: null = diffed against current
  - `from_content` string, required
  - `to_content` string, required
  - `unified_diff` string, required

## Other responses

- `422`: Validation Error

---

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