Skip to main content
Sessions group conversations and ingested documents together. Every chat message and ingested document belongs to a session.
All session endpoints require authentication.

List sessions

GET /api/v1/session/ Returns all sessions belonging to the authenticated user.

Response

200 OK

data
array
Array of session objects for the current user.

Example

curl -X GET http://localhost:3000/api/v1/session/ \
  -H "Authorization: Bearer <token>"
Response
[
  {
    "id": "sess_abc123",
    "label": "Q3 Analysis",
    "user_id": "usr_xyz",
    "createdAt": "2026-04-01T09:00:00Z"
  }
]

Create session

POST /api/v1/session/ Creates a new session for the authenticated user.

Request body

label
string
required
A human-readable name for the session (e.g. "Q3 Analysis").

Response

201 Created

data
object
The newly created session object.

500 Internal Server Error

success
boolean
Always false.
error
string
Always "Internal Server Error".
code
string
Machine-readable error code.

Example

curl -X POST http://localhost:3000/api/v1/session/ \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "label": "Q3 Analysis" }'
Response
{
  "data": {
    "id": "sess_abc123",
    "label": "Q3 Analysis",
    "user_id": "usr_xyz",
    "createdAt": "2026-04-01T09:00:00Z"
  }
}

Rename session

PATCH /api/v1/session/:sessionId Updates the label of an existing session.

Path parameters

sessionId
string
required
The ID of the session to rename.

Request body

label
string
required
The new label for the session.

Response

200 OK

data
object
The updated session object.

Example

curl -X PATCH http://localhost:3000/api/v1/session/sess_abc123 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "label": "Q3 Final Report" }'
Response
{
  "data": {
    "id": "sess_abc123",
    "label": "Q3 Final Report",
    "user_id": "usr_xyz"
  }
}

Delete session

Deleting a session is permanent. Associated chat history and document references may also be removed.
DELETE /api/v1/session/:sessionId Deletes a session by ID.

Path parameters

sessionId
string
required
The ID of the session to delete.

Response

204 No Content

Returned on success. The response body is empty.

Example

curl -X DELETE http://localhost:3000/api/v1/session/sess_abc123 \
  -H "Authorization: Bearer <token>"

Build docs developers (and LLMs) love