Skip to content

Send Chat Message

This endpoint is used to send a chat message to the RAGA Chatbot. You can start a new conversation or continue an existing one using the X-SESSION-ID header.

Endpoint

POST


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

Path Parameter

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

Headers

HeaderTypeDescription
AuthorizationStringRequired. Contains Bearer {app_key} for authentication.
X-SESSION-IDStringOptional. Previous chat session ID. If omitted, a new session is created.
Content-TypeStringRequired. Must be application/x-www-form-urlencoded.

Body (x-www-form-urlencoded)

ParameterTypeDescription
chatStringRequired. The text message to be sent to the chatbot.

Description

  • Use X-SESSION-ID to continue an existing conversation.
  • To start a new conversation, omit the X-SESSION-ID header.
  • The chat parameter contains the message content sent to the chatbot.

Example Request (cURL)

bash
curl --location 'https://api.raga.ziwardingai.xyz/v1/api/open-api/workspaces/123e4567-e89b-12d3-a456-426614174000/chat' \
--header 'X-SESSION-ID: f1e47f853c06ba8b25c86ff0cc28dab1' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Bearer YOUR_APP_KEY' \
--data-urlencode 'chat=Hello, RAGA! This is my first message.'

Successful Response Example (HTTP 201)

json
{
  "code": 201,
  "data": {
    "session_id": "9cdad43a61aba0bddd69ff283fc3301f",
    "workspace_id": "993e80fb-4a78-491b-9b5b-1cc8bb336afb",
    "chat": "hello",
    "like": false,
    "dislike": false,
    "id": "fc051aef-7e2a-422f-8634-f97c92609878",
    "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:48:12.757Z",
    "updated_at": "2025-06-18T05:48:12.757Z"
  }
}

Response Fields

FieldTypeDescription
codeIntegerHTTP status code of the response (201 on success).
session_idStringCurrent chat session ID.
workspace_idStringWorkspace ID used for the conversation.
chatStringThe message sent by the user.
likeBooleanIndicates whether the user liked the chatbot response. Default: false.
dislikeBooleanIndicates whether the user disliked the chatbot response. Default: false.
idStringUnique ID for this chat interaction.
llmStringLLM model used by the chatbot.
responseStringChatbot response message.
knowledge_source_detailArrayDetails of knowledge sources used by the chatbot.
created_atStringTimestamp when the chat data was created.
updated_atStringTimestamp when the chat data was last updated.

API Responses

Status CodeDescriptionMessage
201Created (Success)Request successful, chat processed.
403ForbiddenInvalid app key or unauthorized access.