Skip to content

Diff one file

GET
/api/orgs/{org}/projects/{project}/diff/file
curl --request GET \
--url 'https://api.wrktr.com/api/orgs/example/projects/example/diff/file?from=example&to=example&path=example' \
--header 'Authorization: Bearer <token>'

One file’s hunks between two commits (a branch diff’s fromSha and toSha). The response never changes for the same three values.

org
required
string
project
required
string
from
required
string
to
required
string
path
required
string

FileDiff

Media typeapplication/json
object
path
required
string
status
required
string
Allowed values: added deleted modified
binary
required
boolean
tooLarge
required
boolean
hunks
required
Array<object>
object
oldStart
required
Any of:
number
oldLines
required
Any of:
number
newStart
required
Any of:
number
newLines
required
Any of:
number
lines
required
Array<object>
object
kind
required
string
Allowed values: context add del
text
required
string
oldLine
required
Any of:
Any of:
number
newLine
required
Any of:
Any of:
number
Example
{
"status": "added",
"hunks": [
{
"oldStart": "Infinity",
"oldLines": "Infinity",
"newStart": "Infinity",
"newLines": "Infinity",
"lines": [
{
"kind": "context",
"oldLine": "Infinity",
"newLine": "Infinity"
}
]
}
]
}

Unauthorized

Media typeapplication/json
object
_tag
required
string
Allowed values: Unauthorized
message
required
string
Example
{
"_tag": "Unauthorized"
}

ProjectNotFound | PathNotInDiff

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ProjectNotFound
project
required
string
Example
{
"_tag": "ProjectNotFound"
}