Projects
Replace scope rules
Saves the rule set and syncs the assets the rules add or no longer select.
PUT
/
api
/
projects
/
{id}
/
scope-rules
Replace scope rules
curl --request PUT \
--url https://{baseUrl}/api/v1/api/projects/{id}/scope-rules \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
{
"value": "*.example.com"
}
]
}
'import requests
url = "https://{baseUrl}/api/v1/api/projects/{id}/scope-rules"
payload = { "rules": [{ "value": "*.example.com" }] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({rules: [{value: '*.example.com'}]})
};
fetch('https://{baseUrl}/api/v1/api/projects/{id}/scope-rules', 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://{baseUrl}/api/v1/api/projects/{id}/scope-rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"value\": \"*.example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"added": 123,
"removed": 123
}⌘I
Replace scope rules
curl --request PUT \
--url https://{baseUrl}/api/v1/api/projects/{id}/scope-rules \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
{
"value": "*.example.com"
}
]
}
'import requests
url = "https://{baseUrl}/api/v1/api/projects/{id}/scope-rules"
payload = { "rules": [{ "value": "*.example.com" }] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({rules: [{value: '*.example.com'}]})
};
fetch('https://{baseUrl}/api/v1/api/projects/{id}/scope-rules', 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://{baseUrl}/api/v1/api/projects/{id}/scope-rules"
payload := strings.NewReader("{\n \"rules\": [\n {\n \"value\": \"*.example.com\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"added": 123,
"removed": 123
}