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/chatPath Parameter
| Parameter | Type | Description |
|---|---|---|
workspace_id | String | Your workspace ID in the RAGA system. Required in the URL path. |
Headers
| Header | Type | Description |
|---|---|---|
Authorization | String | Required. Contains Bearer {app_key} for authentication. |
X-SESSION-ID | String | Optional. Previous chat session ID. If omitted, a new session is created. |
Content-Type | String | Required. Must be application/x-www-form-urlencoded. |
Body (x-www-form-urlencoded)
| Parameter | Type | Description |
|---|---|---|
chat | String | Required. The text message to be sent to the chatbot. |
Description
- Use
X-SESSION-IDto continue an existing conversation. - To start a new conversation, omit the
X-SESSION-IDheader. - The
chatparameter 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
| Field | Type | Description |
|---|---|---|
code | Integer | HTTP status code of the response (201 on success). |
session_id | String | Current chat session ID. |
workspace_id | String | Workspace ID used for the conversation. |
chat | String | The message sent by the user. |
like | Boolean | Indicates whether the user liked the chatbot response. Default: false. |
dislike | Boolean | Indicates whether the user disliked the chatbot response. Default: false. |
id | String | Unique ID for this chat interaction. |
llm | String | LLM model used by the chatbot. |
response | String | Chatbot response message. |
knowledge_source_detail | Array | Details of knowledge sources used by the chatbot. |
created_at | String | Timestamp when the chat data was created. |
updated_at | String | Timestamp when the chat data was last updated. |
API Responses
| Status Code | Description | Message |
|---|---|---|
| 201 | Created (Success) | Request successful, chat processed. |
| 403 | Forbidden | Invalid app key or unauthorized access. |