curl --request GET \
--url https://api.galtea.ai/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/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.galtea.ai/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.galtea.ai/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.galtea.ai/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.galtea.ai/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/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[
{
"id": "session_123",
"customId": "custom_session_123",
"versionId": "ver_123",
"userId": "user_123",
"testCaseId": "tc_123",
"context": {
"value": "Session context information"
},
"stoppingReason": "GOAL_ACHIEVED",
"recordingUri": "https://files.galtea.ai/audio/org_123/session_abc-recording.mp3",
"error": "External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}",
"status": "PENDING",
"isProduction": false,
"isSeed": false,
"runId": "run_123",
"deletedAt": "2023-11-07T05:31:56Z",
"turnCount": 3,
"metadata": {
"key": "value"
},
"createdAt": "2023-11-07T05:31:56Z"
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Get sessions
Get list of sessions with pagination and filtering. See Sessions.
curl --request GET \
--url https://api.galtea.ai/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/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.galtea.ai/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.galtea.ai/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.galtea.ai/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.galtea.ai/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/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[
{
"id": "session_123",
"customId": "custom_session_123",
"versionId": "ver_123",
"userId": "user_123",
"testCaseId": "tc_123",
"context": {
"value": "Session context information"
},
"stoppingReason": "GOAL_ACHIEVED",
"recordingUri": "https://files.galtea.ai/audio/org_123/session_abc-recording.mp3",
"error": "External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}",
"status": "PENDING",
"isProduction": false,
"isSeed": false,
"runId": "run_123",
"deletedAt": "2023-11-07T05:31:56Z",
"turnCount": 3,
"metadata": {
"key": "value"
},
"createdAt": "2023-11-07T05:31:56Z"
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Query Parameters
Filter by session IDs
Filter by session custom IDs
Filter by product IDs
Filter by test IDs (include only). Use an empty string ("") to select sessions without a test
Omit sessions linked to the specified test IDs. Use an empty string ("") to omit sessions without a test
Filter by version IDs
Filter by monitor IDs (returns only sessions scored by the given monitors)
Filter by monitor alert IDs (returns only the sessions the alert linked when it opened (its bad sessions, or its sessions with no score); a session deleted since is left out). At most 10 IDs.
10Filter by the specifications a session relates to. A session relates to a specification in two ways, and either one matches: it runs a test case of a test linked to that specification, or it carries an evaluation whose metric is linked to that specification. Multiple values combine as OR.
Filter by the specifications a session failed, with the rule of the analytics reads: the session carries a scored evaluation of a metric linked to the specification that did not pass the metric's threshold, where a reviewer's score wins over the judge's. Metrics excluded from analytics and versions that are deleted, or of another product than the specification's, do not count. Multiple values combine as OR. At most 25 IDs. Answers 400 when the specifications failed more than 10000 sessions within the caller's read scope, ids, productIds, versionIds, isProduction, fromCreatedAt and toCreatedAt, so narrow the period. Deleted sessions do not count, and seed sessions count only when named in ids.
25Filter by the id of the user who launched the session. A production session has no launcher and never matches this filter. An OTel-ingested session is production unless its spans name a test case; that one records the user of the API key that sent the traces, so it does match.
Filter by the runs that CREATED the sessions. A session created outside a launch (production traffic, an imported trace) has no run and never matches. To also reach the sessions a run only scored, use involvedInRunIds.
Filter by the runs a session relates to either way, as an OR: the run created the session, or the run scored it through one of its evaluations. This is the set a run reports as its session count.
Filter by test case IDs
Filter by the session's isProduction flag. Prefer this over the legacy testIds/excludeTestIds empty-string trick.
Filter by session statuses. Multiple values combine as OR.
PENDING, COMPLETED, FAILED Filter by comment state. __any__ matches sessions with at least one comment, __none__ matches sessions with no comment, and any other value matches sessions with a comment carrying that label. All values combine as OR, so __none__ plus a label returns sessions that have no comment OR carry that label.
Sort instructions (field and direction pairs). A sort that names turnCount may name only these fields: turnCount, createdAt, id, stoppingReason, testCaseId, versionId, context. It answers 400 when more than 50000 sessions match the filters.
Maximum number of results
0 <= x <= 9007199254740991Number of results to skip
x >= 0Filter sessions created at or after this timestamp (ISO 8601 format)
Filter sessions created at or before this timestamp (ISO 8601 format)
Response
Sessions retrieved successfully
"session_123"
"custom_session_123"
"ver_123"
"user_123"
"tc_123"
Structured context data. For plain text context, format is { value: "..." }
Show child attributes
Show child attributes
{ "value": "Session context information" }
"GOAL_ACHIEVED"
Storage URI of the full-call recording for a telephony-evaluation session, returned under STORAGE_PUBLIC_BASE_URL when the deployment configures one. Null for non-telephony sessions or before the recording is processed. Resolve to a playable URL via GET /storage?uri=.
"https://files.galtea.ai/audio/org_123/session_abc-recording.mp3"
"External API responded with HTTP 422: Unprocessable Entity — {\"detail\":\"model not found\"}"
PENDING, COMPLETED, FAILED "PENDING"
True when the session represents real production traffic (no associated test case).
false
True when the session holds the predefined conversation of a test case and is never executed. Server-managed and read-only.
false
The run that created this session. Null for a session created outside a launch (production traffic, an imported trace). A session a run only scored names no run here; filter with involvedInRunIds to reach those too.
"run_123"
Number of turns in the session, not counting deleted ones. Sort by it with sort=turnCount&sort=desc (or asc).
3
Arbitrary metadata, returned as stored. Usually an object, but any JSON value is accepted.
{ "key": "value" }