Query captured cognition sessions
curl --request GET \
--url https://api.visiqlabs.com/v1/allow/cognition/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.visiqlabs.com/v1/allow/cognition/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.visiqlabs.com/v1/allow/cognition/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://api.visiqlabs.com/v1/allow/cognition/sessions",
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: Bearer <token>"
],
]);
$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.visiqlabs.com/v1/allow/cognition/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.visiqlabs.com/v1/allow/cognition/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.visiqlabs.com/v1/allow/cognition/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total": 123,
"page": 123,
"pageSize": 123,
"data": [
{
"session_id": "<string>",
"root_agent_id": "<string>",
"agent_display_name": "<string>",
"framework": "<string>",
"capture_enabled": true,
"sensitive_storage_enabled": true,
"agents": [
{}
],
"workflows": [
{}
],
"sensorium": {},
"started_at": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"event_count": 123
}
]
}{
"error": "Invalid request body",
"code": "invalid_request",
"details": [
{
"path": [
"agent_id"
],
"message": "Required"
}
]
}{
"error": "Unauthorized",
"code": "unauthenticated"
}{
"error": "insufficient_scope",
"code": "insufficient_scope",
"detail": "This API key is not authorized for the requested operation."
}{
"error": "rate_limiter_unavailable",
"code": "rate_limiter_unavailable",
"detail": "Rate limiter unavailable, please retry."
}Cognition
Query captured cognition sessions
Paginated list of Agent Cortex cognition sessions (capture is default-OFF and server-gated per agent). Sorted by last_event_at descending. Sessions are identified by their natural session_id key. Requires permission allow_cognition:view and the dedicated scope cognition:read (never granted by allow:read/rules:read).
GET
/
v1
/
allow
/
cognition
/
sessions
Query captured cognition sessions
curl --request GET \
--url https://api.visiqlabs.com/v1/allow/cognition/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.visiqlabs.com/v1/allow/cognition/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.visiqlabs.com/v1/allow/cognition/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://api.visiqlabs.com/v1/allow/cognition/sessions",
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: Bearer <token>"
],
]);
$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.visiqlabs.com/v1/allow/cognition/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.visiqlabs.com/v1/allow/cognition/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.visiqlabs.com/v1/allow/cognition/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total": 123,
"page": 123,
"pageSize": 123,
"data": [
{
"session_id": "<string>",
"root_agent_id": "<string>",
"agent_display_name": "<string>",
"framework": "<string>",
"capture_enabled": true,
"sensitive_storage_enabled": true,
"agents": [
{}
],
"workflows": [
{}
],
"sensorium": {},
"started_at": "2023-11-07T05:31:56Z",
"last_event_at": "2023-11-07T05:31:56Z",
"event_count": 123
}
]
}{
"error": "Invalid request body",
"code": "invalid_request",
"details": [
{
"path": [
"agent_id"
],
"message": "Required"
}
]
}{
"error": "Unauthorized",
"code": "unauthenticated"
}{
"error": "insufficient_scope",
"code": "insufficient_scope",
"detail": "This API key is not authorized for the requested operation."
}{
"error": "rate_limiter_unavailable",
"code": "rate_limiter_unavailable",
"detail": "Rate limiter unavailable, please retry."
}Authorizations
A VisIQ API key presented as Authorization: Bearer vq_prod_.... Mint harness keys under Settings → Harness Keys and API keys under Settings → API Keys in the dashboard.
Query Parameters
1-based page number.
Required range:
x >= 1Page size (max 100).
Required range:
1 <= x <= 100Filter on the session's root agent id.
Maximum string length:
255Maximum string length:
64