POST /api/v1/chat/send
Send a user message to the AI assistant and receive a response based on their context.
๐ Authentication
This endpoint requires an API key in the Authorization
header:
Authorization: Bearer YOUR_API_KEY
๐งพ Request Body
{
"message": "I want to return my order",
"user_id": "user_123",
"context": {
"order_id": "ORD-456",
"purchase_date": "2025-01-15"
}
}
Field |
Type |
Required |
Description |
message |
string |
โ
|
The user's input message |
user_id |
string |
โ
|
Unique user ID |
context |
object |
โ |
Optional metadata (e.g., order info) |
Context object fields
Field |
Type |
Required |
Description |
order_id |
string |
โ |
Unique identifier of the order |
purchase_date |
string |
โ |
Date of the purchase (YYYY-MM-DD) |
๐ค Response
{
"reply": "Sure, I can help you return your order.",
"conversation_id": "conv_789",
"timestamp": "2025-06-09T10:12:00Z"
}
Field |
Type |
Description |
reply |
string |
AI-generated response |
conversation_id |
string |
ID to track the conversation |
timestamp |
string |
ISO 8601 timestamp of the response |
โ ๏ธ Errors
Code |
Message |
Meaning |
401 |
Unauthorized |
Missing or invalid API key |
429 |
Rate limit exceeded |
Too many requests |
500 |
Internal server error |
Temporary issue on the server side |