Query an existing session to retrieve its data, including variables and conversation history.
Base URL
Query Session
GET https://api.pathors.com/project/{projectId}/session/{sessionId}
Path Parameters
The unique identifier of the session to query
Bearer token authentication using your Project API Key (starts with sk_). Format: Bearer {your-api-key}
Response
The session state containing variables, messages, and other execution state information
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
state field 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 |
Example error responses:
404 Not Found:
{
"error": "Session not found"
}
401 Unauthorized:
{
"error": {
"message": "Invalid authentication"
}
}