API 參考
執行環境POST

啟動執行環境

啟動該帳號的執行實例。這是執行環境控制,與認證無關。

https://api.unifyport.ai/v1/accounts/{account_id}/runtime/start

請求標頭

X-Api-Key
string必填

工作區 API Key,工作區會由此標頭解析得到。

Content-Type
string必填

傳送 JSON 請求內容時請使用 application/json。

路徑參數

account_id
string必填

用於該 runtime 路由的識別字。

請求內容

此介面接收空 JSON 物件;請依請求範例傳送 {}。

回應內容

account_id
string

本回應所對應的渠道帳號。

provider
string

處理此執行階段操作的渠道。

enum: telegram, whatsapp, line, twitter, zalo, tiktok, whatsapp_protocol

action
string

本次要求的執行階段操作。

enum: refresh_status, start, stop, reconnect

operation_status
string

執行階段操作已受理或完成的狀態。

runtime_status
string

標準化的執行階段狀態,為 unknown、starting、running、stopping、stopped、reconnecting、disconnected 或 error 其中之一。

enum: unknown, starting, running, stopping, stopped, reconnecting, disconnected, error

runtime_error
string

操作未完成時的渠道執行階段錯誤。

回應

200
200 OK

請求成功,回應內容範例如上。

400
請求錯誤

請求內容、路徑或參數無效。

401
未授權

X-Api-Key 請求標頭缺少或無效。

409
衝突

目前操作與既有的渠道帳號或資源衝突。

500
伺服器錯誤

服務遇到了未預期的錯誤。

502
上游閘道錯誤

渠道轉接器或上游渠道未能完成此操作。

請求

curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/runtime/start \
  -H "X-Api-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{}'

回應

{
  "data": {
    "runtime_status": "starting"
  }
}