Query Session
curl --request GET \
--url https://api.pathors.com/project/{projectId}/session/{sessionId} \
--header 'Authorization: <authorization>'import requests
url = "https://api.pathors.com/project/{projectId}/session/{sessionId}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.pathors.com/project/{projectId}/session/{sessionId}', 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.pathors.com/project/{projectId}/session/{sessionId}",
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: <authorization>"
],
]);
$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.pathors.com/project/{projectId}/session/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.pathors.com/project/{projectId}/session/{sessionId}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/project/{projectId}/session/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"sessionId": "<string>",
"state": {}
}Deprecated APIs
Query Session
Retrieve session information by session ID to view conversation context and variables.
GET
/
project
/
{projectId}
/
session
/
{sessionId}
Query Session
curl --request GET \
--url https://api.pathors.com/project/{projectId}/session/{sessionId} \
--header 'Authorization: <authorization>'import requests
url = "https://api.pathors.com/project/{projectId}/session/{sessionId}"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.pathors.com/project/{projectId}/session/{sessionId}', 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.pathors.com/project/{projectId}/session/{sessionId}",
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: <authorization>"
],
]);
$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.pathors.com/project/{projectId}/session/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.pathors.com/project/{projectId}/session/{sessionId}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/project/{projectId}/session/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"sessionId": "<string>",
"state": {}
}Deprecated. This endpoint is deprecated and will be sunset on 2026-07-11. It still works until then. Migrate to the V1 path — see the migration guide for the old -> new path table.
Base URL
https://api.pathors.com
Query Session
GET https://api.pathors.com/project/{projectId}/session/{sessionId}
Path Parameters
Request Headers
Bearer token authentication using your Project API Key (starts with
sk_). Format: Bearer {your-api-key}Response
Example
Request
curl -X GET https://api.pathors.com/project/{projectId}/session/user-123-session-456 \
--header 'Authorization: Bearer <token>'
Response
{
"sessionId": "user-123-session-456",
"state": {
"variables": {
"userName": "John Doe",
"userRole": "admin"
},
"messages": [
{
"role": "user",
"content": "Hello"
},
{
"role": "assistant",
"content": "Hi! How can I help you today?"
}
]
}
}
Usage Notes
- Session ID: Use the same session ID that was created via the Create Session endpoint
- State Structure: The
statefield contains the session execution state including variables and conversation history
Error Responses
| Status Code | Description |
|---|---|
| 400 | Missing projectId or sessionId |
| 401 | Invalid authentication |
| 404 | Session not found |
| 500 | Internal server error |
{
"error": "Session not found"
}
{
"error": {
"message": "Invalid authentication"
}
}
Related APIs
- Create Session - Create a new session
- End Session - End an existing session
