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)
const url = 'https://example.com/v1/console/sources/diff?source=example&host=github&repository=example&base=example&head=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “ Query Parameters ”The configured source’s name.
The git host.
The repository (owner/name).
The base ref.
The head ref.
Responses
Section titled “ Responses ”OK
object
object
Set on a rename.
The diff exceeded the read cap and was cut.
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
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Unauthenticated
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Forbidden
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Not found
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Conflict / setup required
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}Rate limited
object
object
With code module_not_enabled: the namespace of the module this node does not run.
Example generated
{ "error": { "code": "example", "message": "example", "module": "example" }}