對話與訊息
發送訊息 (串流)
POST /api/v1/chatbots/{chatbotId}/completions/
參數
chatbotId
✅
string
請求內容
請求參數
conversation
string (uuid)
否
對話的唯一識別碼,如果為空則會建立新對話(可選)
message
object (含 8 個屬性: 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.clientTools
array[any]
否
本次訊息由客戶端(如 Chrome extension)提供的工具定義列表(可選)。每筆需含 name(str)、description(str)、input_schema(dict)。LLM 呼叫時後端不會執行,而是回傳 clientToolCall 內容並結束本回合。
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[MessageAttachmentInput]
否
canvas
object
否
canvas.name
string
是
canvas.canvasType
object
是
canvas.title
string
是
canvas.content
string
是
slideTemplate
object (含 3 個屬性: slug, displayName, thumbnailUrls)
否
slideTemplate.slug
string
是
slideTemplate.displayName
string
是
slideTemplate.thumbnailUrls
array[string]
否
queryMetadata
object
否
查詢元資料,控制可查詢的知識範圍;詳見各端點說明
queryMetadata.knowledgeBases
array[object]
否
可查詢的知識庫清單;空陣列或 null=全部不可查(無權限),未提供=不限制
queryMetadata.labelRelations
object
否
標籤過濾條件;conditions 為空陣列=不做標籤過濾(並非無權限)。必須與 knowledgeBases 一併提供——單獨提供時知識庫檢索不會套用標籤過濾(等同不限制)
queryMetadata.labelRelations.operator
string (enum: AND, OR)
是
標籤條件的組合方式
queryMetadata.labelRelations.conditions
array[any]
否
標籤條件清單,支援巢狀 operator/conditions 組合
metadata
object
否
Message metadata, such as timezone and other environment information
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).
templateId
string (uuid)
否
Document/sheet template ID for file-level compilation (camelCase: templateId).
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
發送主動訊息
POST /api/v1/messages/outgoing/
請求內容
請求參數
conversation
string (uuid)
是
type
string
否
content
string
否
contentPayload
object
否
attachments
array[MessageAttachmentInput]
否
canvas
object
否
canvas.name
string
是
canvas.canvasType
object
是
canvas.title
string
是
canvas.content
string
是
slideTemplate
object (含 3 個屬性: slug, displayName, thumbnailUrls)
否
slideTemplate.slug
string
是
slideTemplate.displayName
string
是
slideTemplate.thumbnailUrls
array[string]
否
queryMetadata
object
否
查詢元資料,控制可查詢的知識範圍;詳見各端點說明
queryMetadata.knowledgeBases
array[object]
否
可查詢的知識庫清單;空陣列或 null=全部不可查(無權限),未提供=不限制
queryMetadata.labelRelations
object
否
標籤過濾條件;conditions 為空陣列=不做標籤過濾(並非無權限)。必須與 knowledgeBases 一併提供——單獨提供時知識庫檢索不會套用標籤過濾(等同不限制)
queryMetadata.labelRelations.operator
string (enum: AND, OR)
是
標籤條件的組合方式
queryMetadata.labelRelations.conditions
array[any]
否
標籤條件清單,支援巢狀 operator/conditions 組合
metadata
object
否
Message metadata, such as timezone and other environment information
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).
templateId
string (uuid)
否
Document/sheet template ID for file-level compilation (camelCase: templateId).
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 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 Message.
conversation
✅
string
對話 ID
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得對話列表
GET /api/v1/conversations/
參數
assignee
❌
string
chatbot
❌
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 Conversation.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
重新命名對話
PATCH /api/v1/conversations/{id}/rename/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
title
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除對話
DELETE /api/v1/conversations/{id}/
參數
id
✅
string
A UUID string identifying this Conversation.
程式碼範例
回應內容
204
No response body
中止 AI 回覆
POST /api/v1/conversations/{conversationId}/stop-response/
參數
conversationId
✅
string
程式碼範例
回應內容
200
No response body
提交對話滿意度
POST /api/v1/conversations/{id}/satisfaction/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
satisfactionScore
integer
是
Conversation satisfaction rating on a 5-point scale (1=very dissatisfied, 5=very satisfied)
satisfactionComment
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 409 - 此對話已提交過滿意度
列出對話事件
GET /api/v1/conversations/{id}/events/
參數
id
✅
string
A UUID string identifying this Conversation.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
指派對話給成員
PATCH /api/v1/conversations/{id}/assign/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
assignee
string (uuid)
否
transferReason
string
否
tagIds
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
認領對話
PATCH /api/v1/conversations/{id}/claim/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
transferReason
string
否
tagIds
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
轉接對話給其他成員
PATCH /api/v1/conversations/{id}/transfer/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
assignee
string (uuid)
否
transferReason
string
否
tagIds
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
轉回 AI 回覆
PATCH /api/v1/conversations/{id}/return-to-ai/
參數
id
✅
string
A UUID string identifying this Conversation.
請求內容
請求參數
requireContextReady
boolean
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 409 - Agent context not ready: `detail` plus `agentContext` (pending / failed writes)
列出對話產出檔案
GET /api/v1/conversations/{conversationId}/outputs/
參數
conversationId
✅
string
程式碼範例
回應內容
200
No response body
分享對話
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 Message Feedback.
messagePk
✅
string
請求內容
請求參數
type
object
是
suggestion
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除訊息回饋
DELETE /api/v1/messages/{messagePk}/feedback/{id}/
參數
id
✅
string
A UUID string identifying this Message Feedback.
messagePk
✅
string
程式碼範例
回應內容
204
成功刪除回饋
400
此回饋不屬於指定的訊息
取得對話紀錄列表
GET /api/v1/records/
參數
callerMember
❌
array
Multiple values may be separated by commas.
chatbot
❌
string
篩選特定 AI 助理 (UUID)
endDate
❌
string
結束日期(格式:YYYY-MM-DD,如:2025-01-31)
endDatetime
❌
string
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.
source
❌
string
篩選記錄來源,逗號分隔;省略時同時回傳兩種來源。interactive = 使用者對話,scheduled = 排程執行。
startDate
❌
string
開始日期(格式:YYYY-MM-DD,如:2025-01-01)
startDatetime
❌
string
tool
❌
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定對話紀錄
GET /api/v1/records/{id}/
參數
id
✅
string
A UUID string identifying this Chatbot Record.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 404 - 找不到指定的對話記錄
建立對話紀錄匯出請求
POST /api/v1/records/export-excel-requests/
請求內容
請求參數
chatbot
string
否
指定要匯出的 Chatbot UUID,支援逗號分隔多個 UUID。留空則匯出組織內所有有權限的 Chatbot。
chatbotId
string (uuid)
否
指定要匯出的 Chatbot UUID(chatbot 的別名,僅支援單個 UUID)。
keyword
string
否
過濾包含特定關鍵字的對話記錄(搜尋用戶訊息和機器人回覆)。
largeLanguageModel
string
否
指定要匯出的大型語言模型 UUID,支援逗號分隔多個 UUID。
startDate
string (date)
否
開始日期 (YYYY-MM-DD),包含當天。
endDate
string (date)
否
結束日期 (YYYY-MM-DD),包含當天。
startDatetime
string (timestamp)
否
精確開始時間(ISO 8601,包含該時間點),與列表下鑽篩選同語意。
endDatetime
string (timestamp)
否
精確結束時間(ISO 8601,不包含該時間點),與列表下鑽篩選同語意。
hasError
boolean
否
過濾是否有錯誤的紀錄(true 僅含有錯誤、false 僅含無錯誤)。
errorType
string
否
過濾錯誤類型,支援逗號分隔多選(OR 邏輯),值域同對話紀錄列表。
hasFeedback
boolean
否
過濾是否有使用者評價(true 僅含有讚/倒讚、false 僅含無評價)。
feedbackType
string
否
過濾使用者評價類型(like / dislike),支援逗號分隔多選(OR 邏輯)。
callerMember
string
否
過濾發話成員 UUID,支援逗號分隔多選(OR 邏輯)。
tool
string (uuid)
否
過濾呼叫過該工具的問答(工具 UUID,含平台內建工具;執行失敗也算)。
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
取得對話紀錄匯出狀態
GET /api/v1/records/export-excel-requests/{exportId}/
參數
exportId
✅
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
最後更新於
這有幫助嗎?