Conversations

List, view, and delete chat conversations.

Conversations are automatically created when you use the /chat endpoint. Each conversation has a unique ID and maintains chat history for follow-up questions.


List conversations

GET https://api.knowbase.ai/api/v1/conversations

Returns all conversations with titles and message counts, ordered by most recent.

Query parameters

Name
Type
Required
Description

session_id

string

No

Filter to one user's conversations only. See Filter by session.

Response (200: OK)

{
  "conversations": [
    {
      "id": "d4e5f6a7-b8c9-0123-def0-1234567890ab",
      "title": "What were the key revenue drivers...",
      "timestamp": "2025-03-15T14:30:00",
      "message_count": 4
    },
    {
      "id": "e5f6a7b8-c9d0-1234-ef01-234567890abc",
      "title": "Summarize the meeting notes",
      "timestamp": "2025-03-14T10:15:00",
      "message_count": 2
    }
  ]
}

Filter by session

If you serve multiple end users under one API account (see Per-user sessions), pass ?session_id=... to fetch a single user's conversations only:

The response only includes conversations whose messages were sent with that session_id. Use this to render a single user's chat history in your UI.


Get conversation messages

GET https://api.knowbase.ai/api/v1/conversations/{conversation_id}

Returns all messages in a conversation in chronological order.

Response (200: OK)


Delete a conversation

DELETE https://api.knowbase.ai/api/v1/conversations/{conversation_id}

Permanently deletes a conversation and all its messages.

Response (200: OK)

Example

Last updated