curl --request GET \
--url https://api.hacktron.ai/v1/pr-review-settings \
--header 'X-Api-Key: <api-key>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.hacktron.ai/v1/pr-review-settings"
headers = {
"X-Organization-Id": "<x-organization-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Organization-Id': '<x-organization-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.hacktron.ai/v1/pr-review-settings', 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.hacktron.ai/v1/pr-review-settings",
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-Api-Key: <api-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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.hacktron.ai/v1/pr-review-settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("X-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.hacktron.ai/v1/pr-review-settings")
.header("X-Organization-Id", "<x-organization-id>")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/pr-review-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scm_comments_enabled": true,
"scm_system_comments_enabled": true,
"fail_on_severity": "critical",
"scan_include_branches": [
"main",
"**/release/**"
],
"scan_exclude_branches": [
"**/release/legacy/**"
],
"scan_include_labels": [
"feature",
"bugfix"
],
"scan_exclude_labels": [
"wip",
"no-scan"
],
"scan_include_authors": [
"alice",
"bob"
],
"scan_exclude_authors": [
"dependabot[bot]",
"renovate[bot]",
"*-bot"
],
"scan_include_keywords": [
"release",
"security"
],
"scan_exclude_keywords": [
"[exclude hacktron]",
"wip"
]
}Get PR review settings
Read how PR reviews behave across your organization.
curl --request GET \
--url https://api.hacktron.ai/v1/pr-review-settings \
--header 'X-Api-Key: <api-key>' \
--header 'X-Organization-Id: <x-organization-id>'import requests
url = "https://api.hacktron.ai/v1/pr-review-settings"
headers = {
"X-Organization-Id": "<x-organization-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Organization-Id': '<x-organization-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.hacktron.ai/v1/pr-review-settings', 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.hacktron.ai/v1/pr-review-settings",
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-Api-Key: <api-key>",
"X-Organization-Id: <x-organization-id>"
],
]);
$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.hacktron.ai/v1/pr-review-settings"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("X-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.hacktron.ai/v1/pr-review-settings")
.header("X-Organization-Id", "<x-organization-id>")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/pr-review-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"scm_comments_enabled": true,
"scm_system_comments_enabled": true,
"fail_on_severity": "critical",
"scan_include_branches": [
"main",
"**/release/**"
],
"scan_exclude_branches": [
"**/release/legacy/**"
],
"scan_include_labels": [
"feature",
"bugfix"
],
"scan_exclude_labels": [
"wip",
"no-scan"
],
"scan_include_authors": [
"alice",
"bob"
],
"scan_exclude_authors": [
"dependabot[bot]",
"renovate[bot]",
"*-bot"
],
"scan_include_keywords": [
"release",
"security"
],
"scan_exclude_keywords": [
"[exclude hacktron]",
"wip"
]
}scm_comments_enabled: reviews post comments and finding details on pull and merge requests.scm_system_comments_enabled: reviews also post system comments, such as skipped reviews, usage limits and configuration warnings.fail_on_severity: the severity at or above which a finding fails the PR check, ornullwhen it never fails.scan_include_*andscan_exclude_*: which pull requests are reviewed, by target branch, label, author and title keyword.nullmeans no filter.
.hacktron/config.yaml takes precedence over these defaults. To check whether reviews are enabled for a repository, read its prScansEnabled value from List repositories.
readAuthorizations
Headers
Organization ID
Response
Whether Hacktron publishes comments and finding details to connected source control pull and merge requests
Whether Hacktron posts system comments such as skipped reviews, usage limits, and configuration warnings. Defaults to true. Requires scm_comments_enabled.
Org-wide default fail_on severity threshold for PR/MR checks. A repo's .hacktron/config.yaml fail_on.severity overrides this. Send null to disable.
critical, high, medium, low, info Org-wide default target branch patterns to scan PRs/MRs for (null = all branches). Glob patterns (*, **, ?, {a,b}), case-insensitive. A repo's .hacktron/config.yaml include.branches overrides this.
["main", "**/release/**"]
Org-wide default target branch patterns to exclude from PR/MR scans (null = none). Takes precedence over scan_include_branches. A repo's .hacktron/config.yaml exclude.branches overrides this.
["**/release/legacy/**"]
Org-wide default labels to require on PRs/MRs for scanning (null = any). A repo's .hacktron/config.yaml include.labels overrides this.
["feature", "bugfix"]
Org-wide default labels to exclude PR/MR scans for (null = none). Takes precedence over scan_include_labels. A repo's .hacktron/config.yaml exclude.labels overrides this.
["wip", "no-scan"]
Org-wide default author patterns to require on PRs/MRs for scanning (null = any). Glob patterns (*, **, ?, {a,b}), case-insensitive. A repo's .hacktron/config.yaml include.authors overrides this.
["alice", "bob"]
Org-wide default author patterns to exclude PR/MR scans for (null = none). Glob patterns (*, **, ?, {a,b}), case-insensitive. Takes precedence over scan_include_authors. A repo's .hacktron/config.yaml exclude.authors overrides this.
["dependabot[bot]", "renovate[bot]", "*-bot"]
Org-wide default title keywords to require on PRs/MRs for scanning (null = any). Case-insensitive substring match. A repo's .hacktron/config.yaml include.keywords overrides this.
["release", "security"]
Org-wide default title keywords to exclude PR/MR scans for (null = none). Case-insensitive substring match. A repo's .hacktron/config.yaml exclude.keywords overrides this.
["[exclude hacktron]", "wip"]
Was this page helpful?