Skip to content

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