Skip to main content
POST
/
api
/
agents
/
scan
/
results
Get Agent Scan Results
curl --request POST \
  --url https://api.codeant.ai/api/agents/scan/results \
  --header 'Content-Type: application/json' \
  --data '
{
  "repo": "owner/repository",
  "scanId": "aB3xK9mP2q"
}
'
import requests

url = "https://api.codeant.ai/api/agents/scan/results"

payload = {
"repo": "owner/repository",
"scanId": "aB3xK9mP2q"
}
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', scanId: 'aB3xK9mP2q'})
};

fetch('https://api.codeant.ai/api/agents/scan/results', 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/agents/scan/results",
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',
'scanId' => 'aB3xK9mP2q'
]),
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/agents/scan/results"

payload := strings.NewReader("{\n \"repo\": \"owner/repository\",\n \"scanId\": \"aB3xK9mP2q\"\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/agents/scan/results")
.header("Content-Type", "application/json")
.body("{\n \"repo\": \"owner/repository\",\n \"scanId\": \"aB3xK9mP2q\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.codeant.ai/api/agents/scan/results")

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 \"scanId\": \"aB3xK9mP2q\"\n}"

response = http.request(request)
puts response.read_body
{
  "scanId": "aB3xK9mP2q",
  "repoName": "owner/repository",
  "status": "completed",
  "results": [
    {
      "file": "src/auth/login.py",
      "scan_id": "aB3xK9mP2q",
      "issues": [
        {
          "relevant_file": "src/auth/login.py",
          "language": "python",
          "suggestion_content": "The `authenticate` function does not validate the length of the password parameter before passing it to the bcrypt hashing function. Extremely long passwords (>72 bytes) are silently truncated by bcrypt, which could lead to collision vulnerabilities.",
          "start_line": 45,
          "end_line": 52,
          "one_sentence_summary": "Password length not validated before bcrypt hashing",
          "label": "Security",
          "severity": "medium",
          "cwe_id": "CWE-916",
          "agent_instructions": "threat_hunting"
        }
      ]
    }
  ],
  "totalIssues": 1
}

Body

application/json
repo
string
required

Repository identifier

Example:

"owner/repository"

scanId
string
required

Scan identifier returned from the start scan endpoint

Example:

"aB3xK9mP2q"

Response

Scan results retrieved successfully

scanId
string

Scan identifier

Example:

"aB3xK9mP2q"

repoName
string

Repository name

Example:

"owner/repository"

status
enum<string>

Current status of the scan

Available options:
completed,
in_progress
Example:

"completed"

results
object[]

List of file results with issues found

totalIssues
integer

Total number of deduplicated issues found across all files

Example:

5