更新消息接收连接

更新消息接收连接。

PATCH https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/ingress-connections/{connection_id}

调用前准备

准备可访问目标工作区并有相应动作权限的个人访问令牌。路径工作区与 X-Workspace-ID 一致。示例使用 jq;变量、对象与状态见公共说明。

请求体

curl -X PATCH "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/ingress-connections/$CONNECTION_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  --data-binary "$(jq -n --argjson ASSOCIATION_VERSION "$ASSOCIATION_VERSION" --argjson CONFIG_VERSION "$CONFIG_VERSION" '
{
  "expected_association_version": $ASSOCIATION_VERSION,
  "expected_config_version": $CONFIG_VERSION,
  "enabled": false
}
')"

至少提交 enabled、agent_model、managed_stream 之一。Slack 更新仅 app_token/bot_token,飞书仅 app_secret,企业微信仅 secret;不能原样重传创建对象中的 App ID/Bot ID。成功后 config_version 增加,重新读取再操作。

字段

类型

是否必填

说明

expected_association_version

integer

是

最新连接详情的 association_version,须大于 0。

expected_config_version

integer

是

最新连接详情的 config_version,须大于 0。

enabled

boolean

否

启用或停用;省略保持原值。

agent_model

string

否

仅 agent 目标可变更模型。

managed_stream

object

否

仅托管模式可更新平台允许变更的密钥。

成功响应

{
  "code": 0,
  "data": {
    "id": "ingress_example",
    "workspace_id": "workspace_example",
    "target": {
      "kind": "agent",
      "workspace_id": "workspace_example",
      "id": "agent_example"
    },
    "provider": "slack",
    "channel_type": "slack_app",
    "receive_mode": "managed_stream",
    "agent_model": "model_example",
    "association_version": 1,
    "connected_by_user_id": "user_example",
    "enabled": false,
    "account_identity": "slack:app:app_example",
    "config_version": 2,
    "desired_state": "disabled",
    "observed_state": "stopped",
    "created_at": "2026-11-11T00:00:00Z",
    "updated_at": "2026-11-11T00:00:00Z"
  }
}

字段

类型

说明

code

integer

成功时为 0。

data

object

结果对象,字段见公共对象说明。

错误响应

按 HTTP 状态、业务结果和错误字段处理,见错误与环境。来源与版本冲突时读取当前状态,不替换身份、资源或请求 ID 自动重试。

最后更新于