← All tags

Dependency-Graph API Reference

Endpoints to access Dependency Graph features.

5 endpoints tagged dependency-graph, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

Get a diff of the dependencies between commits

GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}

Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
baseheadpathyesThe base and head Git revisions to compare. The Git revisions will be resolved to commit SHAs. Named revisions will be resolved to their corresponding HEAD commits, and an appropriate merge base will be determined. This parameter expects the format {base}...{head}.
namequerynoThe full path, relative to the repository root, of the dependency manifest file.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Response for a private repository when GitHub Advanced Security is not enabled, or if used against a forkyes
400Bad Requestyes
500Internal Erroryes
503Service unavailableyes

Export a software bill of materials (SBOM) for a repository.

GET /repos/{owner}/{repo}/dependency-graph/sbom

Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Forbiddenyes

Fetch a software bill of materials (SBOM) for a repository.

GET /repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}

Fetches a previously generated software bill of materials (SBOM) for a repository.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
sbom_uuidpathyesThe unique identifier of the SBOM export.

Responses

StatusDescriptionHas JSON body
302Redirects to a temporary download URL for the completed SBOM.no
202SBOM is still being processed, no content is returned.no
404Resource not foundyes
403Forbiddenyes

Request generation of a software bill of materials (SBOM) for a repository.

GET /repos/{owner}/{repo}/dependency-graph/sbom/generate-report

Triggers a job to generate a software bill of materials (SBOM) for a repository in SPDX JSON format.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes
404Resource not foundyes
403Forbiddenyes

Create a snapshot of dependencies for a repository

POST /repos/{owner}/{repo}/dependency-graph/snapshots

Create a new snapshot of a repository's dependencies.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes