Skip to main content

Sessions API

This document outlines the API endpoints for managing user sessions in PySpur. Sessions are used to maintain conversation history in agent spurs. Each session is tied to a user and a spur. For quick testing purposes, use the create test user endpoint. It also creates a default test user if doesn’t exist.

Create Session

Description: Creates a new session. If a session with the given external ID already exists, returns the existing session. URL: /session/ Method: POST Request Payload:
Response Schema:

List Sessions

Description: Lists sessions with pagination and optional user filtering. URL: /session/ Method: GET Query Parameters:
Response Schema:

Get Session

Description: Gets a specific session by ID, including all messages. URL: /session/{session_id}/ Method: GET Parameters:
Response Schema:

Delete Session

Description: Deletes a session. URL: /session/{session_id}/ Method: DELETE Parameters:
Response: 204 No Content

Create Test Session

Description: Creates or reuses a test user and session. If a test user exists, it will be reused. If an empty test session exists for the same workflow, it will be reused. Otherwise, a new session will be created. URL: /session/test/ Method: POST Query Parameters:
Response Schema: