Send Chat Message
POST/api/chat/message
This endpoint sends a message to a specified conversation within a workspace. The request must include a valid API key and user ID.
Request
Header Parameters
API key to authorize the request.
ID of the user making the request.
- application/json
Body
required
ID of the workspace.
ID of the conversation.
The message to be sent.
Indicates if this is the first message in the conversation.
Responses
- 200
- 400
- 403
- 404
- 500
Successfully sent the message and retrieved follow-up questions and source snippets.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Array [
]
data
object
The ID of the response.
The query that was sent.
followUps
object[]
The ID of the follow-up question.
The text of the follow-up question.
sourceSnips
object[]
The ID of the source snippet.
The text of the source snippet.
The type of the message, which is 'response'.
{
"data": {
"id": "string",
"query": "string",
"followUps": [
{
"id": "string",
"text": "string"
}
],
"sourceSnips": [
{
"id": "string",
"text": "string"
}
],
"likes": [
"string"
],
"dislikes": [
"string"
],
"type": "string"
}
}
Invalid body or fetch operation failed.
- application/json
- Schema
- Example (from schema)
Schema
Error message indicating the issue with the request body or fetch operation.
{
"error": "string"
}
Invalid API key.
- application/json
- Schema
- Example (from schema)
Schema
error
object
Detailed error message indicating that the API key is invalid.
{
"error": {
"message": "string"
}
}
Conversation or workspace not found.
- application/json
- Schema
- Example (from schema)
Schema
error
object
Error message indicating that the conversation or workspace was not found.
{
"error": {
"message": "string"
}
}
Internal server error.
- application/json
- Schema
- Example (from schema)
Schema
Error message indicating an internal server error.
{
"message": "string"
}