Skip to main content
GET
/
connections
/
{nameOrId}
/
ai-session-analyzer-rule
Get AI Session Analyzer Rule by Connection
curl --request GET \
  --url https://use.hoop.dev/api/connections/{nameOrId}/ai-session-analyzer-rule
import requests

url = "https://use.hoop.dev/api/connections/{nameOrId}/ai-session-analyzer-rule"

response = requests.get(url)

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

fetch('https://use.hoop.dev/api/connections/{nameOrId}/ai-session-analyzer-rule', 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/connections/{nameOrId}/ai-session-analyzer-rule",
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/connections/{nameOrId}/ai-session-analyzer-rule"

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/connections/{nameOrId}/ai-session-analyzer-rule")
.asString();
require 'uri'
require 'net/http'

url = URI("https://use.hoop.dev/api/connections/{nameOrId}/ai-session-analyzer-rule")

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
{
  "connection_names": [
    "pgdemo",
    "mysql-prod"
  ],
  "created_at": "2024-07-25T15:56:35.317601Z",
  "custom_prompt": "Treat any query that touches the payments schema as high risk.",
  "description": "Blocks high-risk SQL commands",
  "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
  "name": "block-dangerous-queries",
  "risk_evaluation": {
    "high_risk": {
      "action": "require_access_request",
      "access_request_rule_name": "prod-approvals"
    },
    "high_risk_action": "block_execution",
    "low_risk": {
      "action": "require_access_request",
      "access_request_rule_name": "prod-approvals"
    },
    "low_risk_action": "allow_execution",
    "medium_risk": {
      "action": "require_access_request",
      "access_request_rule_name": "prod-approvals"
    },
    "medium_risk_action": "allow_execution"
  },
  "updated_at": "2024-07-25T15:56:35.317601Z"
}
{
"message": "the error description"
}
{
"message": "the error description"
}

Path Parameters

nameOrId
string
required

The name or ID of the connection

Response

OK

connection_names
string[]

Connection names this rule applies to

Example:
["pgdemo", "mysql-prod"]
created_at
string
read-only

The time the resource was created

Example:

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

custom_prompt
string

Optional extra instructions appended to the default system prompt

Example:

"Treat any query that touches the payments schema as high risk."

description
string

Optional description

Example:

"Blocks high-risk SQL commands"

id
string<uuid>
read-only

The resource identifier

Example:

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

name
string

Unique name for the rule

Example:

"block-dangerous-queries"

risk_evaluation
object

Risk evaluation actions per level

updated_at
string
read-only

The time the resource was updated

Example:

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