Skip to content

A bounded content diff between two refs of one repository owned by a configured source (501 when no git-host diff reader is wired; 422 when the diff exceeds the read cap)

GET
/v1/console/sources/diff
curl --request GET \
--url 'https://example.com/v1/console/sources/diff?source=example&host=github&repository=example&base=example&head=example' \
--header 'Authorization: Bearer <token>'

Returns one bounded content diff between two refs of a repository owned by a configured source, on GitHub or GitLab. 501 when no git-host diff reader is wired, 422 when the diff exceeds the read cap, 503 with Retry-After when the host rate-limits the read.

source
required
string
>= 1 characters

The configured source’s name.

host
required
string
Allowed values: github gitlab

The git host.

repository
required
string
>= 1 characters

The repository (owner/name).

base
required
string
>= 1 characters

The base ref.

head
required
string
>= 1 characters

The head ref.

OK

Media type application/json
object
files
required
Array<object>
object
binary
required
boolean
hunks
required
Array<string>
path
required
string
previous_path

Set on a rename.

string
status
required
string
truncated
required
boolean
head_commit
required
string
head_tree
string
truncated
required

The diff exceeded the read cap and was cut.

boolean
Example generated
{
"files": [
{
"binary": true,
"hunks": [
"example"
],
"path": "example",
"previous_path": "example",
"status": "example",
"truncated": true
}
],
"head_commit": "example",
"head_tree": "example",
"truncated": true
}

Bad request

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}

Unauthenticated

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}

Forbidden

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}

Not found

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}

Conflict / setup required

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}

Rate limited

Media type application/json
object
error
required
object
code
required
string
message
required
string
module

With code module_not_enabled: the namespace of the module this node does not run.

string
Example generated
{
"error": {
"code": "example",
"message": "example",
"module": "example"
}
}