---
title: "VCS diff"
method: GET
path: "/api/vcs/diff"
tags: ["vcs"]
---

# VCS diff

`GET /api/vcs/diff`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/vcs/diff`
- Auth: none required

Diff HEAD to the working copy (working), the base merge-base to the working copy (branch), or the base merge-base to HEAD (committed). Omitting base preserves repository-default comparison; supplying it overrides the comparison without saving it.

## Query parameters

- `location` object, nullable
  - `directory` string, nullable
- `mode` 'working' | 'branch' | 'committed', required
- `base` string
- `context` string, nullable
- `untracked` 'files' | 'folders'

## Response `200`

Success

- object
  - `location` LocationPublicRef, required
    - `directory` string, required
  - `data` FileDiffInfo[], required
    - `file` string, required
    - `patch` string, required
    - `additions` integer, required
    - `deletions` integer, required
    - `status` 'added' | 'deleted' | 'modified', required
    - `more` true

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: LocationNotFoundError
- `503`: ServiceUnavailableError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-26** `aa0f65b3d158`: 2 info
  - added the new optional `query` request parameter `untracked`
  - added the optional property `data/items/more` to the response with the `200` status

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/vcs/diff/get.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
