Sessions
Send a follow-up message
Sends a follow-up question on an existing session. Traversal uses the full conversation history as context.
The session must be in the idle status. If it is running or
follow_up_running, the API returns 409 Conflict with retry_after.
Poll GET /v1/sessions/{session_id} until the session status returns
to idle to retrieve the assistant response.
Follow-ups count toward the same 15 concurrent running sessions
per-organization limit as POST /v1/sessions. If the organization is
already at the limit, the request returns 429 Too Many Requests with
retry_after.
POST
/
v1
/
sessions
/
{session_id}
/
messages
Send a follow-up message
curl --request POST \
--url https://api.traversal.com/v1/sessions/{session_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Can you check if the database connection pool was exhausted during the incident?"
}
'import requests
url = "https://api.traversal.com/v1/sessions/{session_id}/messages"
payload = { "input": "Can you check if the database connection pool was exhausted during the incident?" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: 'Can you check if the database connection pool was exhausted during the incident?'
})
};
fetch('https://api.traversal.com/v1/sessions/{session_id}/messages', 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/{session_id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => 'Can you check if the database connection pool was exhausted during the incident?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.traversal.com/v1/sessions/{session_id}/messages"
payload := strings.NewReader("{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.traversal.com/v1/sessions/{session_id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traversal.com/v1/sessions/{session_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}"
response = http.request(request)
puts response.read_body{
"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",
"user_message_id": "msg-003-uuid",
"assistant_message_id": "msg-004-uuid",
"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"
}
]
}{
"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
}
}{
"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
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}Authorizations
Body
application/json
Controls how much investigation depth Traversal applies.
default: run a thorough root cause analysis, scaled to the scope of the request.lightning: run a quick first pass or a simple lookup. Useful when simple queries need to be answered faster.auto,deep: deprecated names fordefault.fast: deprecated name forlightning.
Available options:
default, lightning, auto, deep, fast Response
Follow-up accepted; investigation is running.
running— a new investigation is in progress.idle— investigation is complete and ready for follow-ups.follow_up_running— a follow-up message is being processed.failed— the investigation or follow-up errored or timed out.cancelled— the investigation was cancelled.
Available options:
running, idle, follow_up_running, failed, cancelled ⌘I
Send a follow-up message
curl --request POST \
--url https://api.traversal.com/v1/sessions/{session_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "Can you check if the database connection pool was exhausted during the incident?"
}
'import requests
url = "https://api.traversal.com/v1/sessions/{session_id}/messages"
payload = { "input": "Can you check if the database connection pool was exhausted during the incident?" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: 'Can you check if the database connection pool was exhausted during the incident?'
})
};
fetch('https://api.traversal.com/v1/sessions/{session_id}/messages', 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/{session_id}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => 'Can you check if the database connection pool was exhausted during the incident?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.traversal.com/v1/sessions/{session_id}/messages"
payload := strings.NewReader("{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.traversal.com/v1/sessions/{session_id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.traversal.com/v1/sessions/{session_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"Can you check if the database connection pool was exhausted during the incident?\"\n}"
response = http.request(request)
puts response.read_body{
"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",
"user_message_id": "msg-003-uuid",
"assistant_message_id": "msg-004-uuid",
"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"
}
]
}{
"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
}
}{
"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
}
}{
"error": {
"code": "conflict",
"message": "<string>",
"retry_after": 123
}
}