對話平台
對話平台(Inbox)是對話的歸屬單位,也是 Webhook 的設定位置:每個對話平台可以設定多組 Webhook,在使用者訊息進入(incoming)或 Agent 回覆(outgoing)時推送到您的系統。Web Chat 類型的對話平台另有 Web Chat 端點。設定方式與 payload 格式見技術手冊 Webhook。
列出對話平台
GET /api/v1/inboxes/
參數
accessType
❌
string
存取類型過濾
channelType
❌
string
頻道類型過濾
chatbot
❌
string
聊天機器人 ID 過濾
isActive
❌
boolean
是否啟用過濾
ordering
❌
string
Which field to use when ordering the results.
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
pagination
❌
string
是否分頁 (true/false)。當設為 false 時,會回傳簡化版的資料格式
query
❌
string
source
❌
string
`self_built`: self_built ; `built_in`: built_in ; `all`: all;
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/inboxes/?accessType=example&channelType=example&chatbot=example&isActive=true&ordering=example&page=1&pageSize=1&pagination=example&query=example&source=all" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/v1/inboxes/?accessType=example&channelType=example&chatbot=example&isActive=true&ordering=example&page=1&pageSize=1&pagination=example&query=example&source=all", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});回應內容
狀態碼: 200 - 對話平台列表
回應結構範例
回應範例值
建立對話平台
POST /api/v1/inboxes/
請求內容
請求參數
name
string
是
channelType
string (enum: line, telegram, teams, web, messenger, instagram, email, whatsapp, slack, team_plus, line_works, viber)
是
line: LINE ; telegram: Telegram ; teams: Teams ; web: Web ; messenger: Messenger ; instagram: Instagram ; email: Email ; whatsapp: WhatsApp ; slack: Slack ; team_plus: Team+ ; `lin...
unreadConversationsCount
integer
否
signAuth
object (含 8 個屬性: id, signSource, signParams...)
否
signAuth.signSource
string (uuid)
是
signAuth.signParams
object
是
signAuth.signParams.keycloak
object (含 3 個屬性: clientId, url, realm)
是
signAuth.signParams.keycloak.clientId
string
是
signAuth.signParams.keycloak.url
string
是
signAuth.signParams.keycloak.realm
string
是
signAuth.signParams.line
object (含 1 個屬性: liffId)
是
signAuth.signParams.line.liffId
string
是
signAuth.signParams.ad
object (含 1 個屬性: saml)
是
signAuth.signParams.ad.saml
string
是
signAuth.signParams.google
object (含 1 個屬性: enabled)
否
signAuth.signParams.google.enabled
boolean
是
signAuth.sourceIdAccessEnabled
boolean
否
When enabled, embedded visitors presenting a Source ID (verified per the verify mode below) may chat without going through the login flow. Disabled keeps every existing behavior unchanged.
signAuth.sourceIdVerifyMode
object
否
"Require signature verification": the embedding site must send an HMAC signature computed on its backend. "Source ID only": anyone knowing a Source ID can act as that contact; suitable only for testin...
signAuth.sourceIdSignatureTtlMinutes
object
否
How long a signature can be used to obtain the contact identity. Not a session lifetime: once exchanged, the session follows the existing WebChat mechanism. 1: 1 ; 5: 5 ; 15: 15;
signAuth.keycloakTokenPassthrough
boolean
否
When enabled, the Keycloak access token a visitor logged in with is forwarded as the Authorization header when the AI calls MCP and API tools on their behalf, so tools do not require a separate per-to...
signAuth.keycloakTokenPassthroughAllowedHosts
array[string]
否
Hostnames (or "*.example.com" wildcards) of the tools the visitor Keycloak token may be sent to
enableAnalysis
boolean
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
取得特定對話平台
GET /api/v1/inboxes/{id}/
參數
id
✅
string
A UUID string identifying this Inbox.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新對話平台
PUT /api/v1/inboxes/{id}/
參數
id
✅
string
A UUID string identifying this Inbox.
請求內容
請求參數
name
string
是
channelType
string (enum: line, telegram, teams, web, messenger, instagram, email, whatsapp, slack, team_plus, line_works, viber)
是
line: LINE ; telegram: Telegram ; teams: Teams ; web: Web ; messenger: Messenger ; instagram: Instagram ; email: Email ; whatsapp: WhatsApp ; slack: Slack ; team_plus: Team+ ; `lin...
unreadConversationsCount
integer
否
signAuth
object (含 8 個屬性: id, signSource, signParams...)
否
signAuth.signSource
string (uuid)
是
signAuth.signParams
object
是
signAuth.signParams.keycloak
object (含 3 個屬性: clientId, url, realm)
是
signAuth.signParams.keycloak.clientId
string
是
signAuth.signParams.keycloak.url
string
是
signAuth.signParams.keycloak.realm
string
是
signAuth.signParams.line
object (含 1 個屬性: liffId)
是
signAuth.signParams.line.liffId
string
是
signAuth.signParams.ad
object (含 1 個屬性: saml)
是
signAuth.signParams.ad.saml
string
是
signAuth.signParams.google
object (含 1 個屬性: enabled)
否
signAuth.signParams.google.enabled
boolean
是
signAuth.sourceIdAccessEnabled
boolean
否
When enabled, embedded visitors presenting a Source ID (verified per the verify mode below) may chat without going through the login flow. Disabled keeps every existing behavior unchanged.
signAuth.sourceIdVerifyMode
object
否
"Require signature verification": the embedding site must send an HMAC signature computed on its backend. "Source ID only": anyone knowing a Source ID can act as that contact; suitable only for testin...
signAuth.sourceIdSignatureTtlMinutes
object
否
How long a signature can be used to obtain the contact identity. Not a session lifetime: once exchanged, the session follows the existing WebChat mechanism. 1: 1 ; 5: 5 ; 15: 15;
signAuth.keycloakTokenPassthrough
boolean
否
When enabled, the Keycloak access token a visitor logged in with is forwarded as the Authorization header when the AI calls MCP and API tools on their behalf, so tools do not require a separate per-to...
signAuth.keycloakTokenPassthroughAllowedHosts
array[string]
否
Hostnames (or "*.example.com" wildcards) of the tools the visitor Keycloak token may be sent to
enableAnalysis
boolean
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
部分更新對話平台
PATCH /api/v1/inboxes/{id}/
參數
id
✅
string
A UUID string identifying this Inbox.
請求內容
請求參數
groups
array[IdName]
否
可存取此收件匣的群組列表
channelType
string (enum: line, telegram, teams, web, messenger, instagram, email, whatsapp, slack, team_plus, line_works, viber)
否
line: LINE ; telegram: Telegram ; teams: Teams ; web: Web ; messenger: Messenger ; instagram: Instagram ; email: Email ; whatsapp: WhatsApp ; slack: Slack ; team_plus: Team+ ; `lin...
name
string
否
autoReplySchedules
array[AutoReplySchedule]
否
channel
object
否
organization
string (uuid)
否
signAuth
object (含 9 個屬性: id, signSource, signParams...)
否
signAuth.signSource
string (uuid)
是
signAuth.signParams
object
是
signAuth.signParams.keycloak
object (含 3 個屬性: clientId, url, realm)
是
signAuth.signParams.keycloak.clientId
string
是
signAuth.signParams.keycloak.url
string
是
signAuth.signParams.keycloak.realm
string
是
signAuth.signParams.line
object (含 1 個屬性: liffId)
是
signAuth.signParams.line.liffId
string
是
signAuth.signParams.ad
object (含 1 個屬性: saml)
是
signAuth.signParams.ad.saml
string
是
signAuth.signParams.google
object (含 1 個屬性: enabled)
否
signAuth.signParams.google.enabled
boolean
是
signAuth.sourceIdAccessEnabled
boolean
否
When enabled, embedded visitors presenting a Source ID (verified per the verify mode below) may chat without going through the login flow. Disabled keeps every existing behavior unchanged.
signAuth.sourceIdVerifyMode
object
否
"Require signature verification": the embedding site must send an HMAC signature computed on its backend. "Source ID only": anyone knowing a Source ID can act as that contact; suitable only for testin...
signAuth.sourceIdSignatureTtlMinutes
object
否
How long a signature can be used to obtain the contact identity. Not a session lifetime: once exchanged, the session follows the existing WebChat mechanism. 1: 1 ; 5: 5 ; 15: 15;
signAuth.keycloakTokenPassthrough
boolean
否
When enabled, the Keycloak access token a visitor logged in with is forwarded as the Authorization header when the AI calls MCP and API tools on their behalf, so tools do not require a separate per-to...
signAuth.keycloakTokenPassthroughAllowedHosts
array[string]
否
Hostnames (or "*.example.com" wildcards) of the tools the visitor Keycloak token may be sent to
enableTimeAwareResponse
boolean
否
Enable time aware responses for this inbox
defaultTimezone
string
否
Default timezone for this inbox (e.g., Asia/Taipei, America/New_York)
enableSenderNameAwareResponse
boolean
否
Enable sender name aware responses for this inbox
enableGpsAwareResponse
boolean
否
Enable GPS aware responses for this inbox
enableOcr
boolean
否
Enable OCR parser, prioritize OCR-enabled parsers when uploading attachments
enableAgentAttachmentDecision
boolean
否
Kill switch for AGENT-mode attachment handling. When False (default), AGENT-mode chatbots skip auto-embedding on upload and let the agent handle attachments at runtime via ParseAttachmentContentTool /...
enableStreamMessage
boolean
否
enableHumanHandoff
boolean
否
handoffPrompt
string
否
handoffLlm
string (uuid)
否
handoffContextMessageLimit
integer
否
handoffMessage
string
否
queuingMessage
string
否
assignedMessage
string
否
enablePendingReplyMessage
boolean
否
Send a placeholder message to the user while the AI is processing.
pendingReplyMessage
string
否
pendingReplyInitialDelaySeconds
integer
否
Delay before sending the first pending reply, so a fast AI response can pre-empt it.
pendingReplyIntervalSeconds
integer
否
Interval to repeat the pending reply while the AI is still processing.
enablePendingReplyCleanup
boolean
否
Delete pending reply messages after the AI reply is sent. Only effective on platforms that support message deletion (Teams, Telegram, Slack).
enableAnalysis
boolean
否
analysisLlm
string (uuid)
否
analysisPrompt
string
否
analysisContextMessageLimit
integer
否
enableServiceHours
boolean
否
serviceHoursTimezone
string
否
offlineBehavior
string (enum: show_message, leave_message)
否
show_message: Show Message ; leave_message: Leave Message;
offlineMessage
string
否
serviceHoursSchedules
array[ServiceHoursSchedule]
否
dispatchMode
object
否
Auto dispatch assigns transferred conversations to an agent automatically. Claim (handover) leaves them unassigned for online agents to pick up themselves; timeout reassignment does not apply and the ...
assignmentRoutingModel
string (enum: round_robin, least_active)
否
round_robin: Round Robin ; least_active: Least Active;
assignmentMaxConcurrent
integer
否
assignmentQueueTimeout
integer
否
Queue timeout in seconds
queueTimeoutMessage
string
否
maxQueueSize
integer
否
queueFullMessage
string
否
assignmentTargetMembers
array[string]
否
enableTagRouting
boolean
否
enableReassignOnTimeout
boolean
否
When on, a queued or assigned-but-unanswered conversation that times out is reassigned to the next available agent (skipping already-tried agents) instead of returning straight to the AI; it only retu...
enableQueueReminder
boolean
否
Reply with a throttled waiting reminder when the contact sends messages while queued.
queueReminderMessage
string
否
queueReminderCooldown
integer
否
Minimum seconds between queue reminders in one conversation
enableQueueCancel
boolean
否
Allow the contact to cancel a queued handoff and return to the AI by themselves.
queueCancelButtonText
string
否
Label of the cancel quick-reply button. Its text also counts as a cancel keyword, so tapping the button always cancels even when the keyword list changes.
queueCancelKeywords
object
否
Messages matching one of these exactly (after stripping surrounding whitespace) cancel the queued handoff. Empty means no keyword matching (the cancel button text still matches); the serializer requir...
queueCancelMessage
string
否
Sent to the contact right after they cancel the queued handoff.
copilotEnabled
boolean
否
copilotTriggerMode
string (enum: manual, every_incoming)
否
manual: Manual ; every_incoming: Every Incoming;
quotaExceededMessage
string
否
Custom message sent to the visitor when the inbox credit quota is exhausted. Used as the fallback when quota_exceeded_message_by_locale has no match for the conversation locale. Empty means the syst...
quotaExceededMessageByLocale
object
否
Locale-keyed quota-exceeded messages. A dict mapping normalized locale codes from CHAT_LANGUAGES (e.g. "en", "zh-hant", "ja") to a message string. Selected by the conversation locale; falls back to `q...
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除對話平台
DELETE /api/v1/inboxes/{id}/
參數
id
✅
string
A UUID string identifying this Inbox.
程式碼範例
回應內容
204
No response body
列出對話平台的 Webhook
GET /api/v1/inboxes/{inboxPk}/webhooks/
參數
inboxPk
✅
string
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
建立 Webhook
POST /api/v1/inboxes/{inboxPk}/webhooks/
參數
inboxPk
✅
string
請求內容
請求參數
name
string
是
Webhook configuration name for identification
direction
object
是
When to trigger: incoming (user messages) or outgoing (bot replies) incoming: Incoming ; outgoing: Outgoing ; receive: Receive;
isEnabled
boolean
否
url
string (uri)
否
method
object
否
headers
object
否
Custom HTTP headers as JSON object
templatePreset
string (enum: maiagent_standard, genesys_cloud, custom)
否
maiagent_standard: MaiAgent Standard ; genesys_cloud: Genesys Cloud ; custom: Custom;
customTemplate
string
否
Jinja2 template for custom payload format. Required when template_preset is "custom".
secretToken
string
否
Secret token for webhook signature verification
payloadPreset
object
否
Preset for parsing incoming webhook payloads (used with direction=receive) genesys_cloud: Genesys Cloud;
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
取得特定 Webhook
GET /api/v1/inboxes/{inboxPk}/webhooks/{id}/
參數
id
✅
string
A UUID string identifying this Inbox Webhook.
inboxPk
✅
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新 Webhook
PUT /api/v1/inboxes/{inboxPk}/webhooks/{id}/
參數
id
✅
string
A UUID string identifying this Inbox Webhook.
inboxPk
✅
string
請求內容
請求參數
name
string
是
Webhook configuration name for identification
direction
object
是
When to trigger: incoming (user messages) or outgoing (bot replies) incoming: Incoming ; outgoing: Outgoing ; receive: Receive;
isEnabled
boolean
否
url
string (uri)
否
method
object
否
headers
object
否
Custom HTTP headers as JSON object
templatePreset
string (enum: maiagent_standard, genesys_cloud, custom)
否
maiagent_standard: MaiAgent Standard ; genesys_cloud: Genesys Cloud ; custom: Custom;
customTemplate
string
否
Jinja2 template for custom payload format. Required when template_preset is "custom".
secretToken
string
否
Secret token for webhook signature verification
payloadPreset
object
否
Preset for parsing incoming webhook payloads (used with direction=receive) genesys_cloud: Genesys Cloud;
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
部分更新 Webhook
PATCH /api/v1/inboxes/{inboxPk}/webhooks/{id}/
參數
id
✅
string
A UUID string identifying this Inbox Webhook.
inboxPk
✅
string
請求內容
請求參數
name
string
否
Webhook configuration name for identification
direction
object
否
When to trigger: incoming (user messages) or outgoing (bot replies) incoming: Incoming ; outgoing: Outgoing ; receive: Receive;
isEnabled
boolean
否
url
string (uri)
否
method
object
否
headers
object
否
Custom HTTP headers as JSON object
templatePreset
string (enum: maiagent_standard, genesys_cloud, custom)
否
maiagent_standard: MaiAgent Standard ; genesys_cloud: Genesys Cloud ; custom: Custom;
customTemplate
string
否
Jinja2 template for custom payload format. Required when template_preset is "custom".
secretToken
string
否
Secret token for webhook signature verification
payloadPreset
object
否
Preset for parsing incoming webhook payloads (used with direction=receive) genesys_cloud: Genesys Cloud;
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除 Webhook
DELETE /api/v1/inboxes/{inboxPk}/webhooks/{id}/
參數
id
✅
string
A UUID string identifying this Inbox Webhook.
inboxPk
✅
string
程式碼範例
回應內容
204
No response body
最後更新於
這有幫助嗎?