curl --request GET \
--url https://use.hoop.dev/api/sessionsimport requests
url = "https://use.hoop.dev/api/sessions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/sessions', 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/sessions",
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/sessions"
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/sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sessions")
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{
"data": [
{
"ai_analysis": {
"action": "allow_execution",
"explanation": "The script contains queries that may expose sensitive data.",
"model": "<string>",
"risk_level": "high",
"steps": [
{
"is_error": true,
"thinking": "<string>",
"timestamp": "<string>",
"tool_input": "<string>",
"tool_name": "<string>",
"tool_output": "<string>",
"type": "tool_call"
}
],
"summary": "<string>",
"title": "Potential Data Leakage"
},
"connection": "pgdemo",
"connection_subtype": "postgres",
"connection_tags": {
"team": "banking;environment:prod"
},
"correlation_id": "task-12345",
"end_date": "2024-07-25T15:56:35.361101Z",
"event_size": 569,
"event_stream": [
123
],
"exit_code": 123,
"guardrails_info": [
{
"direction": "input",
"elapsed": 12.5,
"matched_words": [
"password",
"secret"
],
"message": "This query was blocked by your organization's data policy",
"rule": {
"pattern_regex": "^[A-Z0-9]+",
"type": "deny_words_list",
"words": [
"password",
"secret"
]
},
"rule_name": "block-sensitive-data"
}
],
"id": "1CBC8DB5-FBF8-4293-8E35-59A6EEA40207",
"identity_type": "user",
"integrations_metadata": {},
"labels": {},
"machine_identity_id": "BF997324-5A27-4778-806A-41EE83598494",
"metadata": {},
"metrics": {},
"org_id": "0CD7F941-2BB8-4F9F-93B0-11620D4652AB",
"recording_format": "pty",
"resource_name": "my-resource",
"review": {
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"created_at": "2024-07-25T15:56:35.317601Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime"
},
"role_name": "pgdemo",
"script": {
"data": "SELECT NOW()"
},
"script_size": 12,
"session_batch_id": "batch-abc-123",
"start_date": "2024-07-25T15:56:35.317601Z",
"status": "open",
"type": "database",
"user": "<string>",
"user_id": "nJ1xV3ASWGTi7L8Y6zvnKqxNlnZM2TxV1bRdc0706vZ",
"user_name": "John Wick",
"verb": "connect"
}
],
"has_next_page": true,
"total": 100,
"total_is_capped": true
}{
"message": "the error description"
}{
"message": "the error description"
}List Sessions
List session resources
curl --request GET \
--url https://use.hoop.dev/api/sessionsimport requests
url = "https://use.hoop.dev/api/sessions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/sessions', 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/sessions",
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/sessions"
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/sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sessions")
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{
"data": [
{
"ai_analysis": {
"action": "allow_execution",
"explanation": "The script contains queries that may expose sensitive data.",
"model": "<string>",
"risk_level": "high",
"steps": [
{
"is_error": true,
"thinking": "<string>",
"timestamp": "<string>",
"tool_input": "<string>",
"tool_name": "<string>",
"tool_output": "<string>",
"type": "tool_call"
}
],
"summary": "<string>",
"title": "Potential Data Leakage"
},
"connection": "pgdemo",
"connection_subtype": "postgres",
"connection_tags": {
"team": "banking;environment:prod"
},
"correlation_id": "task-12345",
"end_date": "2024-07-25T15:56:35.361101Z",
"event_size": 569,
"event_stream": [
123
],
"exit_code": 123,
"guardrails_info": [
{
"direction": "input",
"elapsed": 12.5,
"matched_words": [
"password",
"secret"
],
"message": "This query was blocked by your organization's data policy",
"rule": {
"pattern_regex": "^[A-Z0-9]+",
"type": "deny_words_list",
"words": [
"password",
"secret"
]
},
"rule_name": "block-sensitive-data"
}
],
"id": "1CBC8DB5-FBF8-4293-8E35-59A6EEA40207",
"identity_type": "user",
"integrations_metadata": {},
"labels": {},
"machine_identity_id": "BF997324-5A27-4778-806A-41EE83598494",
"metadata": {},
"metrics": {},
"org_id": "0CD7F941-2BB8-4F9F-93B0-11620D4652AB",
"recording_format": "pty",
"resource_name": "my-resource",
"review": {
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"created_at": "2024-07-25T15:56:35.317601Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime"
},
"role_name": "pgdemo",
"script": {
"data": "SELECT NOW()"
},
"script_size": 12,
"session_batch_id": "batch-abc-123",
"start_date": "2024-07-25T15:56:35.317601Z",
"status": "open",
"type": "database",
"user": "<string>",
"user_id": "nJ1xV3ASWGTi7L8Y6zvnKqxNlnZM2TxV1bRdc0706vZ",
"user_name": "John Wick",
"verb": "connect"
}
],
"has_next_page": true,
"total": 100,
"total_is_capped": true
}{
"message": "the error description"
}{
"message": "the error description"
}Query Parameters
Filter by user's subject id
Filter by connection's name
Filter by connection's type
Filter by the approver email of an approval request
Filter by the approval status
Filter by external workflow/task correlation id
Filter by Jira issue key
Filter by the session status
open, ready, done Filter by the session verb
connect, exec Filter by text in the session input, case-insensitive, at most 256 bytes. Only % is a wildcard. Native client sessions are not searched.
Filter starting on this date
Filter ending on this date
Limit the amount of records to return (max: 100)
Offset to paginate through resources (max: 10000)
How to compute the total: capped at 10000 (default), exact, or none
exact, capped, none Response
OK
Show child attributes
Show child attributes
The number of sessions matching the filter.
Capped by default: the value is the exact total up to 10000, and beyond
that it stops at 10000 with total_is_capped set. Ask for ?count=exact
to pay for the precise figure. null when the request asked for
?count=none, which is distinct from a count of zero: it means the total
was never computed.
100
Reports that total is a lower bound rather than the exact number of
matching sessions. Render it as 10000+. Always false under
?count=exact, and for any result set smaller than the cap.
Was this page helpful?