> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新自动化

> 更新自动化。

默认情况下，现有对象按成员进行合并（RFC 7396）：省略的成员保留其存储值，显式指定为 null 的成员将被清除。列表成员关系会被完全替换；当某个类型在两侧都恰好出现一次时，发送的每个元素都会与存储的同类型元素合并。

<div id="permissions">
  ## 权限
</div>

需要具有组织级别 `ManageOrgAutomations` 权限的服务用户。

<div id="merge-semantics">
  ## 合并语义
</div>

在默认的 `merge_patch` 语义下，PATCH 字段按成员进行合并 (采用 RFC 7396 风格) ：省略的成员保留其已存储的值，显式指定的 null 会清除值，空组不执行任何操作。元数据按键合并，null 值会删除相应的键。列表会被整体替换；当某个类型在双方都恰好出现一次时，每个发送的元素会与已存储的同类型元素合并。

在 `replace_groups` 语义下，不进行任何合并：发送的对象组会整体替换已存储的组，发送的 `triggers` 或 `actions` 列表会整体替换已存储的列表，不会逐元素合并。请重新发送所有希望保留的成员——省略的成员会被清除或重置为默认值。`metadata` 也会被完整替换，因此要移除某个键，就需要重新发送不包含该键的集合；null 元数据值会被拒绝并返回 400，而不会删除键。省略的顶级字段仍保持不变。

在依赖任一行为之前，请检查[事件架构端点](/zh/api-reference/v3/automations/get-organizations-automations-schemas)的 `update_semantics` 字段，确认你的组织当前生效的语义。请将其视为开放枚举，并能够处理上述两种以外的值。

<div id="webhook-triggers">
  ## Webhook 触发器
</div>

重新添加 `webhook:incoming` 触发器会生成新的密钥，并在更新响应中返回。密钥仅会在此时显示，请务必在收到后保存。替换或保留现有的 Webhook 触发器会保留原有密钥。


## OpenAPI

````yaml zh/v3-openapi.yaml PATCH /v3/organizations/{org_id}/automations/{automation_id}
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/automations/{automation_id}:
    patch:
      tags:
        - automations
      summary: 更新自动化
      description: >-
        更新自动化。


        默认情况下，现有对象按成员进行合并（RFC 7396）：省略的成员保留其存储值，显式指定为 null
        的成员将被清除。列表成员关系会被完全替换；当某个类型在两侧都恰好出现一次时，发送的每个元素都会与存储的同类型元素合并。
      operationId: >-
        handle_update_automation_v3_organizations__org_id__automations__automation_id__patch
      parameters:
        - in: path
          name: automation_id
          required: true
          schema:
            title: Automation Id
            type: string
        - description: 组织 ID（前缀：org-）
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomationUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationResponse'
          description: 成功响应
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未授权
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 禁止访问
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未找到
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 冲突
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 无法处理的内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 请求过多
components:
  schemas:
    AutomationUpdateRequest:
      additionalProperties: false
      description: |-
        PATCH 字段默认按成员合并：省略的成员会保留，
        显式 null 会清除，空组不执行任何操作。元数据按键合并，
        值为 null 时删除相应的键。列表会整体替换（删除 = 重新发送
        不含该元素的列表）；当某类型在双方均恰好出现一次时，
        每个已发送元素会与同类型的
        已存储元素合并。创建时必填的元素成员（``prompt``、
        ``setup_prompt``、监控/分流 Slack 配置、``scan_id``）在存在对应项时
        可省略 — 它们会像其他成员一样沿用；
        显式 null 会被拒绝。
      properties:
        actions:
          anyOf:
            - items:
                discriminator:
                  mapping:
                    message_session:
                      $ref: >-
                        #/components/schemas/AutomationMessageSessionActionUpdate
                    monitor_session:
                      $ref: >-
                        #/components/schemas/AutomationMonitorSessionActionUpdate
                    start_session:
                      $ref: '#/components/schemas/AutomationStartSessionActionUpdate'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/AutomationStartSessionActionUpdate'
                  - $ref: '#/components/schemas/AutomationMessageSessionActionUpdate'
                  - $ref: '#/components/schemas/AutomationMonitorSessionActionUpdate'
              type: array
            - type: 'null'
          title: Actions
        concurrency:
          anyOf:
            - $ref: '#/components/schemas/AutomationConcurrency'
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        limits:
          anyOf:
            - $ref: '#/components/schemas/AutomationLimits'
            - type: 'null'
        metadata:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Metadata
        name:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          title: Name
        notifications:
          anyOf:
            - $ref: '#/components/schemas/AutomationNotifications'
            - type: 'null'
        run_as:
          anyOf:
            - description: >-
                启动的会话运行时使用的身份。organization：组织的自动化身份（应用中的系统用户）—
                会话使用系统权限，因此无法选择通过个人（用户作用域）连接安装的 MCP 服务器；将自动化切换为 organization
                会将这些服务器从其选择中移除。creator：个人自动化 —
                使用创建者自身的权限运行，且仅对创建者和组织管理员可见；不允许由服务用户创建的自动化使用此选项。创建时必填；更新时设为 null
                会重置为 organization。
              discriminator:
                mapping:
                  creator:
                    $ref: '#/components/schemas/AutomationRunAsCreator'
                  organization:
                    $ref: '#/components/schemas/AutomationRunAsOrganization'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/AutomationRunAsOrganization'
                - $ref: '#/components/schemas/AutomationRunAsCreator'
            - type: 'null'
          description: null 会重置为 organization。
          title: Run As
        security_profile:
          anyOf:
            - $ref: '#/components/schemas/AutomationSecurityProfileSelection'
            - type: 'null'
          description: >-
            自动化自身的安全 Profile 绑定：profile_id 会固定使用该 Profile，{"profile_id": null}
            会记录明确不使用 Profile，而显式 null 会恢复为从组织/Enterprise 继承。需要安全 Profile 管理权限。
        session_settings:
          anyOf:
            - $ref: '#/components/schemas/AutomationSessionSettings-Input'
            - type: 'null'
        tools:
          anyOf:
            - $ref: '#/components/schemas/AutomationTools'
            - type: 'null'
        triggers:
          anyOf:
            - items:
                $ref: '#/components/schemas/AutomationTriggerRequest-Input'
              type: array
            - type: 'null'
          title: Triggers
      title: AutomationUpdateRequest
      type: object
    AutomationResponse:
      additionalProperties: false
      properties:
        actions:
          items:
            discriminator:
              mapping:
                message_session:
                  $ref: '#/components/schemas/AutomationMessageSessionAction'
                monitor_session:
                  $ref: '#/components/schemas/AutomationMonitorSessionAction'
                start_session:
                  $ref: '#/components/schemas/AutomationStartSessionAction-Output'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/AutomationStartSessionAction-Output'
              - $ref: '#/components/schemas/AutomationMessageSessionAction'
              - $ref: '#/components/schemas/AutomationMonitorSessionAction'
          title: Actions
          type: array
        automation_id:
          title: Automation Id
          type: string
        concurrency:
          anyOf:
            - $ref: '#/components/schemas/AutomationConcurrency'
            - type: 'null'
        created_at:
          title: Created At
          type: integer
        created_by:
          $ref: '#/components/schemas/ActorResponse'
        enabled:
          title: Enabled
          type: boolean
        last_edited_by:
          anyOf:
            - $ref: '#/components/schemas/ActorResponse'
            - type: 'null'
        last_invocation:
          anyOf:
            - $ref: '#/components/schemas/AutomationLastInvocation'
            - type: 'null'
        limits:
          anyOf:
            - $ref: '#/components/schemas/AutomationLimits'
            - type: 'null'
        metadata:
          additionalProperties:
            type: string
          default: {}
          title: Metadata
          type: object
        name:
          title: Name
          type: string
        notifications:
          anyOf:
            - $ref: '#/components/schemas/AutomationNotifications'
            - type: 'null'
        run_as:
          description: >-
            启动的会话使用的身份。organization：组织的自动化身份（应用中的系统用户）—
            会话使用系统权限，因此无法选择通过个人（用户作用域）连接安装的 MCP 服务器；将自动化切换为 organization
            会将这些服务器从可选项中移除。creator：个人自动化 —
            使用创建者自身的权限运行，且仅创建者和组织管理员可见；由服务用户创建的自动化不允许使用此值。创建时必填；更新时设为 null 将重置为
            organization。
          discriminator:
            mapping:
              creator:
                $ref: '#/components/schemas/AutomationRunAsCreator'
              organization:
                $ref: '#/components/schemas/AutomationRunAsOrganization'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/AutomationRunAsOrganization'
            - $ref: '#/components/schemas/AutomationRunAsCreator'
          title: Run As
        security_profile:
          anyOf:
            - $ref: '#/components/schemas/AutomationSecurityProfileResponse'
            - type: 'null'
          description: 自动化的安全 Profile 绑定及解析后适用的 Profile。组织未启用安全 Profile 时为 null。
        session_settings:
          anyOf:
            - $ref: '#/components/schemas/AutomationSessionSettings-Output'
            - type: 'null'
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Id
        tools:
          anyOf:
            - $ref: '#/components/schemas/AutomationTools'
            - type: 'null'
        triggers:
          items:
            $ref: '#/components/schemas/AutomationTriggerResponse'
          title: Triggers
          type: array
        updated_at:
          title: Updated At
          type: integer
      required:
        - automation_id
        - name
        - enabled
        - triggers
        - actions
        - created_by
        - created_at
        - updated_at
      title: AutomationResponse
      type: object
    ProblemDetail:
      description: >-
        v3 API 的 RFC 9457 application/problem+json 错误响应体。


        detail 沿用自旧版 {"detail": ...} 响应体，以保持向后兼容；其他成员字段为新增字段。errors
        包含字段级验证失败信息（仅 422）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: 针对此次具体情况的、便于人理解的说明。
          title: Detail
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: 字段级验证错误（仅适用于 422 响应）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: 此次出现对应的 URI 引用（请求路径）。
          title: Instance
        status:
          description: HTTP 状态码。
          title: Status
          type: integer
        title:
          description: 对问题类型的简短、便于理解的概述。
          title: Title
          type: string
        type:
          default: about:blank
          description: 用于标识问题类型的 URI 引用。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    AutomationMessageSessionActionUpdate:
      additionalProperties: false
      properties:
        auto_create:
          default: false
          description: 为 true 时，首次触发会创建一个归自动化所有的新长期运行会话，后续触发会向该会话发送消息。
          title: Auto Create
          type: boolean
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            触发事件的 payload 会自动追加。创建或添加此 action 时必填；在合并语义更新中，省略此项可保留已存储的值（null
            无效）。
          title: Prompt
        target_devin_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            必须属于该组织；编辑包含此 action 的自动化时，需要拥有目标会话的写入权限（仅启用/禁用的编辑除外）。除非 auto_create
            为 true，否则此项必填；如果为 true，首次触发创建会话后将由服务器端设置，客户端提供的值会被忽略。
          title: Target Devin Id
        type:
          const: message_session
          default: message_session
          title: Type
          type: string
      title: AutomationMessageSessionActionUpdate
      type: object
    AutomationMonitorSessionActionUpdate:
      additionalProperties: false
      properties:
        setup_prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            注入到会话的系统提示中。引用令牌语法与 prompt 相同。创建或添加此 action
            时必填；在合并语义更新中，省略此项可保留已存储的值（null 无效）。
          title: Setup Prompt
        slack_monitor_config:
          anyOf:
            - $ref: '#/components/schemas/AutomationSlackMonitorConfig'
            - type: 'null'
          description: >-
            同一频道必须恰有一个 slack:message 触发器。创建或添加此 action
            时必填；在合并语义更新中，省略此项可保留已存储的值（null 无效）。
        type:
          const: monitor_session
          default: monitor_session
          title: Type
          type: string
      title: AutomationMonitorSessionActionUpdate
      type: object
    AutomationStartSessionActionUpdate:
      additionalProperties: false
      properties:
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            唯一可信来源：包含内联引用令牌的纯文本（@{owner}/{repo}、@{path}、@playbook:{id}、@skills:{name}、!{macro}、${SECRET_NAME}）。保存时会验证带类型前缀的令牌；未知
            ID 将返回 400。触发事件的 payload 会自动附加。创建或添加此 action
            时必填；在合并语义更新中，省略此字段会保留已存储的值（null 无效）。
          title: Prompt
        session:
          $ref: '#/components/schemas/AutomationSessionConfig-Input'
          description: 生成的会话的配置。
        type:
          const: start_session
          default: start_session
          title: Type
          type: string
      title: AutomationStartSessionActionUpdate
      type: object
    AutomationConcurrency:
      additionalProperties: false
      properties:
        max_concurrent_runs:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: >-
            此自动化允许的最大并发运行数；后续触发的事件会在其队列中等待。会话完成并等待进一步指示后，该运行即不再计入限制，而非仅在会话停止时。null
            = 不限。
          title: Max Concurrent Runs
        max_queue_depth:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          description: 自动化队列中等待运行的最大触发事件数；超出此数量的事件将被丢弃。需要设置 max_concurrent_runs。null = 不限。
          title: Max Queue Depth
      title: AutomationConcurrency
      type: object
    AutomationLimits:
      additionalProperties: false
      properties:
        invocations:
          anyOf:
            - $ref: '#/components/schemas/AutomationInvocationLimits'
            - type: 'null'
          description: 限制自动化自身的触发频率。
        max_acu_limit:
          anyOf:
            - maximum: 1000
              minimum: 1
              type: integer
            - type: 'null'
          description: 每个启动的会话（名称与 sessions API 相同）。
          title: Max Acu Limit
      title: AutomationLimits
      type: object
    AutomationNotifications:
      additionalProperties: false
      properties:
        email:
          anyOf:
            - $ref: '#/components/schemas/AutomationEmailNotification'
            - type: 'null'
        slack:
          anyOf:
            - $ref: '#/components/schemas/AutomationSlackNotification'
            - type: 'null'
      title: AutomationNotifications
      type: object
    AutomationRunAsCreator:
      additionalProperties: false
      properties:
        type:
          const: creator
          default: creator
          title: Type
          type: string
      title: AutomationRunAsCreator
      type: object
    AutomationRunAsOrganization:
      additionalProperties: false
      properties:
        type:
          const: organization
          default: organization
          title: Type
          type: string
      title: AutomationRunAsOrganization
      type: object
    AutomationSecurityProfileSelection:
      additionalProperties: false
      description: 自动化自身的安全 Profile 绑定。
      properties:
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            要绑定到此自动化的安全 Profile。null 表示显式选择退出（不使用
            Profile，即使组织或企业设置了推荐默认值）。写入此字段需要安全 Profile 管理权限；选择退出无法规避强制性的组织/企业
            Profile。
          title: Profile Id
      title: AutomationSecurityProfileSelection
      type: object
    AutomationSessionSettings-Input:
      additionalProperties: false
      description: |-
        应用于此自动化生成的每个会话（包括监控
        会话）。
      properties:
        devin_mode:
          anyOf:
            - enum:
                - normal
                - fast
                - lite
                - ultra
                - fusion
              type: string
            - type: 'null'
          description: null = 组织默认值。
          title: Devin Mode
        net_policy:
          anyOf:
            - $ref: '#/components/schemas/AutomationNetPolicy'
            - type: 'null'
      title: AutomationSessionSettings
      type: object
    AutomationTools:
      additionalProperties: false
      properties:
        linear_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 授予 Linear 工具访问权限。
          title: Linear Enabled
        mcp_servers:
          default: []
          description: >-
            为启动的会话启用的 Marketplace slug（mcp-servers 资源的 slug 字段，例如
            'github'、'notion'）。通过个人（用户作用域）连接安装的服务器要求 run_as 为 creator；如果在 run_as
            为 organization 时选择这些服务器，请求会被拒绝，因为 Automations 服务身份没有相应的个人令牌；将自动化的
            run_as 切换为 organization 会将其从已存储的选择中移除。
          items:
            type: string
          title: Mcp Servers
          type: array
        slack_channels:
          default: []
          description: 该会话的 Slack 工具可向其发布消息的频道。
          items:
            $ref: '#/components/schemas/AutomationSlackChannel'
          title: Slack Channels
          type: array
        slack_dm_scope:
          anyOf:
            - enum:
                - org_members
                - workspace
              type: string
            - type: 'null'
          description: >-
            允许启动的会话在组织已连接的工作区中发起一对一 Slack 私信。'org_members'（仅限 Enterprise
            账户）将私信对象限制为组织成员；'workspace'（仅限非 Enterprise
            账户）允许向任何符合条件的工作区成员发送私信。省略或设为 null 可禁用私信。
          title: Slack Dm Scope
      title: AutomationTools
      type: object
    AutomationTriggerRequest-Input:
      additionalProperties: false
      properties:
        conditions:
          anyOf:
            - $ref: '#/components/schemas/AutomationConditions-Input'
            - type: 'null'
          description: null 匹配所有事件。
        event_type:
          description: 触发事件类型，例如 'github:pull_request'。
          enum:
            - github:issue_comment
            - github:issues
            - github:pull_request
            - github:pull_request_review
            - github:pull_request_review_comment
            - github:check_run
            - github:push
            - gitlab:merge_request
            - gitlab:note
            - gitlab:issue
            - gitlab:issue_note
            - gitlab:push
            - gitlab:pipeline
            - schedule:recurring
            - slack:message
            - slack:reaction_added
            - linear:create
            - linear:label_added
            - linear:assigned
            - linear:status_changed
            - linear:priority_changed
            - linear:moved
            - jira:issue_created
            - jira:label_added
            - jira:status_changed
            - jira:assigned
            - pylon:issue_created
            - pylon:issue_tag_added
            - pylon:issue_status_changed
            - incident_io:incident_created
            - incident_io:status_changed
            - incident_io:severity_changed
            - incident_io:follow_up_created
            - webhook:incoming
            - snapshot_build:completed
          title: Event Type
          type: string
        replies:
          default: []
          description: 此触发器的会话绑定位置及响应发送位置。仅执行匹配到的触发器的回复；所有条目彼此独立，并会去重。
          items:
            $ref: '#/components/schemas/AutomationReply'
          title: Replies
          type: array
      required:
        - event_type
      title: AutomationTriggerRequest
      type: object
    AutomationMessageSessionAction:
      additionalProperties: false
      properties:
        auto_create:
          default: false
          description: 为 true 时，首次触发会创建一个归自动化所有的新长期运行会话，后续触发会向该会话发送消息。
          title: Auto Create
          type: boolean
        prompt:
          description: 触发事件的 payload 会自动追加。
          title: Prompt
          type: string
        target_devin_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            必须属于该组织；编辑包含此 action 的自动化时，需要拥有目标会话的写入权限（仅启用/禁用的编辑除外）。除非 auto_create
            为 true，否则此项必填；如果为 true，首次触发创建会话后将由服务端设置，客户端提供的值会被忽略。
          title: Target Devin Id
        type:
          const: message_session
          default: message_session
          title: Type
          type: string
      required:
        - prompt
      title: AutomationMessageSessionAction
      type: object
    AutomationMonitorSessionAction:
      additionalProperties: false
      properties:
        setup_prompt:
          description: 注入到会话的系统提示中。引用令牌语法与 prompt 相同。
          title: Setup Prompt
          type: string
        slack_monitor_config:
          $ref: '#/components/schemas/AutomationSlackMonitorConfig'
          description: 同一频道必须恰有一个 slack:message 触发器。
        type:
          const: monitor_session
          default: monitor_session
          title: Type
          type: string
      required:
        - setup_prompt
        - slack_monitor_config
      title: AutomationMonitorSessionAction
      type: object
    AutomationStartSessionAction-Output:
      additionalProperties: false
      properties:
        prompt:
          description: >-
            唯一可信来源：包含内联引用令牌的纯文本（@{owner}/{repo}、@{path}、@playbook:{id}、@skills:{name}、!{macro}、${SECRET_NAME}）。保存时会验证带类型前缀的令牌；未知
            ID 将返回 400。触发事件的 payload 会自动附加。
          title: Prompt
          type: string
        session:
          $ref: '#/components/schemas/AutomationSessionConfig-Output'
          description: 生成的会话的配置。
        type:
          const: start_session
          default: start_session
          title: Type
          type: string
      required:
        - prompt
      title: AutomationStartSessionAction
      type: object
    ActorResponse:
      description: 归因于某项操作或资源的用户或服务用户主体。
      properties:
        id:
          description: 用户 ID 或服务用户 ID。
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: 显示名称，由服务端解析；删除后为 null。
          title: Name
        type:
          description: 主体类型。
          enum:
            - user
            - service_user
          title: Type
          type: string
      required:
        - type
        - id
      title: ActorResponse
      type: object
    AutomationLastInvocation:
      additionalProperties: false
      properties:
        fired_at:
          title: Fired At
          type: integer
        status:
          description: succeeded | failed | skipped — 开放枚举，客户端必须能够处理新增值。
          title: Status
          type: string
      required:
        - fired_at
        - status
      title: AutomationLastInvocation
      type: object
    AutomationSecurityProfileResponse:
      additionalProperties: false
      properties:
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Id
        selection:
          description: >-
            自动化自身的绑定：inherit（无绑定）、none（显式选择退出）或 profile（固定
            profile_id）。会话会解析完整的企业 -> 组织 -> 自动化链：自动化的网络策略只能进一步收紧生效 Profile
            的策略，且选择退出无法规避强制性的组织/企业 Profile。
          enum:
            - inherit
            - none
            - profile
          title: Selection
          type: string
        warnings:
          default: []
          description: >-
            不会阻止操作的配置冲突，例如生效 Profile 阻止了推荐 MCP 服务器端点的主机名（生成的会话将无法连接到该服务器）。仅检查远程
            MCP 端点主机名；空列表并不保证所有 MCP 或网络目标均可正常访问。读取或写入单个自动化时会填充；列表响应中为空。
          items:
            type: string
          title: Warnings
          type: array
      required:
        - selection
      title: AutomationSecurityProfileResponse
      type: object
    AutomationSessionSettings-Output:
      additionalProperties: false
      description: |-
        应用于此自动化生成的每个会话（包括监控
        会话）。
      properties:
        devin_mode:
          anyOf:
            - enum:
                - normal
                - fast
                - lite
                - ultra
                - fusion
              type: string
            - type: 'null'
          description: null = 组织默认值。
          title: Devin Mode
        net_policy:
          anyOf:
            - $ref: '#/components/schemas/AutomationNetPolicy'
            - type: 'null'
      title: AutomationSessionSettings
      type: object
    AutomationTriggerResponse:
      additionalProperties: false
      properties:
        conditions:
          anyOf:
            - $ref: '#/components/schemas/AutomationConditions-Output'
            - type: 'null'
        event_type:
          title: Event Type
          type: string
        replies:
          default: []
          items:
            $ref: '#/components/schemas/AutomationReply'
          title: Replies
          type: array
        trigger_id:
          description: 替换 triggers 时会重新生成，因此在编辑后不保持稳定。
          title: Trigger Id
          type: string
        webhook:
          anyOf:
            - $ref: '#/components/schemas/AutomationWebhookResponse'
            - type: 'null'
          description: 仅适用于 webhook:incoming 触发器。
      required:
        - trigger_id
        - event_type
      title: AutomationTriggerResponse
      type: object
    AutomationSlackMonitorConfig:
      additionalProperties: false
      properties:
        source_channel_id:
          title: Source Channel Id
          type: string
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
      required:
        - source_channel_id
      title: AutomationSlackMonitorConfig
      type: object
    AutomationSessionConfig-Input:
      additionalProperties: false
      properties:
        bypass_approval:
          default: false
          description: 自动批准创建子会话（这是此开关唯一绕过的检查）；未来任何可绕过的检查都需要新字段。
          title: Bypass Approval
          type: boolean
        notifications:
          anyOf:
            - $ref: '#/components/schemas/AutomationSessionNotificationsConfig'
            - type: 'null'
          description: 会话内容通知（目前仅支持 Slack）。
        platform:
          anyOf:
            - type: string
            - type: 'null'
          description: 会话的 VM 平台。为 null 时，会话会在调用时使用组织的默认平台。
          title: Platform
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          description: '只读：从提示中的第一个 @playbook: 令牌派生。'
          title: Playbook Id
        repos:
          default: []
          description: 只读：从提示中的 repo 令牌派生。
          items:
            type: string
          title: Repos
          type: array
        tags:
          default: []
          description: 会话标签。对于强制执行标签的企业，必须恰好提供一个允许的值。
          items:
            type: string
          title: Tags
          type: array
      title: AutomationSessionConfig
      type: object
    AutomationInvocationLimits:
      additionalProperties: false
      properties:
        max_per_window:
          minimum: 1
          title: Max Per Window
          type: integer
        window_seconds:
          minimum: 60
          title: Window Seconds
          type: integer
      required:
        - max_per_window
        - window_seconds
      title: AutomationInvocationLimits
      type: object
    AutomationEmailNotification:
      additionalProperties: false
      properties:
        recipients:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: null = 自动化创建者；由服务用户创建的自动化必须设置此项。
          title: Recipients
        when:
          enum:
            - always
            - dispatch_failed
            - dispatch_succeeded
          title: When
          type: string
      required:
        - when
      title: AutomationEmailNotification
      type: object
    AutomationSlackNotification:
      additionalProperties: false
      properties:
        channel_id:
          title: Channel Id
          type: string
        when:
          enum:
            - always
            - dispatch_failed
            - dispatch_succeeded
          title: When
          type: string
      required:
        - when
        - channel_id
      title: AutomationSlackNotification
      type: object
    AutomationNetPolicy:
      additionalProperties: false
      properties:
        allow:
          items:
            anyOf:
              - $ref: '#/components/schemas/AutomationHostnameDestination'
              - $ref: '#/components/schemas/AutomationIpv4Destination'
              - $ref: '#/components/schemas/AutomationIpv6Destination'
          title: Allow
          type: array
      required:
        - allow
      title: AutomationNetPolicy
      type: object
    AutomationSlackChannel:
      additionalProperties: false
      properties:
        channel_id:
          title: Channel Id
          type: string
        team_id:
          title: Team Id
          type: string
      required:
        - team_id
        - channel_id
      title: AutomationSlackChannel
      type: object
    AutomationConditions-Input:
      additionalProperties: false
      properties:
        any:
          description: AND 组的 OR（固定的两层 DNF）。
          items:
            $ref: '#/components/schemas/AutomationConditionGroup'
          title: Any
          type: array
      required:
        - any
      title: AutomationConditions
      type: object
    AutomationReply:
      additionalProperties: false
      properties:
        type:
          description: >-
            notify_thread：在分派时向触发会话线程单向发送“会话已启动”标记（Slack
            触发器）。attach_thread：在分派时与触发会话线程建立双向绑定（Slack 触发器）。post_response：将
            Agent 的响应发送到触发上下文。
          enum:
            - notify_thread
            - attach_thread
            - post_response
          title: Type
          type: string
      required:
        - type
      title: AutomationReply
      type: object
    AutomationSessionConfig-Output:
      additionalProperties: false
      properties:
        bypass_approval:
          default: false
          description: 自动批准创建子会话（这是此开关唯一绕过的检查）；未来任何可绕过的检查都需要新字段。
          title: Bypass Approval
          type: boolean
        notifications:
          anyOf:
            - $ref: '#/components/schemas/AutomationSessionNotificationsConfig'
            - type: 'null'
          description: 会话内容通知（目前仅支持 Slack）。
        platform:
          anyOf:
            - type: string
            - type: 'null'
          description: 会话的 VM 平台。为 null 时，会话会在调用时使用组织的默认平台。
          title: Platform
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          description: '只读：从提示中的第一个 @playbook: 令牌派生。'
          title: Playbook Id
        repos:
          default: []
          description: 只读：从提示中的 repo 令牌派生。
          items:
            type: string
          title: Repos
          type: array
        tags:
          default: []
          description: 会话标签。对于强制执行标签的企业，必须恰好提供一个允许的值。
          items:
            type: string
          title: Tags
          type: array
      title: AutomationSessionConfig
      type: object
    AutomationConditions-Output:
      additionalProperties: false
      properties:
        any:
          description: AND 组的 OR（固定的两层 DNF）。
          items:
            $ref: '#/components/schemas/AutomationConditionGroup'
          title: Any
          type: array
      required:
        - any
      title: AutomationConditions
      type: object
    AutomationWebhookResponse:
      additionalProperties: false
      properties:
        secret:
          anyOf:
            - type: string
            - type: 'null'
          description: 仅在新生成时提供（创建或重新添加）；之后无法再次获取。替换 triggers 会保留现有 secret。
          title: Secret
        url:
          description: 供外部系统 POST 的收件箱（标头 X-Webhook-Secret）。
          title: Url
          type: string
      required:
        - url
      title: AutomationWebhookResponse
      type: object
    AutomationSessionNotificationsConfig:
      additionalProperties: false
      description: |-
        启动的会话内容的发送位置，而非自动化级别的
        ``notifications`` 组（调度状态提醒）。
      properties:
        slack:
          anyOf:
            - $ref: '#/components/schemas/AutomationSessionSlackConfig'
            - type: 'null'
          description: >-
            为会话指定 Slack 归属位置：首次投递绑定会话线程后，post_updates/forward_thread 和
            post_response 均支持双向通信。
      title: AutomationSessionNotificationsConfig
      type: object
    AutomationHostnameDestination:
      additionalProperties: false
      properties:
        hostname:
          title: Hostname
          type: string
      required:
        - hostname
      title: AutomationHostnameDestination
      type: object
    AutomationIpv4Destination:
      additionalProperties: false
      properties:
        ipv4:
          title: Ipv4
          type: string
      required:
        - ipv4
      title: AutomationIpv4Destination
      type: object
    AutomationIpv6Destination:
      additionalProperties: false
      properties:
        ipv6:
          title: Ipv6
          type: string
      required:
        - ipv6
      title: AutomationIpv6Destination
      type: object
    AutomationConditionGroup:
      additionalProperties: false
      properties:
        all:
          description: AND：组中的每个条件都必须匹配。
          items:
            discriminator:
              mapping:
                between:
                  $ref: '#/components/schemas/AutomationRangeCondition'
                contains:
                  $ref: '#/components/schemas/AutomationStringCondition'
                ends_with:
                  $ref: '#/components/schemas/AutomationStringCondition'
                eq:
                  $ref: '#/components/schemas/AutomationComparisonCondition'
                globs:
                  $ref: '#/components/schemas/AutomationGlobCondition'
                gt:
                  $ref: '#/components/schemas/AutomationNumericCondition'
                gte:
                  $ref: '#/components/schemas/AutomationNumericCondition'
                in:
                  $ref: '#/components/schemas/AutomationListCondition'
                is_empty:
                  $ref: '#/components/schemas/AutomationEmptyCondition'
                is_not_empty:
                  $ref: '#/components/schemas/AutomationEmptyCondition'
                lt:
                  $ref: '#/components/schemas/AutomationNumericCondition'
                lte:
                  $ref: '#/components/schemas/AutomationNumericCondition'
                matches:
                  $ref: '#/components/schemas/AutomationMatchCondition'
                neq:
                  $ref: '#/components/schemas/AutomationComparisonCondition'
                not_contains:
                  $ref: '#/components/schemas/AutomationStringCondition'
                not_ends_with:
                  $ref: '#/components/schemas/AutomationStringCondition'
                not_globs:
                  $ref: '#/components/schemas/AutomationGlobCondition'
                not_in:
                  $ref: '#/components/schemas/AutomationListCondition'
                not_matches:
                  $ref: '#/components/schemas/AutomationMatchCondition'
                not_starts_with:
                  $ref: '#/components/schemas/AutomationStringCondition'
                recurrence:
                  $ref: '#/components/schemas/AutomationRecurrenceCondition'
                starts_with:
                  $ref: '#/components/schemas/AutomationStringCondition'
              propertyName: operator
            oneOf:
              - $ref: '#/components/schemas/AutomationComparisonCondition'
              - $ref: '#/components/schemas/AutomationStringCondition'
              - $ref: '#/components/schemas/AutomationNumericCondition'
              - $ref: '#/components/schemas/AutomationEmptyCondition'
              - $ref: '#/components/schemas/AutomationRangeCondition'
              - $ref: '#/components/schemas/AutomationListCondition'
              - $ref: '#/components/schemas/AutomationMatchCondition'
              - $ref: '#/components/schemas/AutomationRecurrenceCondition'
              - $ref: '#/components/schemas/AutomationGlobCondition'
          title: All
          type: array
      required:
        - all
      title: AutomationConditionGroup
      type: object
    AutomationSessionSlackConfig:
      additionalProperties: false
      properties:
        channel_id:
          title: Channel Id
          type: string
        mode:
          description: >-
            post_updates：会话在频道中的会话线程内交谈（适用于非 Slack
            触发器）。forward_thread：与前者相同，另外会在触发会话线程中发布回链（需要 Slack
            触发器）。post_response：会话的最终响应将作为顶级消息发布到频道，然后绑定其会话线程以接收回复和后续消息（适用于任何触发器）。
          enum:
            - post_updates
            - forward_thread
            - post_response
          title: Mode
          type: string
      required:
        - mode
        - channel_id
      title: AutomationSessionSlackConfig
      type: object
    AutomationRangeCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          const: between
          title: Operator
          type: string
        value:
          description: 闭区间 [low, high]。
          maxItems: 2
          minItems: 2
          prefixItems:
            - anyOf:
                - type: integer
                - type: number
            - anyOf:
                - type: integer
                - type: number
          title: Value
          type: array
      required:
        - field
        - operator
        - value
      title: AutomationRangeCondition
      type: object
    AutomationStringCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - contains
            - not_contains
            - starts_with
            - not_starts_with
            - ends_with
            - not_ends_with
          title: Operator
          type: string
        value:
          title: Value
          type: string
      required:
        - field
        - operator
        - value
      title: AutomationStringCondition
      type: object
    AutomationComparisonCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - eq
            - neq
          title: Operator
          type: string
        value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
          title: Value
      required:
        - field
        - operator
        - value
      title: AutomationComparisonCondition
      type: object
    AutomationGlobCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - globs
            - not_globs
          title: Operator
          type: string
        value:
          description: Glob 模式；任意变更路径匹配即可（github:push、gitlab:push）。
          items:
            type: string
          title: Value
          type: array
      required:
        - field
        - operator
        - value
      title: AutomationGlobCondition
      type: object
    AutomationNumericCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - gt
            - lt
            - gte
            - lte
          title: Operator
          type: string
        value:
          anyOf:
            - type: integer
            - type: number
          title: Value
      required:
        - field
        - operator
        - value
      title: AutomationNumericCondition
      type: object
    AutomationListCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - in
            - not_in
          title: Operator
          type: string
        value:
          items:
            type: string
          title: Value
          type: array
      required:
        - field
        - operator
        - value
      title: AutomationListCondition
      type: object
    AutomationEmptyCondition:
      additionalProperties: false
      description: 一元运算符：根据字段是否为空进行匹配；`value` 不携带任何数据。
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - is_empty
            - is_not_empty
          title: Operator
          type: string
        value:
          title: Value
          type: 'null'
      required:
        - field
        - operator
      title: AutomationEmptyCondition
      type: object
    AutomationMatchCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          enum:
            - matches
            - not_matches
          title: Operator
          type: string
        value:
          description: 正则表达式。
          title: Value
          type: string
      required:
        - field
        - operator
        - value
      title: AutomationMatchCondition
      type: object
    AutomationRecurrenceCondition:
      additionalProperties: false
      properties:
        field:
          title: Field
          type: string
        operator:
          const: recurrence
          title: Operator
          type: string
        value:
          description: >-
            schedule:recurring 的 rrule 字段使用的 iCalendar RRULE，例如
            FREQ=WEEKLY;BYDAY=MO;BYHOUR=9;BYMINUTE=0
          title: Value
          type: string
      required:
        - field
        - operator
        - value
      title: AutomationRecurrenceCondition
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````