Skip to main content
POST
/
api
/
analysis
/
results
/
sbom
Get SBOM Results
curl --request POST \
  --url https://api.codeant.ai/api/analysis/results/sbom \
  --header 'Content-Type: application/json' \
  --data '
{
  "repo": "owner/repository",
  "commit_id": "abc123def456",
  "access_token": "ghp_xxxxxxxxxxxx",
  "service": "github"
}
'
import requests

url = "https://api.codeant.ai/api/analysis/results/sbom"

payload = {
"repo": "owner/repository",
"commit_id": "abc123def456",
"access_token": "ghp_xxxxxxxxxxxx",
"service": "github"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
repo: 'owner/repository',
commit_id: 'abc123def456',
access_token: 'ghp_xxxxxxxxxxxx',
service: 'github'
})
};

fetch('https://api.codeant.ai/api/analysis/results/sbom', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.codeant.ai/api/analysis/results/sbom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'repo' => 'owner/repository',
'commit_id' => 'abc123def456',
'access_token' => 'ghp_xxxxxxxxxxxx',
'service' => 'github'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.codeant.ai/api/analysis/results/sbom"

payload := strings.NewReader("{\n \"repo\": \"owner/repository\",\n \"commit_id\": \"abc123def456\",\n \"access_token\": \"ghp_xxxxxxxxxxxx\",\n \"service\": \"github\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.codeant.ai/api/analysis/results/sbom")
.header("Content-Type", "application/json")
.body("{\n \"repo\": \"owner/repository\",\n \"commit_id\": \"abc123def456\",\n \"access_token\": \"ghp_xxxxxxxxxxxx\",\n \"service\": \"github\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.codeant.ai/api/analysis/results/sbom")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"repo\": \"owner/repository\",\n \"commit_id\": \"abc123def456\",\n \"access_token\": \"ghp_xxxxxxxxxxxx\",\n \"service\": \"github\"\n}"

response = http.request(request)
puts response.read_body
{
  "results": {
    "rootFolder": "/mnt/lambda/owner/repository/abc123def456",
    "timestamp": null,
    "sboms": [
      {
        "language": "Python",
        "sourceFile": "/tmp/requirements.txt",
        "packages": [
          {
            "name": "requests",
            "version": "2.28.0",
            "licenseDeclared": "Apache-2.0",
            "licenseConcluded": "Apache-2.0",
            "licenseReason": "NOASSERTION",
            "licenseStandard": true,
            "copyleftStrength": "permissive",
            "policyLevel": "allow",
            "policyNote": "Permissive license: keep license and notices",
            "spdxId": "Apache-2.0"
          }
        ],
        "packagesCount": 1
      }
    ]
  },
  "status": "done",
  "commit_id": "abc123def456"
}
{
"error": "Access token invalid"
}
{
"error": "Error retrieving SBOM results"
}

Body

application/json
repo
string
required

Repository identifier (format varies by service)

Example:

"owner/repository"

access_token
string
required

Authentication token for the service

Example:

"ghp_xxxxxxxxxxxx"

service
enum<string>
required

Version control service provider

Available options:
github,
azuredevops,
gitlab,
bitbucket
Example:

"github"

commit_id
string

Git commit SHA or identifier. Either commit_id or branch is required. If both are provided, commit_id takes precedence.

Example:

"abc123def456"

branch
string

Git branch name. When provided without commit_id, the service resolves the latest commit from scan history for this branch. Either commit_id or branch is required.

Example:

"main"

gitlab_base_url
string

Base URL for the service (optional for GitHub, required for GitLab)

Example:

"https://gitlab.com"

Response

SBOM results retrieved successfully

Software Bill of Materials (SBOM) response containing package and license information

results
object

SBOM analysis results

status
enum<string>

Status of the SBOM analysis

Available options:
pending,
processing,
done,
failed
Example:

"done"

commit_id
string

Git commit SHA that was analyzed

Example:

"abc123def456"