Conversations and Messages
Send Message (Stream)
POST /api/chatbots/{chatbotId}/completions/
Parameters
chatbotId
✅
string
Request Body
Request Parameters
conversation
string (uuid)
No
The unique identifier for the conversation. If empty, a new conversation will be created (optional).
message
object (with 5 properties: content, contentPayload, queryMetadata...)
Yes
The message content to be sent.
message.content
string
Yes
The text content of the message.
message.contentPayload
object
No
Additional payload for the message, in JSON format (optional).
message.queryMetadata
object
No
Query metadata, in JSON format (optional).
message.attachments
array[AttachmentInput]
No
A list of attachments for the message (optional).
message.sender
string (uuid)
No
The Contact ID of the sender (optional).
isStreaming
boolean
No
Whether to use streaming mode for the response. Defaults to false (optional).
Request Structure Example
{
"conversation"?: string (uuid) // The unique identifier for the conversation. If empty, a new conversation will be created (optional).
"message": // The message content to be sent.
{
"content": string // The text content of the message.
"contentPayload"?: object // Additional content payload for the message, in JSON format (optional).
"queryMetadata"?: object // Query metadata, in JSON format (optional).
"attachments"?: [ // List of attachments for the message (optional).
{
"id": string (uuid) // The unique identifier for the attachment.
"type": // Attachment type. Possible values: image, video (in development, not yet supported), audio, sticker (in development, not yet supported), other.
* `image` - Image
* `video` - Video
* `audio` - Audio
* `sticker` - Sticker
* `other` - Other
{
}
"filename": string // The filename of the attachment.
"file": string (uri) // The URL address of the attachment file.
}
]
"sender"?: string (uuid) // The Contact ID of the sender (optional).
}
"isStreaming"?: boolean // Whether to respond in streaming mode, defaults to false (optional).
}Request Example Value
Code Examples
Response Body
200
Dialogue response content, or an event stream if streaming.
400
Request parameter error. Possible reasons include: the Contact ID does not belong to the organization.
Send Message (Create)
POST /api/messages/
Request Body
Request Parameters
conversation
string (uuid)
Yes
type
string
No
content
string
No
contentPayload
object
No
attachments
array[AttachmentCreateInput]
No
canvas
object
No
canvas.name
string
Yes
canvas.canvasType
object
Yes
canvas.title
string
Yes
canvas.content
string
Yes
queryMetadata
object
No
Request Structure Example
Request Example Value
Code Examples
Response Body
Status Code: 201
Response Schema Example
Response Example Value
Create a new conversation
POST /api/conversations/
Request Body
Parameters
webChat
string (uuid)
Yes
Request Structure Example
Request Example Value
Code Examples
Response Body
Status Code: 201
Response Schema Example
Response Example Value
Get Message List
GET /api/messages/
Parameters
conversation
✅
string
Conversation ID
cursor
❌
string
The pagination cursor value.
pageSize
❌
integer
Number of results to return per page.
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Get a specific message
GET /api/messages/{id}/
Parameters
id
✅
string
A UUID string identifying this message.
conversation
✅
string
Conversation ID
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Get Conversation List
GET /api/conversations/
Parameters
cursor
❌
string
The pagination cursor value.
inbox
✅
string
Conversation platform ID
keyword
❌
string
Keyword search
pageSize
❌
integer
Number of results to return per page.
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Get a specific conversation
GET /api/conversations/{id}/
Parameters
id
✅
string
A UUID string identifying this conversation.
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Get AI Assistant Conversation Records
GET /api/chatbots/{chatbotPk}/records/
Parameters
chatbotPk
✅
string
A UUID string identifying this Chatbot ID
botMessage
❌
string
Filter for bot replies containing specific content
endDate
✅
string
End date (required, format: YYYY-MM-DD, e.g., 2025-01-31)
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
startDate
✅
string
Start date (required, format: YYYY-MM-DD, e.g., 2025-01-01)
userMessage
❌
string
Filter for user messages containing specific content
Code Examples
Response Body
Status Code: 200
Response Schema Example
Response Example Value
Export Chat Records as Excel File
GET /api/chatbots/{chatbotPk}/records/export-excel/
Parameters
chatbotPk
✅
string
A UUID string identifying this Chatbot ID
botMessage
❌
string
Filter bot messages containing specific content
endDate
✅
string
End date (Required, format: YYYY-MM-DD, e.g., 2025-01-31)
startDate
✅
string
Start date (Required, format: YYYY-MM-DD, e.g., 2025-01-01)
userMessage
❌
string
Filter user messages containing specific content
Code Examples
Response Body
200
Excel file download
Last updated
Was this helpful?
