POST /api/v1/chat/message
Sends a message in the current chat session.
Authentication
Optional. Works for both authenticated and anonymous sessions (identified by session cookie).
Request
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Message text to send |
Example
curl -X POST https://intotes.com/api/v1/chat/message \
-H "Content-Type: application/json" \
-d '{
"text": "Thanks for your help!"
}'
Response
200 OK
Returns the created message wrapped in a messages array (single element).
{
"messages": [
{
"id": 5,
"sender": "user",
"text": "Thanks for your help!",
"created_at": 1712238600000
}
]
}
Note: created_at is returned as Unix milliseconds.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | bad_request | Missing or empty message field |
| 404 | not_found | No active chat session found |
| 500 | internal_error | Server failed to send message |