Sessions

A session is one logical conversation between your end-user and your product. You define what a session is — Viora doesn't try to chunk continuous traffic for you.

Create

POST /api/v1/sessions
Authorization: Bearer vrk_...
Content-Type: application/json

{
  "external_id": "your-session-id",        // optional; we'll generate one if omitted
  "end_user_external_id": "user_42",       // required
  "title": "evening check-in"              // optional, free text
}

Idempotent on (your client, external_id) — re-POSTing the same body returns the existing session unchanged.

Response:

{
  "id": 123,
  "external_id": "your-session-id",
  "end_user_id": 987,
  "title": "evening check-in",
  "started_at": "...",
  "last_message_at": "...",
  "r_level": "R0",
  "srs": null,
  "status": "active"
}

Get

GET /api/v1/sessions/{id}

Returns the full session including all messages. 404 if the session doesn't exist or belongs to a different tenant.

List

GET /api/v1/sessions
GET /api/v1/sessions?end_user_external_id=user_42&limit=100

Returns your most-recently-active sessions (default 50, max 200).