Switch PR checks or fix PRs on or off for a repository
curl --request PATCH \
--url https://app.trustivan.com/api/v1/assets/{id}/code-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pr_checks_enabled": true,
"fix_prs_enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/code-settings"
payload = {
"pr_checks_enabled": True,
"fix_prs_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({pr_checks_enabled: true, fix_prs_enabled: true})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}/code-settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/code-settings"
payload := strings.NewReader("{\n \"pr_checks_enabled\": true,\n \"fix_prs_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Switch PR checks or fix PRs on or off for a repo
Requires assets:write. Both are off until switched on.
PATCH
/
assets
/
{id}
/
code-settings
Switch PR checks or fix PRs on or off for a repository
curl --request PATCH \
--url https://app.trustivan.com/api/v1/assets/{id}/code-settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pr_checks_enabled": true,
"fix_prs_enabled": true
}
'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/code-settings"
payload = {
"pr_checks_enabled": True,
"fix_prs_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({pr_checks_enabled: true, fix_prs_enabled: true})
};
fetch('https://app.trustivan.com/api/v1/assets/{id}/code-settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/code-settings"
payload := strings.NewReader("{\n \"pr_checks_enabled\": true,\n \"fix_prs_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The updated settings, as GET returns them.