Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

JWT bearer token signed with your organization's registered signing key. There is no OAuth authorization server; you mint tokens yourself and the token's scopes claim carries the granted permission scopes. Public scopes: git:read (read repository contents), git:write (write branches, commits, tags, and notes), repo:write (create and manage repositories), org:read (list an organization's repositories). Each operation's security requirement names the scopes it requires. See https://code.storage/docs/getting-started/authentication for how to mint tokens.

Path Parameters

repo_name
string
required

The repository name, for example acme/web.

Query Parameters

ref
string

Branch, tag, or commit to diff. Provide ref or the deprecated sha.

sha
string

Deprecated: use ref instead. Commit SHA to diff.

base_ref
string

Optional base branch, tag, or commit to diff against. When omitted, the diff is generated against the commit's parent. When set, the diff starts at the merge base of base_ref and ref, as git diff base_ref...ref does, and merge_base_sha gives that commit. So the diff holds only the changes on ref after the two histories split. When ref is an ancestor of base_ref, the merge base is ref, and the diff is empty. Provide base_ref or the deprecated baseSha.

baseSha
string

Deprecated: use base_ref instead. Optional base commit SHA to diff against. When omitted, the diff is generated against the commit's parent.

ref_is_ephemeral
boolean

Whether ref should be resolved from the ephemeral namespace.

base_is_ephemeral
boolean

Whether base_ref should be resolved from the ephemeral namespace.

path
string[]

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

git_apply_compatible
boolean

When enabled, concatenate files[].raw in response order and apply the result against the selected base with git apply. Changes listed in filtered_files are not included in the patch. Defaults to false, preserving review-oriented whitespace suppression. Provide git_apply_compatible or the deprecated gitApplyCompatible.

gitApplyCompatible
boolean

Deprecated: use git_apply_compatible instead. When enabled, concatenate files[].raw in response order and apply the result against the selected base with git apply. Changes listed in filtered_files are not included in the patch. Defaults to false, preserving review-oriented whitespace suppression.

Response

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

Diff for a single commit, including merge base when applicable, 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.

base_sha
string

The commit that the base revision (base_ref) resolved to. Empty for a single-commit diff. Use it to record the exact base of the comparison.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"

merge_base_sha
string

The merge base of base_ref and ref: the commit where the diff starts. Empty for a single-commit diff.

Example:

"a2d127e6a4d54bb7390de828a99e36411f0c84df"