對話與訊息
發送訊息 (串流)
POST /api/v1/chatbots/{chatbotId}/completions/
參數
chatbotId
✅
string
請求內容
請求參數
conversation
string (uuid)
否
對話的唯一識別碼,如果為空則會建立新對話(可選)
message
object (含 7 個屬性: content, contentPayload, queryMetadata...)
是
要發送的訊息內容
message.content
string
是
訊息的文字內容
message.contentPayload
object
否
訊息的額外內容負載,JSON 格式(可選)
message.queryMetadata
object
否
查詢元數據,JSON 格式(可選)
message.metadata
object
否
訊息的環境元數據,例如時區等資訊,JSON 格式(可選)
message.attachments
array[AttachmentInput]
否
訊息的附件列表(可選)
message.toolIds
array[string]
否
本次訊息指定啟用的工具 ID 列表(可選)
message.sender
string (uuid)
否
發送者的 Contact ID(可選)
isStreaming
boolean
否
是否使用串流模式回應,預設為 false(可選)
waitForAttachments
boolean
否
是否等待附件處理完成後再進入 agent workflow,預設為 true(可選)
請求結構範例
請求範例值
程式碼範例
回應內容
200
對話回應內容,若是串流則為事件流
400
請求參數錯誤,可能原因包括:Contact ID 不屬於該組織
發送訊息 (建立)
POST /api/v1/messages/
請求內容
請求參數
conversation
string (uuid)
是
type
string
否
content
string
否
contentPayload
object
否
attachments
array[AttachmentCreateInput]
否
canvas
object
否
canvas.name
string
是
canvas.canvasType
object
是
canvas.title
string
是
canvas.content
string
是
queryMetadata
object
否
metadata
object
否
訊息的元數據,例如時區等環境資訊
broadcast
boolean
否
skipCopilotTrigger
boolean
否
suggestedForId
string (uuid)
否
skillIds
array[string]
否
Per-message selected skill IDs from the WebChat client (camelCase: skillIds).
toolIds
array[string]
否
Per-message selected tool IDs from the WebChat client (camelCase: toolIds).
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
發送主動訊息
POST /api/v1/messages/outgoing/
請求內容
請求參數
conversation
string (uuid)
是
type
string
否
content
string
否
contentPayload
object
否
attachments
array[AttachmentCreateInput]
否
canvas
object
否
canvas.name
string
是
canvas.canvasType
object
是
canvas.title
string
是
canvas.content
string
是
queryMetadata
object
否
metadata
object
否
訊息的元數據,例如時區等環境資訊
broadcast
boolean
否
skipCopilotTrigger
boolean
否
suggestedForId
string (uuid)
否
skillIds
array[string]
否
Per-message selected skill IDs from the WebChat client (camelCase: skillIds).
toolIds
array[string]
否
Per-message selected tool IDs from the WebChat client (camelCase: toolIds).
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
建立新的對話
POST /api/v1/conversations/
請求內容
請求參數
webChat
string (uuid)
是
contact
string (uuid)
否
clientPlatform
object
否
workingDirectory
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
取得訊息列表
GET /api/v1/messages/
參數
conversation
✅
string
對話 ID
cursor
❌
string
The pagination cursor value.
pageSize
❌
integer
Number of results to return per page.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定訊息
GET /api/v1/messages/{id}/
參數
id
✅
string
A UUID string identifying this 訊息.
conversation
✅
string
對話 ID
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得對話列表
GET /api/v1/conversations/
參數
assignee
❌
string
contact
❌
string
聯絡人 ID
contactTags
❌
array
Multiple values may be separated by commas.
cursor
❌
string
The pagination cursor value.
endDate
❌
string
externalConversationId
❌
string
externalSource
❌
string
inbox
❌
string
對話平台 ID
isPinned
❌
string
keyword
❌
string
關鍵字搜尋
mine
❌
boolean
mode
❌
string
`chat`: Chat ; `cowork`: Cowork;
pageSize
❌
integer
Number of results to return per page.
startDate
❌
string
status
❌
array
`open`: Open ; `resolved`: Resolved ; `queued`: Queued;
tags
❌
array
Multiple values may be separated by commas.
unassigned
❌
boolean
updatedAfter
❌
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定對話
GET /api/v1/conversations/{id}/
參數
id
✅
string
A UUID string identifying this 對話.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定對話
GET /api/v1/conversations/tab-counts/
參數
inbox
❌
string
Filter by inbox UUID
程式碼範例
回應內容
狀態碼: 200 - Tab counts
回應結構範例
回應範例值
重新命名對話
PATCH /api/v1/conversations/{id}/rename/
參數
id
✅
string
A UUID string identifying this 對話.
請求內容
請求參數
title
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
分享對話
POST /api/v1/conversations/{conversationPk}/share/
參數
conversationPk
✅
string
請求內容
請求參數
shareScope
string (enum: organization, group, member)
是
organization: Organization ; group: Group ; member: Member;
permission
object
否
title
string
否
description
string
否
groupIds
array[string]
否
memberIds
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
快速分享對話
POST /api/v1/conversations/{conversationPk}/share/quick/
參數
conversationPk
✅
string
請求內容
請求參數
shareScope
string (enum: organization, group, member)
是
organization: Organization ; group: Group ; member: Member;
permission
object
否
title
string
否
description
string
否
groupIds
array[string]
否
memberIds
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
列出分享的對話
GET /api/v1/shared-conversations/
參數
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定分享對話
GET /api/v1/shared-conversations/{id}/
參數
id
✅
string
A UUID string identifying this Shared Conversation.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新分享對話
PATCH /api/v1/shared-conversations/{id}/
參數
id
✅
string
A UUID string identifying this Shared Conversation.
請求內容
請求參數
title
string
否
description
string
否
permission
string (enum: readonly, copy)
否
readonly: Read Only ; copy: Copyable;
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除分享對話
DELETE /api/v1/shared-conversations/{id}/
參數
id
✅
string
A UUID string identifying this Shared Conversation.
程式碼範例
回應內容
204
No response body
複製分享對話
POST /api/v1/shared-conversations/{id}/fork/
參數
id
✅
string
A UUID string identifying this Shared Conversation.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得我的分享列表
GET /api/v1/shared-conversations/my-shares/
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
建立訊息回饋
POST /api/v1/messages/{messagePk}/feedback/
參數
messagePk
✅
string
請求內容
請求參數
type
object
是
suggestion
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 400 - 此訊息已有回饋,請使用 PATCH 方法更新
更新訊息回饋
PUT /api/v1/messages/{messagePk}/feedback/{id}/
參數
id
✅
string
A UUID string identifying this 訊息回饋.
messagePk
✅
string
請求內容
請求參數
type
object
是
suggestion
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除訊息回饋
DELETE /api/v1/messages/{messagePk}/feedback/{id}/
參數
id
✅
string
A UUID string identifying this 訊息回饋.
messagePk
✅
string
程式碼範例
回應內容
204
成功刪除回饋
400
此回饋不屬於指定的訊息
取得對話紀錄列表
GET /api/v1/records/
參數
chatbot
❌
string
篩選特定 AI 助理 (UUID)
endDate
❌
string
結束日期(格式:YYYY-MM-DD,如:2025-01-31)
errorType
❌
array
Multiple values may be separated by commas. `system`: System ; `llm`: LLM ; `embedding`: Embedding ; `reranker`: Reranker ; `vector_db`: Vector DB ; `workflow`: Workflow ; `tool`: Tool ; `timeout`: Ti...
feedbackType
❌
array
Multiple values may be separated by commas. `like`: Like ; `dislike`: Dislike;
hasError
❌
boolean
hasFeedback
❌
boolean
keyword
❌
string
關鍵字搜尋 (同時搜尋使用者訊息和機器人回答內容)
largeLanguageModel
❌
string
篩選特定大型語言模型 (UUID)
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
startDate
❌
string
開始日期(格式:YYYY-MM-DD,如:2025-01-01)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定對話紀錄
GET /api/v1/records/{id}/
參數
id
✅
string
A UUID string identifying this Chatbot 紀錄.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 404 - 找不到指定的對話記錄
取得特定對話紀錄
GET /api/v1/records/export-excel-requests/
參數
endDate
❌
string
結束日期(格式:YYYY-MM-DD,如:2025-01-31)
keyword
❌
string
過濾包含特定關鍵字的對話記錄(同時搜尋用戶訊息和機器人回覆)
startDate
❌
string
開始日期(格式:YYYY-MM-DD,如:2025-01-01)
程式碼範例
回應內容
200
Excel 檔案下載
建立對話紀錄匯出請求
POST /api/v1/records/export-excel-requests/
參數
endDate
❌
string
結束日期(格式:YYYY-MM-DD,如:2025-01-31)
keyword
❌
string
過濾包含特定關鍵字的對話記錄(同時搜尋用戶訊息和機器人回覆)
startDate
❌
string
開始日期(格式:YYYY-MM-DD,如:2025-01-01)
請求內容
請求參數
chatbot
string
否
指定要匯出的 Chatbot UUID,支援逗號分隔多個 UUID。留空則匯出組織內所有有權限的 Chatbot。
chatbotId
string (uuid)
否
指定要匯出的 Chatbot UUID(chatbot 的別名,僅支援單個 UUID)。
largeLanguageModel
string
否
指定要匯出的大型語言模型 UUID,支援逗號分隔多個 UUID。
請求結構範例
請求範例值
程式碼範例
回應內容
200
Excel 檔案下載
取得對話紀錄匯出狀態
GET /api/v1/records/export-excel-requests/{exportId}/
參數
exportId
✅
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
Last updated
Was this helpful?
