GET /chat
Request
userIdstring | numberrequired
Unique identifier for the user
limitnumber
Maximum number of messages to return
Response
dataobject
Wrapper object containing the response data
statusstring
Status of the request (e.g., 'success')
messagestring
Error message if status is 'error'
Example Usage
// Example request
const response = await fetch('/api/chat?userId=user123&limit=10', {
method: 'GET',
headers: {
'Authorization': 'Bearer your-token-here'
}
});// Example response
{
"data": {
"messages": [
{
"message": "Hello! How can I assist you today?",
"role": "assistant"
},
{
"message": "hello there",
"role": "user"
}
]
},
"status": "success"
}