curl --request PATCH \
--url https://api.sazabi.com/v1/projects/{projectId}/code-review-settings \
--header 'Content-Type: application/json' \
--data '
{
"codeReviewEnabled": true,
"codeReviewOnPushEnabled": true,
"codeReviewApprovalEnabled": true,
"securityReviewEnabled": true,
"loggingReviewEnabled": true,
"loggingReviewDailyCommitLimit": 50,
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "jsmith@example.com"
}
'import requests
url = "https://api.sazabi.com/v1/projects/{projectId}/code-review-settings"
payload = {
"codeReviewEnabled": True,
"codeReviewOnPushEnabled": True,
"codeReviewApprovalEnabled": True,
"securityReviewEnabled": True,
"loggingReviewEnabled": True,
"loggingReviewDailyCommitLimit": 50,
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "jsmith@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
codeReviewEnabled: true,
codeReviewOnPushEnabled: true,
codeReviewApprovalEnabled: true,
securityReviewEnabled: true,
loggingReviewEnabled: true,
loggingReviewDailyCommitLimit: 50,
gitCommitAuthorName: '<string>',
gitCommitAuthorEmail: 'jsmith@example.com'
})
};
fetch('https://api.sazabi.com/v1/projects/{projectId}/code-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.sazabi.com/v1/projects/{projectId}/code-review-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'codeReviewEnabled' => true,
'codeReviewOnPushEnabled' => true,
'codeReviewApprovalEnabled' => true,
'securityReviewEnabled' => true,
'loggingReviewEnabled' => true,
'loggingReviewDailyCommitLimit' => 50,
'gitCommitAuthorName' => '<string>',
'gitCommitAuthorEmail' => 'jsmith@example.com'
]),
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.sazabi.com/v1/projects/{projectId}/code-review-settings"
payload := strings.NewReader("{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sazabi.com/v1/projects/{projectId}/code-review-settings")
.header("Content-Type", "application/json")
.body("{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sazabi.com/v1/projects/{projectId}/code-review-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codeReviewEnabled": true,
"codeReviewOnPushEnabled": true,
"codeReviewApprovalEnabled": true,
"securityReviewEnabled": true,
"loggingReviewEnabled": true,
"loggingReviewMode": "suggest",
"loggingReviewDailyCommitLimit": 4503599627370495,
"gitCommitAuthorMode": "default",
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "<string>"
}Update code review settings
Change any of a project’s Settings > Code fields; an omitted field is left unchanged and at least one must be sent. Turning on code review, review on push, pull request approval or Logging review needs the plan’s code-review entitlement and code review to be available for the project. A custom git commit author needs both a name and an email. User credentials require settings:write permission in the project and the organization.
curl --request PATCH \
--url https://api.sazabi.com/v1/projects/{projectId}/code-review-settings \
--header 'Content-Type: application/json' \
--data '
{
"codeReviewEnabled": true,
"codeReviewOnPushEnabled": true,
"codeReviewApprovalEnabled": true,
"securityReviewEnabled": true,
"loggingReviewEnabled": true,
"loggingReviewDailyCommitLimit": 50,
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "jsmith@example.com"
}
'import requests
url = "https://api.sazabi.com/v1/projects/{projectId}/code-review-settings"
payload = {
"codeReviewEnabled": True,
"codeReviewOnPushEnabled": True,
"codeReviewApprovalEnabled": True,
"securityReviewEnabled": True,
"loggingReviewEnabled": True,
"loggingReviewDailyCommitLimit": 50,
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "jsmith@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
codeReviewEnabled: true,
codeReviewOnPushEnabled: true,
codeReviewApprovalEnabled: true,
securityReviewEnabled: true,
loggingReviewEnabled: true,
loggingReviewDailyCommitLimit: 50,
gitCommitAuthorName: '<string>',
gitCommitAuthorEmail: 'jsmith@example.com'
})
};
fetch('https://api.sazabi.com/v1/projects/{projectId}/code-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.sazabi.com/v1/projects/{projectId}/code-review-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'codeReviewEnabled' => true,
'codeReviewOnPushEnabled' => true,
'codeReviewApprovalEnabled' => true,
'securityReviewEnabled' => true,
'loggingReviewEnabled' => true,
'loggingReviewDailyCommitLimit' => 50,
'gitCommitAuthorName' => '<string>',
'gitCommitAuthorEmail' => 'jsmith@example.com'
]),
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.sazabi.com/v1/projects/{projectId}/code-review-settings"
payload := strings.NewReader("{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sazabi.com/v1/projects/{projectId}/code-review-settings")
.header("Content-Type", "application/json")
.body("{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sazabi.com/v1/projects/{projectId}/code-review-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"codeReviewEnabled\": true,\n \"codeReviewOnPushEnabled\": true,\n \"codeReviewApprovalEnabled\": true,\n \"securityReviewEnabled\": true,\n \"loggingReviewEnabled\": true,\n \"loggingReviewDailyCommitLimit\": 50,\n \"gitCommitAuthorName\": \"<string>\",\n \"gitCommitAuthorEmail\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"codeReviewEnabled": true,
"codeReviewOnPushEnabled": true,
"codeReviewApprovalEnabled": true,
"securityReviewEnabled": true,
"loggingReviewEnabled": true,
"loggingReviewMode": "suggest",
"loggingReviewDailyCommitLimit": 4503599627370495,
"gitCommitAuthorMode": "default",
"gitCommitAuthorName": "<string>",
"gitCommitAuthorEmail": "<string>"
}Path Parameters
Project ID to fetch.
Body
Master switch for code review. Needs the plan's code-review entitlement to turn on.
Review new changes pushed to a pull request, not only when it opens. Needs the code-review entitlement to turn on.
Approve pull requests that review finds nothing to fix in. Needs the code-review entitlement to turn on.
Run the automatic security review of this project's changes.
Turn Logging review on or off. Needs the code-review entitlement to turn on.
How Logging review delivers changes: suggest, on_demand or auto_commit.
suggest, on_demand, auto_commit Most auto-commits Logging review makes per day (1 to 100); null removes the limit.
1 <= x <= 100default commits as Sazabi; custom uses gitCommitAuthorName and gitCommitAuthorEmail, which must then both be sent.
default, custom 1 - 255320Response
OK
Master switch: when off, Sazabi never reviews pull requests for this project.
Review new changes pushed to a pull request, not only when it opens.
Approve pull requests that review finds nothing to fix in.
Run the automatic security review of this project's changes.
Logging review: review pull requests for missing or weak logging.
How Logging review delivers changes (only used while it is enabled).
suggest, on_demand, auto_commit Most auto-commits Logging review makes per day in auto_commit mode; null for no limit.
0 < x <= 9007199254740991default commits as Sazabi; custom uses the name and email.
default, custom