Guard Rails
Get Guard Rail
Retrieve a specific guard rail by ID.
GET
/
v1
/
guard_rails
/
{guard_rail_id}
Get Guard Rail
curl --request GET \
--url https://api.bland.ai/v1/guard_rails/{guard_rail_id} \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v1/guard_rails/{guard_rail_id}"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v1/guard_rails/{guard_rail_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.bland.ai/v1/guard_rails/{guard_rail_id}",
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: <authorization>"
],
]);
$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.bland.ai/v1/guard_rails/{guard_rail_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/guard_rails/{guard_rail_id}")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/guard_rails/{guard_rail_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"org_id": "12345678-1234-1234-1234-123456789012",
"type": "custom",
"name": "No Medical Advice",
"description": "Prevents the agent from providing medical advice",
"prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations",
"config": {},
"attachments": [
{
"source_type": "PERSONA",
"source_id": "98765432-1234-1234-1234-123456789012",
"actions": [
{ "type": "transfer", "config": { "phone_number": "+15551234567" } }
]
}
],
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Guard rail not found"
}
]
}
Headers
Path Parameters
Response
Type of guard rail. One of:
tcpa:ai_disclosure, tcpa:recording_disclosure, tcpa:self_introduction, tcpa:opt_out, or custom.Array of sources this guard rail is attached to. Each attachment contains
source_type (PERSONA, PATHWAY, or INBOUND), source_id, and actions.{
"data": {
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"org_id": "12345678-1234-1234-1234-123456789012",
"type": "custom",
"name": "No Medical Advice",
"description": "Prevents the agent from providing medical advice",
"prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations",
"config": {},
"attachments": [
{
"source_type": "PERSONA",
"source_id": "98765432-1234-1234-1234-123456789012",
"actions": [
{ "type": "transfer", "config": { "phone_number": "+15551234567" } }
]
}
],
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Guard rail not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Get Guard Rail
curl --request GET \
--url https://api.bland.ai/v1/guard_rails/{guard_rail_id} \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v1/guard_rails/{guard_rail_id}"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v1/guard_rails/{guard_rail_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.bland.ai/v1/guard_rails/{guard_rail_id}",
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: <authorization>"
],
]);
$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.bland.ai/v1/guard_rails/{guard_rail_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
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.bland.ai/v1/guard_rails/{guard_rail_id}")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/guard_rails/{guard_rail_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"org_id": "12345678-1234-1234-1234-123456789012",
"type": "custom",
"name": "No Medical Advice",
"description": "Prevents the agent from providing medical advice",
"prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations",
"config": {},
"attachments": [
{
"source_type": "PERSONA",
"source_id": "98765432-1234-1234-1234-123456789012",
"actions": [
{ "type": "transfer", "config": { "phone_number": "+15551234567" } }
]
}
],
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Guard rail not found"
}
]
}