Update Project Settings
curl --request PATCH \
--url https://api.promptguard.co/api/v1/projects/{project_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"use_case": "<string>",
"zero_retention": true,
"agent_policy_enforced": true
}
'import requests
url = "https://api.promptguard.co/api/v1/projects/{project_id}"
payload = {
"name": "<string>",
"description": "<string>",
"use_case": "<string>",
"zero_retention": True,
"agent_policy_enforced": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
use_case: '<string>',
zero_retention: true,
agent_policy_enforced: true
})
};
fetch('https://api.promptguard.co/api/v1/projects/{project_id}', 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.promptguard.co/api/v1/projects/{project_id}",
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([
'name' => '<string>',
'description' => '<string>',
'use_case' => '<string>',
'zero_retention' => true,
'agent_policy_enforced' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/projects/{project_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.promptguard.co/api/v1/projects/{project_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/projects/{project_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "910b6423-8a12-4461-a6bf-9148d9b6b8e3",
"name": "support-chatbot",
"description": "Customer support assistant",
"fail_mode": "closed",
"use_case": "support_bot",
"strictness_level": "strict",
"zero_retention": true,
"enforcement_mode": "enforce",
"spotlight_mode": null,
"agent_policy_enforced": false
}Update Project Settings
Change a project’s settings.
With a CLI sign-in or a key marked for an agent, refused with
approval_required until your user approves it, unless it changes nothing.
A change of use_case or strictness_level also lists every guardrail it
loosens, judged as PUT .../guardrails judges one.
Guide: Configure a project
PATCH
/
api
/
v1
/
projects
/
{project_id}
Update Project Settings
curl --request PATCH \
--url https://api.promptguard.co/api/v1/projects/{project_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"use_case": "<string>",
"zero_retention": true,
"agent_policy_enforced": true
}
'import requests
url = "https://api.promptguard.co/api/v1/projects/{project_id}"
payload = {
"name": "<string>",
"description": "<string>",
"use_case": "<string>",
"zero_retention": True,
"agent_policy_enforced": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
use_case: '<string>',
zero_retention: true,
agent_policy_enforced: true
})
};
fetch('https://api.promptguard.co/api/v1/projects/{project_id}', 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.promptguard.co/api/v1/projects/{project_id}",
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([
'name' => '<string>',
'description' => '<string>',
'use_case' => '<string>',
'zero_retention' => true,
'agent_policy_enforced' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.promptguard.co/api/v1/projects/{project_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.promptguard.co/api/v1/projects/{project_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/projects/{project_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"use_case\": \"<string>\",\n \"zero_retention\": true,\n \"agent_policy_enforced\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "910b6423-8a12-4461-a6bf-9148d9b6b8e3",
"name": "support-chatbot",
"description": "Customer support assistant",
"fail_mode": "closed",
"use_case": "support_bot",
"strictness_level": "strict",
"zero_retention": true,
"enforcement_mode": "enforce",
"spotlight_mode": null,
"agent_policy_enforced": false
}Authorizations
Headers
Body
application/json
The settings to change. One left out stays as it is.