List guardrails
curl --request GET \
--url https://api.tryhamsa.com/v2/voice-agents/guardrails \
--header 'Authorization: <api-key>'import requests
url = "https://api.tryhamsa.com/v2/voice-agents/guardrails"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.tryhamsa.com/v2/voice-agents/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.tryhamsa.com/v2/voice-agents/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 => [
"Authorization: <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.tryhamsa.com/v2/voice-agents/guardrails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.tryhamsa.com/v2/voice-agents/guardrails")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/voice-agents/guardrails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "success",
"data": [
{
"id": "6e2b9c41-7d3a-4f58-9b12-c4d5e6f70812",
"projectId": "fbb9e8b2-2dbb-40f9-a051-9404624e3247",
"userId": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"createdBy": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"name": "No passwords",
"appliesIn": "EVERY_TURN",
"conditionsMatch": "ALL",
"conditions": [
{
"variable": "channel",
"condition": "is_not",
"value": "internal"
}
],
"checksIn": "CALLER_SAYS",
"callerAgentCheck": {
"caller": {
"lookFor": "PATTERN",
"lookForValue": "\\b(password|pin)\\b",
"behaviour": "MESSAGE",
"behaviourValue": "I can't take passwords over the phone."
}
},
"mode": "ENFORCE",
"matchingExamples": null,
"instructions": "Never ask for or repeat a password or PIN.",
"notes": null,
"severity": "CRITICAL",
"status": null,
"failureReason": null,
"createdAt": "2026-10-20T09:15:00.000Z",
"updatedAt": "2026-10-20T09:15:00.000Z",
"assignedAgents": [
{
"id": "3f6c8a1e-2b4d-4e7f-9a0b-1c2d3e4f5a6b",
"agentName": "Support Agent"
}
]
}
]
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Guardrails
List Guardrails
Returns the project’s guardrails, oldest first, each with the agents it is assigned to.
GET
/
v2
/
voice-agents
/
guardrails
List guardrails
curl --request GET \
--url https://api.tryhamsa.com/v2/voice-agents/guardrails \
--header 'Authorization: <api-key>'import requests
url = "https://api.tryhamsa.com/v2/voice-agents/guardrails"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.tryhamsa.com/v2/voice-agents/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.tryhamsa.com/v2/voice-agents/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 => [
"Authorization: <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.tryhamsa.com/v2/voice-agents/guardrails"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.tryhamsa.com/v2/voice-agents/guardrails")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/voice-agents/guardrails")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "success",
"data": [
{
"id": "6e2b9c41-7d3a-4f58-9b12-c4d5e6f70812",
"projectId": "fbb9e8b2-2dbb-40f9-a051-9404624e3247",
"userId": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"createdBy": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"name": "No passwords",
"appliesIn": "EVERY_TURN",
"conditionsMatch": "ALL",
"conditions": [
{
"variable": "channel",
"condition": "is_not",
"value": "internal"
}
],
"checksIn": "CALLER_SAYS",
"callerAgentCheck": {
"caller": {
"lookFor": "PATTERN",
"lookForValue": "\\b(password|pin)\\b",
"behaviour": "MESSAGE",
"behaviourValue": "I can't take passwords over the phone."
}
},
"mode": "ENFORCE",
"matchingExamples": null,
"instructions": "Never ask for or repeat a password or PIN.",
"notes": null,
"severity": "CRITICAL",
"status": null,
"failureReason": null,
"createdAt": "2026-10-20T09:15:00.000Z",
"updatedAt": "2026-10-20T09:15:00.000Z",
"assignedAgents": [
{
"id": "3f6c8a1e-2b4d-4e7f-9a0b-1c2d3e4f5a6b",
"agentName": "Support Agent"
}
]
}
]
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Was this page helpful?