Skip to content

Get Chat History

This endpoint is used to retrieve chat conversation history based on the X-SESSION-ID.

Endpoint

GET


https://api.raga.ziwardingai.xyz/v1/api/open-api/workspaces/:workspace_id/history

Path Parameter

ParameterTypeDescription
workspace_idStringYour workspace ID in the RAGA system. Required in the URL path.

Query Parameters

ParameterTypeDescription
pageIntegerOptional. Page number for pagination. Default: 1
limitIntegerOptional. Number of records per page. Default: 300, Maximum: 10,000

Headers

HeaderTypeDescription
AuthorizationStringRequired. Contains Bearer {app_key} for authentication.
X-SESSION-IDStringRequired. Chat session ID used to retrieve conversation history.

Description

  • Ensure a valid X-SESSION-ID is provided to retrieve chat history data.
  • Pagination can be controlled using the page and limit query parameters.

Example Request (cURL)

bash
curl --location 'https://api.raga.ziwardingai.xyz/v1/api/open-api/workspaces/123e4567-e89b-12d3-a456-426614174000/history?page=1&limit=10' \
--header 'X-SESSION-ID: f1e47f853c06ba8b25c86ff0cc28dab1' \
--header 'Authorization: Bearer YOUR_APP_KEY'

Successful Response Example (HTTP 200)

json
{
  "code": 200,
  "data": {
    "results": [
      {
        "session_id": "9cdad43a61aba0bddd69ff283fc3301f",
        "workspace_id": "993e80fb-4a78-491b-9b5b-1cc8bb336afb",
        "chat": "hello",
        "like": false,
        "dislike": false,
        "id": "2f9ea87a-6408-4da4-9eed-139a2101b2ff",
        "llm": "local_v2",
        "response": "Hello! How can I assist you today?",
        "knowledge_source_detail": [
          {
            "type": "basic",
            "topic_id": [
              "1685d466-ddbd-4150-9750-2b1a56aa5bdd"
            ]
          }
        ],
        "created_at": "2025-06-18T05:38:19.742Z",
        "updated_at": "2025-06-18T05:38:19.742Z"
      }
    ],
    "total": 23,
    "page": 1,
    "limit": 300
  }
}

Response Fields

FieldTypeDescription
codeIntegerHTTP status code of the response (200 on success).
resultsArrayList of chat history objects. Index 0 is the most recent chat.
totalIntegerTotal number of chat messages in the session.
pageIntegerCurrent page number.
limitIntegerNumber of records per page.

Each item in results has the same structure as the Send Chat response:

FieldTypeDescription
session_idStringChat session ID.
workspace_idStringWorkspace ID.
chatStringUser message content.
likeBooleanIndicates whether the user liked the response.
dislikeBooleanIndicates whether the user disliked the response.
idStringUnique chat message ID.
llmStringLLM model used.
responseStringChatbot response.
knowledge_source_detailArrayKnowledge sources used to generate the response.
created_atStringTimestamp when the record was created.
updated_atStringTimestamp when the record was last updated.

API Responses

Status CodeDescriptionMessage
200OK (Success)Request successful, chat history returned.
403ForbiddenInvalid app key or unauthorized access.