POST /chat
Request
messagestringrequired
The user's message content to be processed by the AI agent
user_idstring | numberrequired
Unique identifier for the user making the request
Response
dataobject
Object containing the response data
statusstring
Status of the API response (success/error)
messagestring
Error message if status is 'error'
Example Usage
// Example request
const response = await fetch('/api/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-token-here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message: "Hello, how can you help me?",
user_id: "user123"
})
});// Example response
{
"data": {
"response": "Of course, I am here to help. How can I assist you today?"
},
"response": "Of course, I am here to help. How can I assist you today?",
"status": "success"
}