Skip to content
OpenCode
Esc
navigateopen⌘Jpreview

VCS diff

Diff the working copy against HEAD (mode git) or the default-branch merge base (mode branch) for the requested location.

GET/api/vcs/diff
Query parameters
locationobject | any
modeVcs.Moderequired
Allowed:workingbranch
contextstring | any
Responses
200Success
locationLocation.Inforequired
Show properties
directorystringrequired
workspaceIDobject
Show properties
object
projectobjectrequired
Show properties
idstringrequired
directorystringrequired
dataFileDiff.Info[]required
Show properties
Array of FileDiff.Info
filestringrequired
patchstringrequired
additionsobjectrequired
Show properties
object
deletionsobjectrequired
Show properties
object
statusstringrequired
Allowed:addeddeletedmodified
400InvalidRequestError
_tagstringrequired
Allowed:InvalidRequestError
messagestringrequired
kindstring | any
Show properties
Any of:
string
string
any
any
fieldstring | any
Show properties
Any of:
string
string
any
any
401UnauthorizedError
_tagstringrequired
Allowed:UnauthorizedError
messagestringrequired
Request
curl -X GET "/api/vcs/diff?mode=working"
Response
{
  "location": {
    "directory": "string",
    "workspaceID": {},
    "project": {
      "id": "string",
      "directory": "string"
    }
  },
  "data": [
    {
      "file": "string",
      "patch": "string",
      "additions": {},
      "deletions": {},
      "status": "added"
    }
  ]
}