修补 /api/v1/项目/{id}/工作区/{workspace_id}

部分更新工作区。项目范围由路由 ID 路径参数承载。仅字段修补返回 204;仅状态修补(暂停/恢复)与其他字段互斥,并返回带有 ECP 的应用主体(包括任何 warnings)的 200。

路径参数

  • id 字符串 必需

    项目 ID

  • workspace_id 字符串 必需

    工作区 ID

application/json

body 必需

字段更新

  • 代理卡 对象
    隐藏 agent_card 属性 显示 agent_card 属性 对象
    • a2a_允许的调用者 array[string]

      A2AAllowedCallers 限制哪些工作区 ID 可以通过 A2A 调用此代理。空列表意味着允许任何调用者。

    • a2a_已启用 布尔

      A2AEnabled 控制此代理是否可被发现以响应 A2A 调用。

    • 功能 array[string]
    • input_modes array[string]

      InputModes 列出代理接受的 MIME 类型(例如:"text/plain", "应用程序/JSON")。

    • output_modes array[string]

      OutputModes 列出代理可以输出的 MIME 类型。

    • 技能 大量[对象]

      技能列出了代理可以执行的独立任务。

      隐藏技能属性 显示技能属性 对象
      • 描述 字符串
      • example_input 字符串
      • example_output 字符串
      • 名称 字符串
    • 总结 字符串
  • auto_deploy 布尔

    AutoDeploy 是一个应用级 ECP 字段(不会持久存储在网关数据库中);原样转发到 ECP 的应用 PATCH。

  • 描述 字符串
  • 功能 对象
    隐藏功能属性 显示功能属性 对象
    • 护栏 布尔
    • 内存 布尔
    • Playground 布尔

      Playground 报告 Playground 用户界面是否已为工作区预配(空/真 = 已预配,当前行为)。当为 false 时,调用者直接使用 invoke API。

    • use_custom_parser 布尔

      UseCustomParser 在为 true 时,使 Gateway 只在调用流上发出代理的 output-parser 自定义事件(放弃平台帧)。在 agentengine 初始化时,从 agent.yaml 功能中加载并持久化。

  • 框架 字符串
  • gitops 对象
    隐藏 gitops 属性 显示 gitops 属性 对象
    • 分支 字符串
    • connection_ref 字符串
    • manifest_path 字符串
    • provider 字符串
    • repo_url 字符串
  • 名称 字符串
  • release_mode 字符串

    ReleaseMode 是一个应用级别的 ECP 字段(未保留在网关数据库中);原样转发到 ECP 的应用 PATCH。仅控制 webhook 触发的构建,API 触发的发布在所有模式下均可用。

  • 状态 字符串

    状态是暂停/恢复信号(“活动” | “暂停”)。网关不会在本地持久存储它;处理程序会将仅包含状态的补丁直接转发到 ECP,它会运行暂停拆除 / 恢复重新部署。

  • 子目录 字符串
  • workspace_name 字符串

响应

  • 不支持或格式错误的 API 版本、所选已发布合同中不可用的操作,或不可接受的表示形式(包括不支持的媒体类型参数或排除的 SSE)。现有的身份验证、授权和速率限制失败具有优先权。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

    隐藏响应属性 显示响应属性 对象
    • badRequestDetail 对象

      由标准错误模式定义的可选验证详细信息;API 协商错误不会发出此字段。

      隐藏 BadRequestDetail 属性 显示 BadRequestDetail 属性 对象
      • 字段 大量[对象]

        字段验证失败。

        隐藏字段属性 显示字段属性 对象

        字段及其验证失败。

        • 描述 字符串 必需

          人类可读验证失败。

        • 字段 字符串 必需

          无效请求字段的名称或路径。

    • 详细信息 字符串 必需

      可读的错误详情。

    • 错误 整型 必需

      HTTP status code.

    • 错误代码 字符串 必需

      机器可读的错误码。

    • 参数 array[string]

      与错误相关的请求参数名称;当无相关参数时省略。

    • 原因 字符串 必需

      HTTP 状态原因语句。

  • 200

    针对仅限状态的修补程序返回;从 ECP 代理。

    隐藏响应属性 显示响应属性 对象
    • app_id 字符串
    • org_id 字符串
    • PROJECT_ID 字符串
    • 状态 字符串
    • 警告 array[string]
    隐藏响应属性 显示响应属性 对象
    • app_id 字符串
    • org_id 字符串
    • PROJECT_ID 字符串
    • 状态 字符串
    • 警告 array[string]
  • 204

    返回用于字段更新补丁。

  • Bad Request

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 未找到

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 请求实体过大

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 429

    请求过多

    隐藏头部属性 显示标头属性
    • Retry-After 字符串

      再次尝试前等待时间(秒)

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 内部服务器错误

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 502

    ECP 传输或暂停/终止失败。

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
  • 503

    服务不可用

    隐藏头部属性 显示标头属性
    • Retry-After 字符串

      再次尝试前等待时间(秒)

    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
    隐藏响应属性 显示响应属性 对象
    • 代码 字符串
    • 错误 字符串
    • Success 布尔
PATCH /api/v1/项目/{id}/工作区/{workspace_id}
curl \
 --request PATCH 'https://agentengine.mongodb.com/api/v1/projects/{id}/workspaces/{workspace_id}' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{
  "agent_card": {
    "a2a_allowed_callers": [
      "string"
    ],
    "a2a_enabled": true,
    "capabilities": [
      "string"
    ],
    "input_modes": [
      "string"
    ],
    "output_modes": [
      "string"
    ],
    "skills": [
      {
        "description": "string",
        "example_input": "string",
        "example_output": "string",
        "name": "string"
      }
    ],
    "summary": "string"
  },
  "auto_deploy": true,
  "description": "string",
  "features": {
    "guardrails": true,
    "memory": true,
    "playground": true,
    "use_custom_parser": true
  },
  "framework": "string",
  "gitops": {
    "branch": "string",
    "connection_ref": "string",
    "manifest_path": "string",
    "provider": "string",
    "repo_url": "string"
  },
  "name": "string",
  "release_mode": "string",
  "status": "string",
  "subdirectory": "string",
  "workspace_name": "string"
}'
请求示例
{
  "agent_card": {
    "a2a_allowed_callers": [
      "string"
    ],
    "a2a_enabled": true,
    "capabilities": [
      "string"
    ],
    "input_modes": [
      "string"
    ],
    "output_modes": [
      "string"
    ],
    "skills": [
      {
        "description": "string",
        "example_input": "string",
        "example_output": "string",
        "name": "string"
      }
    ],
    "summary": "string"
  },
  "auto_deploy": true,
  "description": "string",
  "features": {
    "guardrails": true,
    "memory": true,
    "playground": true,
    "use_custom_parser": true
  },
  "framework": "string",
  "gitops": {
    "branch": "string",
    "connection_ref": "string",
    "manifest_path": "string",
    "provider": "string",
    "repo_url": "string"
  },
  "name": "string",
  "release_mode": "string",
  "status": "string",
  "subdirectory": "string",
  "workspace_name": "string"
}
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
  "error": 406,
  "errorCode": "UNACCEPTABLE_MEDIA_TYPE",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
{
  "detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
  "error": 406,
  "errorCode": "UNSUPPORTED_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (406)
{
  "detail": "This operation is not available in API version 2026-09-20-preview.",
  "error": 406,
  "errorCode": "OPERATION_NOT_IN_API_VERSION",
  "parameters": [
    "Accept"
  ],
  "reason": "Not Acceptable"
}
响应示例 (200)
{
  "app_id": "string",
  "org_id": "string",
  "project_id": "string",
  "status": "active",
  "warnings": [
    "string"
  ]
}
响应示例 (200)
{
  "app_id": "string",
  "org_id": "string",
  "project_id": "string",
  "status": "active",
  "warnings": [
    "string"
  ]
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (400)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (404)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (404)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (413)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (413)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (429)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (429)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (500)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (502)
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}
响应示例 (503)
# Headers
Retry-After: string

# Payload
{
  "code": "string",
  "error": "string",
  "success": true
}