Skip to main content
GET
/
guardrails
/
{id}
Get Guard Rail Rules
curl --request GET \
  --url https://use.hoop.dev/api/guardrails/{id}
import requests

url = "https://use.hoop.dev/api/guardrails/{id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://use.hoop.dev/api/guardrails/{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://use.hoop.dev/api/guardrails/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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://use.hoop.dev/api/guardrails/{id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://use.hoop.dev/api/guardrails/{id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://use.hoop.dev/api/guardrails/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "attributes": [
    "production",
    "pii"
  ],
  "connection_ids": [
    "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
    "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
  ],
  "created_at": "2024-07-25T15:56:35.317601Z",
  "description": "description about this rule",
  "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
  "input": {},
  "name": "my-strict-rule",
  "output": {},
  "updated_at": "2024-07-25T15:56:35.317601Z"
}
{
"message": "the error description"
}
{
"message": "the error description"
}
{
"message": "the error description"
}

Path Parameters

id
string
required

The unique identifier of the resource

Response

OK

attributes
string[]

Attributes associated with this guardrail rule

Example:
["production", "pii"]
connection_ids
string[]

List of connection IDs that this guardrail applies to

Example:
[
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D8"
]
created_at
string
read-only

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

description
string

The rule description

Example:

"description about this rule"

id
string<uuid>
read-only

The resource identifier

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

input
object

The input rule

{
"name": "deny-select",
"description": "<optional-description>",
"input": {
"rules": [
{"type": "deny_words_list", "words": ["SELECT"], "pattern_regex": "", "name": "<optional-name>"}
]
},
"output": {
"rules": [
{"type": "pattern_match", "words": [], "pattern_regex": "[A-Z0-9]+"}
]
}
}
name
string

Unique name for the rule

Example:

"my-strict-rule"

output
object

The output rule

{
"name": "deny-select",
"description": "<optional-description>",
"input": {
"rules": [
{"type": "deny_words_list", "words": ["SELECT"], "pattern_regex": "", "name": "<optional-name>"}
]
},
"output": {
"rules": [
{"type": "pattern_match", "words": [], "pattern_regex": "[A-Z0-9]+"}
]
}
}
updated_at
string
read-only

The time the resource was updated

Example:

"2024-07-25T15:56:35.317601Z"