API 参考
运行时POST

刷新运行时状态

同步账号最新的渠道运行时状态。runtime_status 的取值统一为 unknown、starting、running、stopping、stopped、reconnecting、disconnected、error 之一;provider 私有的取值会先被规范化到这一集再返回。

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

请求头

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/refresh \
  -H "X-Api-Key: <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{}'

响应

{
  "data": {
    "account_id": "acc_example",
    "runtime_status": "running"
  }
}