> ## 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.

# 更新蓝图的内容和/或位置

> 对单个蓝图进行部分更新。不会自动触发构建。

生效字段：

- ``contents`` — 为该蓝图写入新的 YAML 版本。
- ``position`` — 设置代码仓库层级蓝图的执行位置。
  对组织层级蓝图会返回 ``400``（这类蓝图没有 position）。

当请求体为空时，返回 ``400``。

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

要求服务用户在组织级别具备 `ManageRepoBlueprints` 权限。创建或更新组织级蓝图需要 `ManageOrgSnapshots` 权限。

<div id="behavior">
  ## 行为
</div>

更新蓝图的内容和/或位置。不会自动触发构建。


## OpenAPI

````yaml zh/v3-openapi.yaml PATCH /v3beta1/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_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:
  /v3beta1/organizations/{org_id}/snapshot-setup/blueprints/{blueprint_id}:
    patch:
      tags:
        - snapshot_setup
      summary: 更新蓝图的内容和/或位置
      description: |-
        对单个蓝图进行部分更新。不会自动触发构建。

        生效字段：

        - ``contents`` — 为该蓝图写入新的 YAML 版本。
        - ``position`` — 设置代码仓库层级蓝图的执行位置。
          对组织层级蓝图会返回 ``400``（这类蓝图没有 position）。

        当请求体为空时，返回 ``400``。
      operationId: >-
        update_org_blueprint_v3beta1_organizations__org_id__snapshot_setup_blueprints__blueprint_id__patch
      parameters:
        - in: path
          name: blueprint_id
          required: true
          schema:
            title: Blueprint 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/UpdateOrgBlueprintBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Blueprint'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    UpdateOrgBlueprintBody:
      description: |-
        对组织层级或代码仓库层级的蓝图进行部分更新。

        可提供任意字段子集。未设置的字段将保持不变。
        如果为组织层级蓝图提供 ``position``，则会返回 ``400`` —— 只有代码仓库层级蓝图才有 position。不会触发构建。
      properties:
        contents:
          anyOf:
            - type: string
            - type: 'null'
          description: 如果设置，则会用新版本替换该蓝图的 YAML 内容。
          title: Contents
        position:
          anyOf:
            - type: integer
            - type: 'null'
          description: 如果设置，则更新此代码仓库层级蓝图的执行位置。位置不要求唯一；执行排序时如出现并列，服务器会任意决定先后顺序。
          title: Position
      title: UpdateOrgBlueprintBody
      type: object
    Blueprint:
      description: |-
        公开的 ``Blueprint`` 资源结构。

        注意：``type`` 枚举未来可能会扩展；客户端 MUST 以优雅方式
        处理未知值。YAML 内容需通过
        ``GET /blueprints/{id}/contents`` 单独获取。
      properties:
        blueprint_id:
          title: Blueprint Id
          type: string
        created_at:
          title: Created At
          type: integer
        repo_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Name
        type:
          enum:
            - enterprise
            - org
            - repo
          title: Type
          type: string
        updated_at:
          title: Updated At
          type: integer
      required:
        - blueprint_id
        - type
        - repo_name
        - created_at
        - updated_at
      title: Blueprint
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````