Skip to main content
GET
/
api
/
repos
/
{repo_name}
/
diff
Get Commit Diff
curl --request GET \
  --url https://api.{cluster}.code.storage/api/repos/{repo_name}/diff \
  --header 'Authorization: Bearer <token>'
{
  "files": [
    {
      "bytes": 2048,
      "is_eof": true,
      "path": "src/main.go",
      "raw": "diff --git a/src/main.go b/src/main.go\n...",
      "state": "M"
    }
  ],
  "filtered_files": [
    {
      "bytes": 50000,
      "is_eof": true,
      "path": "package-lock.json",
      "state": "M"
    }
  ],
  "sha": "b003fc78805954584e1ee364a4ad39d7c79e819a",
  "stats": {
    "additions": 50,
    "changes": 60,
    "deletions": 10,
    "files": 3
  }
}

Documentation Index

Fetch the complete documentation index at: https://code.storage/docs/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 auth token.

Path Parameters

repo_name
string
required

Repository name. Names that contain / or any other character that is not safe in a URL path segment must be URL encoded so the value occupies a single path segment. For example pierre/example is sent as pierre%2Fexample. Plain names such as example can be sent as-is. The server URL-decodes the value before resolving the repository.

Query Parameters

sha
string
required

Commit SHA to diff.

baseSha
string

Optional base commit SHA to diff against. When omitted, the diff is generated against the commit's parent.

path
string[]

Optional repeated path filter. Provide multiple path query values to restrict the diff to specific files or directories.

Response

Full diff for the requested commit, including file-level stats and line-level hunks.

Diff for a single commit, including aggregate stats and per-file changes.

files
object[]
required

Files returned with inline diff content.

filtered_files
object[]
required

Files filtered out of inline diff output because of size or file-type rules.

sha
string
required

The commit SHA to diff.

Example:

"b003fc78805954584e1ee364a4ad39d7c79e819a"

stats
object
required

Aggregate diff statistics.