API Reference

Sessions API

Create, manage, and monitor debate sessions via the API.

Create Session

POST /api/sessions
Authorization: Bearer {token}
Content-Type: application/json

{
  "question": "Should we launch in Singapore or Australia?",
  "context": "Additional context...",
  "knights": ["knight-id-1", "knight-id-2"]
}
http

Response:

{
  "id": "session-uuid",
  "question": "Should we launch in Singapore or Australia?",
  "status": "draft",
  "created_at": "2024-01-01T00:00:00Z"
}
json

List Sessions

GET /api/sessions
Authorization: Bearer {token}
http

Response:

[
  {
    "id": "session-uuid",
    "question": "Should we launch in Singapore?",
    "status": "completed",
    "created_at": "2024-01-01T00:00:00Z"
  }
]
json

Get Session

GET /api/sessions/{session_id}
Authorization: Bearer {token}
http

Start Session

POST /api/sessions/{session_id}/start
Authorization: Bearer {token}
http

Starts the debate process. Session status changes to "running".

Abort Session

POST /api/sessions/{session_id}/abort
Authorization: Bearer {token}
http

Delete Session

DELETE /api/sessions/{session_id}
Authorization: Bearer {token}
http

Session Statuses

draft - Session created but not started
running - Session is actively processing
completed - Session finished, artifacts ready
aborted - Session was stopped