Skip to main content
GET
/
api
/
diff
Get diff between two commits
curl --request GET \
  --url https://api.example.com/api/diff \
  --header 'Authorization: Bearer <token>'
{
  "files": [
    {
      "oldPath": "<string>",
      "newPath": "<string>",
      "hunks": [
        {
          "oldRange": {
            "start": 123,
            "lines": 123
          },
          "newRange": {
            "start": 123,
            "lines": 123
          },
          "body": "<string>",
          "heading": "<string>"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Send either a Sourcebot API key (sbk_... or legacy sourcebot-...) or, on EE instances with OAuth enabled, an OAuth access token (sboa_...) in the Authorization header.

Query Parameters

repo
string
required

The fully-qualified repository name.

base
string
required

The base git ref (branch, tag, or commit SHA) to diff from.

head
string
required

The head git ref (branch, tag, or commit SHA) to diff to.

Response

Structured diff between the two refs.

files
object[]
required

The list of changed files.