{"meta":{"title":"REST API endpoints for software bill of materials (SBOM)","intro":"Use the REST API to export the software bill of materials (SBOM) for a repository.","product":"REST API","breadcrumbs":[{"href":"/en/rest","title":"REST API"},{"href":"/en/rest/dependency-graph","title":"Dependency graph"},{"href":"/en/rest/dependency-graph/sboms","title":"Software bill of materials (SBOM)"}],"documentType":"article"},"body":"# REST API endpoints for software bill of materials (SBOM)\n\nUse the REST API to export the software bill of materials (SBOM) for a repository.\n\nIf you have at least read access to the repository, you can export the dependency graph for the repository as an SPDX-compatible, Software Bill of Materials (SBOM), via the GitHub UI or GitHub REST API. For more information, see [Exporting a software bill of materials for your repository](/en/code-security/how-tos/secure-your-supply-chain/establish-provenance-and-integrity/export-dependencies-as-sbom).\n\nThis article gives details about the REST API endpoint.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Export a software bill of materials (SBOM) for a repository.\n\n```\nGET /repos/{owner}/{repo}/dependency-graph/sbom\n```\n\nWarning\n\nClosing down notice: This operation is closing down and will not be accessible after November 13, 2026. Please migrate to the asynchronous flow. Use \"Request generation of a software bill of materials (SBOM) for a repository\" to trigger the report, then \"Fetch a software bill of materials (SBOM) for a repository\" to retrieve it. For more information, see the changelog.\n\nExports the software bill of materials (SBOM) for a repository in SPDX JSON format.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom\n```\n\n**Response schema (Status: 200):**\n\n* `sbom`: required, object:\n  * `SPDXID`: required, string\n  * `spdxVersion`: required, string\n  * `comment`: string\n  * `creationInfo`: required, object:\n    * `created`: required, string\n    * `creators`: required, array of string\n  * `name`: required, string\n  * `dataLicense`: required, string\n  * `documentNamespace`: required, string\n  * `packages`: required, array of objects:\n    * `SPDXID`: string\n    * `name`: string\n    * `versionInfo`: string\n    * `downloadLocation`: string\n    * `filesAnalyzed`: boolean\n    * `licenseConcluded`: string\n    * `licenseDeclared`: string\n    * `supplier`: string\n    * `copyrightText`: string\n    * `externalRefs`: array of objects:\n      * `referenceCategory`: required, string\n      * `referenceLocator`: required, string\n      * `referenceType`: required, string\n  * `relationships`: array of objects:\n    * `relationshipType`: string\n    * `spdxElementId`: string\n    * `relatedSpdxElement`: string\n\n## Fetch a software bill of materials (SBOM) for a repository.\n\n```\nGET /repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}\n```\n\nFetches a previously generated software bill of materials (SBOM) for a repository.\nWhen the SBOM is ready, the response is a 302 redirect to a temporary download URL for the SBOM in SPDX JSON format.\nThe generated SBOM report may be retained for up to one week from the original request.\nThe temporary download URL returned by this endpoint expires separately, and its expiry is set when the fetch request is made.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`sbom_uuid`** (string) (required)\n  The unique identifier of the SBOM export.\n\n### HTTP response status codes\n\n* **202** - SBOM is still being processed, no content is returned.\n\n* **302** - Redirects to a temporary download URL for the completed SBOM.\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/fetch-report/SBOM_UUID\n```\n\n**Response schema (Status: 202):**\n\n## Request generation of a software bill of materials (SBOM) for a repository.\n\n```\nGET /repos/{owner}/{repo}/dependency-graph/sbom/generate-report\n```\n\nTriggers a job to generate a software bill of materials (SBOM) for a repository in SPDX JSON format.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/generate-report\n```\n\n**Response schema (Status: 201):**\n\n* `sbom_url`: string"}