curl --request GET \
--url https://api.coderabbit.ai/v1/bug-scan/findings \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/bug-scan/findings"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/bug-scan/findings', 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.coderabbit.ai/v1/bug-scan/findings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-coderabbitai-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/bug-scan/findings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/bug-scan/findings")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/bug-scan/findings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"state": "open",
"dismiss_reason": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fingerprint": "<string>",
"severity": "critical",
"category": "<string>",
"path": "<string>",
"start_line": 123,
"end_line": 123,
"locations": [
{
"path": "<string>",
"start_line": 123,
"end_line": 123,
"role": "anchor"
}
],
"explanation": "<string>",
"agent_prompt": "<string>",
"verification": {
"status": "verified",
"result": "<string>",
"evidence": "<string>"
},
"rank": 123,
"organization_id": "<string>",
"organization_name": "<string>",
"repository_id": "<string>",
"repository_name": "<string>",
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"next_cursor": "<string>",
"scan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"head_commit": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"partial_coverage": true
}
}List or export Bug Scan findings
Returns one repository’s Bug Scan findings from its latest completed scan, or from scan_id. Cursor-paginated JSON by default; CSV and SARIF 2.1.0 download every matching finding of the scan (up to 50,000 records and 16 MB). Findings are in the scan’s rank order. Each finding carries its fingerprint, severity, category, location, every location it applies to, explanation, the prompt for AI agents, the verifier’s account, and its state (open, fixed or dismissed) with the dismiss reason. Requires a non-agentic API key with bug_scan:read permission, and Bug Scan enabled for the organization; other organizations receive 403 BUG_SCAN_NOT_ENABLED.
curl --request GET \
--url https://api.coderabbit.ai/v1/bug-scan/findings \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/bug-scan/findings"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/bug-scan/findings', 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.coderabbit.ai/v1/bug-scan/findings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-coderabbitai-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/bug-scan/findings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/bug-scan/findings")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/bug-scan/findings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"state": "open",
"dismiss_reason": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fingerprint": "<string>",
"severity": "critical",
"category": "<string>",
"path": "<string>",
"start_line": 123,
"end_line": 123,
"locations": [
{
"path": "<string>",
"start_line": 123,
"end_line": 123,
"role": "anchor"
}
],
"explanation": "<string>",
"agent_prompt": "<string>",
"verification": {
"status": "verified",
"result": "<string>",
"evidence": "<string>"
},
"rank": 123,
"organization_id": "<string>",
"organization_name": "<string>",
"repository_id": "<string>",
"repository_name": "<string>",
"scan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"next_cursor": "<string>",
"scan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"head_commit": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"partial_coverage": true
}
}Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Query Parameters
Git-provider organization ID for workspace API keys. Omit for the complete workspace scope.
One exact Git-provider repository ID in the authenticated organization scope.
A completed scan of the repository. Defaults to the latest completed scan.
critical, major, minor, trivial JSON page size.
1 <= x <= 1000next_cursor from the previous JSON page. A cursor stays on the scan it was issued for.
json, csv, sarif Was this page helpful?