Skip to main content
POST
/
knowledge-base
/
chat
Chat with knowledge base using conversational context
curl --request POST \
  --url https://api.cleartalk.ai/knowledge-base/chat \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "messages": [
    {
      "role": "user",
      "content": "What is your refund policy?"
    }
  ],
  "knowledge_base_id": "kb_01H8X9QK5R2N7P3M6Z8N4Y1V7V",
  "type": "web"
}
'

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json
messages
object[]
required

Array of chat messages for conversational context

Example:
[
{
"role": "user",
"content": "What is your refund policy?"
}
]
knowledge_base_id
string
required

The ID of the knowledge base to query against

Example:

"kb_01H8X9QK5R2N7P3M6Z8N4Y1V7V"

type
string
default:web

Type of query

Example:

"web"

Response

Chat response generated successfully