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>"
        }
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.sourcebot.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your API key.

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.

path
string

Restrict the diff to changes touching this file path. Omit to diff all changes between the two refs.

Response

Structured diff between the two refs.

files
object[]
required

The list of changed files.