List Guardrails
curl --request GET \
--url https://api.enkryptai.com/guardrails/list-guardrails \
--header 'apikey: <api-key>'import requests
url = "https://api.enkryptai.com/guardrails/list-guardrails"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.enkryptai.com/guardrails/list-guardrails', 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.enkryptai.com/guardrails/list-guardrails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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.enkryptai.com/guardrails/list-guardrails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<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.enkryptai.com/guardrails/list-guardrails")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/list-guardrails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"guardrails": [
{
"policy_id": "1234567890",
"name": "My Guardrail",
"description": "Guardrail for production chatbot",
"created_at": "2025-03-01T09:28:52.651201+00:00",
"updated_at": "2025-03-01T09:28:52.651201+00:00",
"project_name": "default",
"is_sample": false
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total_count": 25,
"total_pages": 3,
"has_next": true,
"has_previous": false
}
}{
"error": "Invalid pagination parameters. Page must be >= 1, per_page must be between 1 and 100"
}π‘οΈ Guardrails API Endpoints
List Guardrails
List all guardrails with pagination support
GET
/
guardrails
/
list-guardrails
List Guardrails
curl --request GET \
--url https://api.enkryptai.com/guardrails/list-guardrails \
--header 'apikey: <api-key>'import requests
url = "https://api.enkryptai.com/guardrails/list-guardrails"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.enkryptai.com/guardrails/list-guardrails', 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.enkryptai.com/guardrails/list-guardrails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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.enkryptai.com/guardrails/list-guardrails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<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.enkryptai.com/guardrails/list-guardrails")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/list-guardrails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"guardrails": [
{
"policy_id": "1234567890",
"name": "My Guardrail",
"description": "Guardrail for production chatbot",
"created_at": "2025-03-01T09:28:52.651201+00:00",
"updated_at": "2025-03-01T09:28:52.651201+00:00",
"project_name": "default",
"is_sample": false
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total_count": 25,
"total_pages": 3,
"has_next": true,
"has_previous": false
}
}{
"error": "Invalid pagination parameters. Page must be >= 1, per_page must be between 1 and 100"
}List Guardrails
Retrieve a paginated list of all guardrails in your account.Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | integer | No | 1 | Page number (must be >= 1) |
per_page | integer | No | 10 | Number of items per page (must be between 1 and 100) |
Example Request
curl -X GET "https://api.enkryptai.com/guardrails/list-guardrails?page=1&per_page=10" \
-H "apikey: YOUR_API_KEY"
Example Response
{
"guardrails": [
{
"policy_id": "1234567890",
"name": "My Guardrail",
"description": "Input/output guardrail for production",
"created_at": "2025-02-21T09:28:52.651201+00:00",
"updated_at": "2025-02-21T09:28:52.651201+00:00",
"project_name": "default"
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total_count": 25,
"total_pages": 3,
"has_next": true,
"has_previous": false
}
}
Pagination
The response includes pagination metadata to help you navigate through the results:page: Current page numberper_page: Number of items per pagetotal_count: Total number of items across all pagestotal_pages: Total number of pageshas_next: Boolean indicating if thereβs a next pagehas_previous: Boolean indicating if thereβs a previous page
page parameter:
GET /guardrails/list-guardrails?page=2&per_page=10
Authorizations
Query Parameters
Page number (must be >= 1)
Required range:
x >= 1Example:
1
Number of items per page (must be between 1 and 100)
Required range:
1 <= x <= 100Example:
10

