List Policies
curl --request GET \
--url https://api.promptguard.co/api/v1/projects/{project_id}/policies \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.promptguard.co/api/v1/projects/{project_id}/policies"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.promptguard.co/api/v1/projects/{project_id}/policies', 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}/policies",
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>"
],
]);
$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.promptguard.co/api/v1/projects/{project_id}/policies"
req, _ := http.NewRequest("GET", url, nil)
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.promptguard.co/api/v1/projects/{project_id}/policies")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/projects/{project_id}/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"policies": [
{
"id": "b2a7c1de-90f4-4a6e-8f5b-3c1d7e2a9f10",
"user_id": "6a1f0c3e-7d2b-4c58-9e0a-1b2c3d4e5f60",
"name": "No codenames",
"description": null,
"policy_type": "input_filter",
"status": "active",
"priority": 100,
"rules": [
{
"condition": "contains_text",
"action": "block",
"value": "Project Nightingale"
}
],
"threat_types": [],
"is_default": false,
"triggered_count": 0,
"project_id": "910b6423-8a12-4461-a6bf-9148d9b6b8e3",
"system_prompt_details": null,
"created_at": "2026-12-01T09:00:00Z",
"updated_at": "2026-12-01T09:00:00Z",
"enforced": true,
"warnings": []
}
],
"has_more": false
}List Policies
The project’s policies, first to last in the order they are evaluated.
Guide: Configure a project
GET
/
api
/
v1
/
projects
/
{project_id}
/
policies
List Policies
curl --request GET \
--url https://api.promptguard.co/api/v1/projects/{project_id}/policies \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.promptguard.co/api/v1/projects/{project_id}/policies"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.promptguard.co/api/v1/projects/{project_id}/policies', 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}/policies",
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>"
],
]);
$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.promptguard.co/api/v1/projects/{project_id}/policies"
req, _ := http.NewRequest("GET", url, nil)
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.promptguard.co/api/v1/projects/{project_id}/policies")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.promptguard.co/api/v1/projects/{project_id}/policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"policies": [
{
"id": "b2a7c1de-90f4-4a6e-8f5b-3c1d7e2a9f10",
"user_id": "6a1f0c3e-7d2b-4c58-9e0a-1b2c3d4e5f60",
"name": "No codenames",
"description": null,
"policy_type": "input_filter",
"status": "active",
"priority": 100,
"rules": [
{
"condition": "contains_text",
"action": "block",
"value": "Project Nightingale"
}
],
"threat_types": [],
"is_default": false,
"triggered_count": 0,
"project_id": "910b6423-8a12-4461-a6bf-9148d9b6b8e3",
"system_prompt_details": null,
"created_at": "2026-12-01T09:00:00Z",
"updated_at": "2026-12-01T09:00:00Z",
"enforced": true,
"warnings": []
}
],
"has_more": false
}