List sessions
Returns sessions created via the V1 API, scoped to the authenticated caller’s organization. Sessions created in the web app are not included.
Requires the admin role. Personal keys use their owner’s role;
service-account keys use the account’s role. Member-role keys can call
the other Sessions endpoints, subject to session ownership requirements.
This endpoint returns API sessions across the organization, so calls
from a member-role key return 403 Forbidden.
If page and limit are both omitted, all sessions are returned in a
single response.
curl --request GET \
--url https://api.traversal.com/v1/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traversal.com/v1/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{
"sessions": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "running",
"input": "Our checkout service started returning 500 errors at 2024-03-15T14:30:00Z. Error rate jumped from 0.1% to 15%.",
"created_at": "2024-03-15T14:35:00Z",
"title": "Elevated error rate in checkout service",
"updated_at": "2024-03-15T14:38:12Z",
"messages": [
{
"id": "msg-001-uuid",
"role": "user",
"markdown_content": "## Investigation Summary\n\nI investigated the elevated error rate...",
"created_at": "2024-03-15T14:38:12Z"
}
]
}
],
"count": 123,
"total": 123,
"prev": 123,
"next": 123
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}Authorizations
Bearer token in the Authorization header — for example,
Authorization: Bearer YOUR_API_KEY. Personal keys act as their owner;
the Sessions API also accepts organization-owned service-account keys.
Knowledge Files endpoints currently require a personal key.
Query Parameters
Page number (1-indexed).
x >= 1Number of sessions per page.
x >= 1Response
A page of sessions.
curl --request GET \
--url https://api.traversal.com/v1/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/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.traversal.com/v1/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traversal.com/v1/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{
"sessions": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "running",
"input": "Our checkout service started returning 500 errors at 2024-03-15T14:30:00Z. Error rate jumped from 0.1% to 15%.",
"created_at": "2024-03-15T14:35:00Z",
"title": "Elevated error rate in checkout service",
"updated_at": "2024-03-15T14:38:12Z",
"messages": [
{
"id": "msg-001-uuid",
"role": "user",
"markdown_content": "## Investigation Summary\n\nI investigated the elevated error rate...",
"created_at": "2024-03-15T14:38:12Z"
}
]
}
],
"count": 123,
"total": 123,
"prev": 123,
"next": 123
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}