總覽說明
文件概述
Documentation of API endpoints of MaiAgent
串接範例程式碼
若需參考 API 完整用例及程式碼,可至以下 Github Repository 查看:
C# 範例
Python 範例
API 分類與端點列表
AI 助理
POSTapi/v1/chatbots: 建立新 AI 助理GETapi/v1/embedding-models: 列出 Embedding ModelGETapi/v1/reranker-models: 列出 Reranker ModelGETapi/v1/large-language-models: 列出大型語言模型GETapi/v1/chatbots: 取得 AI 助理列表GETapi/v1/chatbots/{id}: 取得特定 AI 助理PUTapi/v1/chatbots/{id}: 更新 AI 助理PATCHapi/v1/chatbots/{id}: 部分更新 AI 助理DELETEapi/v1/chatbots/{id}: 刪除 AI 助理POSTapi/v1/chatbots/{id}/duplicate: 複製 AI 助理PATCHapi/v1/chatbots/{id}/enable-evaluation: 啟用或停用評估功能
附件與檔案
POSTapi/v1/attachments-upload: 建立新附件 (整合)POSTapi/v1/upload-presigned-url: 取得檔案上傳用的預簽署 URLPOSTapi/v1/attachments: Presigned 上傳附件POSTapi/v1/conversations/{conversationPk}/attachments: 建立對話附件GETapi/v1/allowed-file-specs: 取得允許的檔案規格
知識庫(新版)
POSTapi/v1/knowledge-bases: 建立知識庫GETapi/v1/knowledge-bases: 列出所有知識庫GETapi/v1/knowledge-bases/{id}: 取得特定知識庫詳情GETapi/v1/knowledge-bases/{id}/search: 搜尋特定知識庫的內容PUTapi/v1/knowledge-bases/{id}: 更新知識庫PATCHapi/v1/knowledge-bases/{id}: 部分更新知識庫DELETEapi/v1/knowledge-bases/{id}: 刪除知識庫GETapi/v1/knowledge-bases/{id}/check-rrf-availability: 檢查 RRF 可用性GETapi/v1/knowledge-bases/{id}/export-labels-excel: 匯出標籤 ExcelPOSTapi/v1/knowledge-bases/{id}/import-labels-excel: 匯入標籤 ExcelGETapi/v1/knowledge-bases/{id}/export-metadata-excel: 匯出元資料 ExcelPOSTapi/v1/knowledge-bases/{id}/import-metadata-excel: 匯入元資料 ExcelPOSTapi/v1/knowledge-bases/{knowledgeBasePk}/labels: 建立新標籤GETapi/v1/knowledge-bases/{knowledgeBasePk}/labels: 列出知識庫中的標籤GETapi/v1/knowledge-bases/{knowledgeBasePk}/labels/{id}: 取得特定標籤詳情PATCHapi/v1/knowledge-bases/{knowledgeBasePk}/labels/{id}: 部分更新標籤DELETEapi/v1/knowledge-bases/{knowledgeBasePk}/labels/{id}: 刪除標籤POSTapi/v1/knowledge-bases/{knowledgeBasePk}/metadata-keys: 建立元資料欄位GETapi/v1/knowledge-bases/{knowledgeBasePk}/metadata-keys/{id}: 取得特定元資料欄位POSTapi/v1/knowledge-bases/{knowledgeBasePk}/files: 上傳檔案到知識庫PATCHapi/v1/knowledge-bases/{knowledgeBasePk}/files/batch-reparse: 批量重新解析檔案GETapi/v1/knowledge-bases/{knowledgeBasePk}/files: 列出知識庫中的檔案GETapi/v1/knowledge-bases/{knowledgeBasePk}/files/{id}: 取得特定檔案詳情PATCHapi/v1/knowledge-bases/{knowledgeBasePk}/files/{id}: 部分更新檔案DELETEapi/v1/knowledge-bases/{knowledgeBasePk}/files/{id}: 刪除檔案GETapi/v1/knowledge-bases/{knowledgeBasePk}/documents: 列出知識庫文件PATCHapi/v1/knowledge-bases/{knowledgeBasePk}/documents/{id}: 部分更新文件POSTapi/v1/knowledge-bases/{knowledgeBasePk}/faqs: 建立新的 FAQPOSTapi/v1/knowledge-bases/{knowledgeBasePk}/faqs/{id}/update-metadata: 更新 FAQ 元資料POSTapi/v1/knowledge-bases/{knowledgeBasePk}/faqs/batch-delete: 批量刪除 FAQGETapi/v1/knowledge-bases/{knowledgeBasePk}/faqs: 列出特定知識庫的所有 FAQGETapi/v1/knowledge-bases/{knowledgeBasePk}/faqs/{id}: 取得特定 FAQ 詳情PATCHapi/v1/knowledge-bases/{knowledgeBasePk}/faqs/{id}: 部分更新 FAQDELETEapi/v1/knowledge-bases/{knowledgeBasePk}/faqs/{id}: 刪除 FAQ
知識庫(舊版)
GETapi/v1/chatbots/{id}/knowledge-bases-files: 取得 AI 助理的知識庫檔案列表GETapi/v1/chatbots/{id}/knowledge-bases-faqs: 取得 AI 助理的知識庫 FAQ 列表GETapi/v1/chatbot-text-nodes: 取得 AI 助理的所有檔案的文本節點GETapi/v1/chatbot-text-nodes/{id}: 取得 AI 助理的特定檔案的文本節點POSTapi/v1/chatbots/{id}/search: 搜尋測試GETapi/v1/parsers/supported-file-types: 列出檔案類型支援的解析器
對話與訊息
POSTapi/v1/chatbots/{chatbotId}/completions: 發送訊息 (串流)POSTapi/v1/messages: 發送訊息 (建立)POSTapi/v1/messages/outgoing: 發送主動訊息POSTapi/v1/conversations: 建立新的對話GETapi/v1/messages: 取得訊息列表GETapi/v1/messages/{id}: 取得特定訊息GETapi/v1/conversations: 取得對話列表GETapi/v1/conversations/{id}: 取得特定對話PATCHapi/v1/conversations/{id}/rename: 重新命名對話POSTapi/v1/conversations/{conversationPk}/share: 分享對話POSTapi/v1/conversations/{conversationPk}/share/quick: 快速分享對話GETapi/v1/shared-conversations: 列出分享的對話GETapi/v1/shared-conversations/{id}: 取得特定分享對話PATCHapi/v1/shared-conversations/{id}: 更新分享對話DELETEapi/v1/shared-conversations/{id}: 刪除分享對話POSTapi/v1/shared-conversations/{id}/fork: 複製分享對話GETapi/v1/shared-conversations/my-shares: 取得我的分享列表POSTapi/v1/messages/{messagePk}/feedback: 建立訊息回饋PUTapi/v1/messages/{messagePk}/feedback/{id}: 更新訊息回饋DELETEapi/v1/messages/{messagePk}/feedback/{id}: 刪除訊息回饋GETapi/v1/records: 取得對話紀錄列表GETapi/v1/records/{id}: 取得特定對話紀錄POSTapi/v1/records/export-excel-requests: 建立對話紀錄匯出請求GETapi/v1/records/export-excel-requests/{exportId}: 取得對話紀錄匯出狀態
對話 Widget
POSTapi/v1/web-chats: 建立 Web ChatGETapi/v1/web-chats: 列出 Web ChatGETapi/v1/web-chats/{id}: 取得特定 Web ChatPUTapi/v1/web-chats/{id}: 更新 Web ChatPATCHapi/v1/web-chats/{id}: 部分更新 Web ChatPOSTapi/v1/web-chats/{id}/setup-contact-credentials: 設定聯絡人憑證POSTapi/v1/web-chats/{id}/voice-agent/token: 取得語音助理 TokenPOSTapi/v1/web-chats/{webchatPk}/batch-qas: 上傳批次 QA 檔案GETapi/v1/web-chats/{webchatPk}/batch-qas/{id}/export-excel: 匯出批次 QA 為 ExcelGETapi/v1/chatbots/{chatbotPk}/llm-usage-statistics: 取得 LLM 使用統計GETapi/v1/chatbots/{chatbotPk}/statistics: 取得 AI 助理統計數據
組織與成員
POSTapi/v1/auth/registration: 帳號註冊POSTapi/v1/auth/password/change: 更換密碼POSTapi/v1/organizations: 建立新組織POSTapi/v1/organizations/{organizationPk}/members: 新增成員至指定組織GETapi/v1/organizations: 取得組織列表GETapi/v1/organizations/{id}: 取得特定組織資訊GETapi/v1/users/current: 取得當前用戶詳細資訊GETapi/v1/permissions: 取得當前用戶權限GETapi/v1/organizations/{organizationPk}/members: 取得指定組織的成員列表GETapi/v1/organizations/{organizationPk}/members/{id}: 取得特定成員詳細資訊PUTapi/v1/organizations/{id}: 更新組織資訊PUTapi/v1/users/current: 更新當前用戶詳細資訊PUTapi/v1/organizations/{organizationPk}/members/{id}: 更新指定組織成員資訊DELETEapi/v1/organizations/{id}: 刪除組織DELETEapi/v1/organizations/{organizationPk}/members/{id}: 刪除指定成員GETapi/v1/organizations/{organizationPk}/usage-statistics/chatbots: 取得 AI 助理使用統計GETapi/v1/organizations/{organizationPk}/usage-statistics/chatbots/summary: 取得 AI 助理使用統計摘要
角色與權限
POSTapi/v1/organizations/{organizationPk}/groups: 建立角色GETapi/v1/permissions: 列出權限清單GETapi/v1/organizations/{organizationPk}/groups: 取得角色列表GETapi/v1/organizations/{organizationPk}/groups/{id}: 取得角色的詳情GETapi/v1/organizations/{organizationPk}/groups/{groupPk}/group-chatbots: 取得角色的 AI 助理列表PATCHapi/v1/organizations/{organizationPk}/groups/{id}: 部分更新角色權限DELETEapi/v1/organizations/{organizationPk}/groups/{id}: 刪除角色DELETEapi/v1/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/{id}: 移除角色裡的 AI 助理
聯絡人
GETapi/v1/contacts: 列出聯絡人POSTapi/v1/contacts: 建立聯絡人GETapi/v1/contacts/{id}: 取得聯絡人詳情PUTapi/v1/contacts/{id}: 更新聯絡人PATCHapi/v1/contacts/{id}: 部分更新聯絡人DELETEapi/v1/contacts/{id}: 刪除聯絡人GETapi/v1/contacts/{id}/conversations: 取得聯絡人的對話列表GETapi/v1/contacts/{id}/conversations/latest: 取得聯絡人最新對話POSTapi/v1/contacts/broadcast-message: 群發訊息
工具與連接器
POSTapi/v1/tools: 建立工具GETapi/v1/tools: 列出工具GETapi/v1/tools/{id}: 取得特定工具PUTapi/v1/tools/{id}: 更新工具PATCHapi/v1/tools/{id}: 部分更新工具DELETEapi/v1/tools/{id}: 刪除工具GETapi/v1/tools/available-tools: 列出可用工具POSTapi/v1/connectors: 建立連接器GETapi/v1/connectors: 列出連接器GETapi/v1/connectors/{id}: 取得特定連接器PUTapi/v1/connectors/{id}: 更新連接器PATCHapi/v1/connectors/{id}: 部分更新連接器DELETEapi/v1/connectors/{id}: 刪除連接器GETapi/v1/connectors/{id}/authorized-members: 列出連接器授權成員DELETEapi/v1/connectors/{id}/authorized-members/{memberId}: 移除連接器授權成員GETapi/v1/mcp/registry: 列出 MCP 工具登錄GETapi/v1/mcp/registry/{id}: 取得特定 MCP 工具登錄
技能
POSTapi/v1/skills/upload: 上傳技能GETapi/v1/skills: 列出技能GETapi/v1/skills/{id}: 取得特定技能PUTapi/v1/skills/{id}: 更新技能PATCHapi/v1/skills/{id}: 部分更新技能DELETEapi/v1/skills/{id}: 刪除技能GETapi/v1/skills/{id}/export: 匯出技能POSTapi/v1/skills/{id}/reupload: 重新上傳技能GETapi/v1/skills/{skillPk}/resources: 列出技能資源DELETEapi/v1/skills/{skillPk}/resources/{id}: 刪除技能資源GETapi/v1/skills/{skillPk}/resources/{id}/download: 下載技能資源
資料庫
POSTapi/v1/sql-databases: 建立 SQL 資料庫連線GETapi/v1/sql-databases: 列出 SQL 資料庫GETapi/v1/sql-databases/{id}: 取得特定 SQL 資料庫PUTapi/v1/sql-databases/{id}: 更新 SQL 資料庫PATCHapi/v1/sql-databases/{id}: 部分更新 SQL 資料庫DELETEapi/v1/sql-databases/{id}: 刪除 SQL 資料庫POSTapi/v1/sql-databases/{id}/test-connection: 測試資料庫連線POSTapi/v1/sql-databases/{id}/upload-files: 上傳檔案至資料庫POSTapi/v1/sql-databases/batch-delete: 批量刪除 SQL 資料庫GETapi/v1/sql-databases/{sqlDatabasePk}/tables: 列出資料表POSTapi/v1/sql-databases/{sqlDatabasePk}/tables: 建立資料表GETapi/v1/sql-databases/{sqlDatabasePk}/tables/{id}: 取得特定資料表PATCHapi/v1/sql-databases/{sqlDatabasePk}/tables/{id}: 部分更新資料表DELETEapi/v1/sql-databases/{sqlDatabasePk}/tables/{id}: 刪除資料表POSTapi/v1/sql-databases/{sqlDatabasePk}/tables/batch-delete: 批量刪除資料表POSTapi/v1/database-connection/test: 測試資料庫連線(通用)GETapi/v1/database-examples: 列出資料庫連線字串範例GETapi/v1/database-examples/{id}: 取得特定連線字串範例GETapi/v1/chatbots/{chatbotPk}/databases: 列出 AI 助理的資料庫配置POSTapi/v1/chatbots/{chatbotPk}/databases: 新增 AI 助理的資料庫配置GETapi/v1/chatbots/{chatbotPk}/databases/{id}: 取得特定資料庫配置PUTapi/v1/chatbots/{chatbotPk}/databases/{id}: 更新資料庫配置PATCHapi/v1/chatbots/{chatbotPk}/databases/{id}: 部分更新資料庫配置DELETEapi/v1/chatbots/{chatbotPk}/databases/{id}: 刪除資料庫配置
認證要求
所有 API 請求必須在 HTTP Header 中包含 API Key,格式如下:
使用說明
請仔細閱讀每個端點的詳細文檔
在每個分類頁面中可以找到詳細的請求與回應格式
所有範例程式碼都提供了多種程式語言的版本
狀態碼說明
200
請求成功
201
資源成功建立
400
請求格式錯誤
401
認證失敗
403
權限不足
404
資源不存在
500
伺服器錯誤
Last updated
Was this helpful?
