SBOM(소프트웨어 자료 청구서)에 대한 REST API 엔드포인트
REST API를 사용하여 리포지토리에 대한 SBOM(소프트웨어 제품 구성 정보)을 내보냅니다.
리포지토리에 대한 최소한의 읽기 권한이 있는 경우 GitHub UI 또는 GitHub REST API를 통해 리포지토리에 대한 종속성 그래프를 SPDX 호환 SBOM(Software Bill of Materials)으로 내보낼 수 있습니다. 자세한 내용은 리포지토리에 대한 소프트웨어 자료 청구서 내보내기을(를) 참조하세요.
이 문서에서는 REST API 엔드포인트에 대한 세부 정보를 제공합니다.
Export a software bill of materials (SBOM) for a repository.
Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.
"Export a software bill of materials (SBOM) for a repository."에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Contents" repository permissions (read)
공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.
"Export a software bill of materials (SBOM) for a repository."에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
"Export a software bill of materials (SBOM) for a repository."에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | OK |
403 | Forbidden |
404 | Resource not found |
"Export a software bill of materials (SBOM) for a repository."에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbomResponse
Status: 200{
"sbom": {
"SPDXID": "SPDXRef-DOCUMENT",
"spdxVersion": "SPDX-2.3",
"creationInfo": {
"created": "2021-09-01T00:00:00Z",
"creators": [
"Tool: GitHub.com-Dependency-Graph"
]
},
"name": "github/example",
"dataLicense": "CC0-1.0",
"documentNamespace": "https://spdx.org/spdxdocs/protobom/15e41dd2-f961-4f4d-b8dc-f8f57ad70d57",
"packages": [
{
"name": "rails",
"SPDXID": "SPDXRef-Package",
"versionInfo": "1.0.0",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "MIT",
"licenseDeclared": "MIT",
"copyrightText": "Copyright (c) 1985 GitHub.com",
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:gem/[email protected]"
}
]
},
{
"name": "github/example",
"SPDXID": "SPDXRef-Repository",
"versionInfo": "main",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"externalRefs": [
{
"referenceCategory": "PACKAGE-MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:github/example@main"
}
]
}
],
"relationships": [
{
"relationshipType": "DEPENDS_ON",
"spdxElementId": "SPDXRef-Repository",
"relatedSpdxElement": "SPDXRef-Package"
},
{
"relationshipType": "DESCRIBES",
"spdxElementId": "SPDXRef-DOCUMENT",
"relatedSpdxElement": "SPDXRef-Repository"
}
]
}
}Fetch a software bill of materials (SBOM) for a repository.
Fetches a previously generated software bill of materials (SBOM) for a repository. When the SBOM is ready, the response is a 302 redirect to a temporary download URL for the SBOM in SPDX JSON format. The generated SBOM report may be retained for up to one week from the original request. The temporary download URL returned by this endpoint expires separately, and its expiry is set when the fetch request is made.
"Fetch a software bill of materials (SBOM) for a repository."에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Contents" repository permissions (read)
공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.
"Fetch a software bill of materials (SBOM) for a repository."에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
sbom_uuid string 필수The unique identifier of the SBOM export. |
"Fetch a software bill of materials (SBOM) for a repository."에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
202 | SBOM is still being processed, no content is returned. |
302 | Redirects to a temporary download URL for the completed SBOM. |
403 | Forbidden |
404 | Resource not found |
"Fetch a software bill of materials (SBOM) for a repository."에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/fetch-report/SBOM_UUIDSBOM is still being processed, no content is returned.
Status: 202Request generation of a software bill of materials (SBOM) for a repository.
Triggers a job to generate a software bill of materials (SBOM) for a repository in SPDX JSON format.
"Request generation of a software bill of materials (SBOM) for a repository."에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰은 필수 권한 집합을 포함해야 합니다.:
- "Contents" repository permissions (read)
공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.
"Request generation of a software bill of materials (SBOM) for a repository."에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
accept string Setting to |
| 이름, 유형, 설명 |
|---|
owner string 필수The account owner of the repository. The name is not case sensitive. |
repo string 필수The name of the repository without the |
"Request generation of a software bill of materials (SBOM) for a repository."에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
201 | Created |
403 | Forbidden |
404 | Resource not found |
"Request generation of a software bill of materials (SBOM) for a repository."에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/generate-reportResponse
Status: 201{
"sbom_url": "https://api.github.com/repos/github/example/dependency-graph/sbom/fetch-report/4bab1a7e-da63-4828-9488-44e0e01a7c1b"
}