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

# 创建组织或 repo 层级蓝图

> 创建蓝图。``type`` 会根据 ``repo_name`` 推断。

根据规范，这绝不会自动触发构建——调用方必须显式调用
``POST /builds``。

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

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

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

创建组织层级或代码仓库层级蓝图。蓝图用于定义 Devin 会话的声明式环境配置。修改蓝图不会自动触发构建——你必须显式调用 builds 端点。


## OpenAPI

````yaml zh/v3-openapi.yaml POST /v3beta1/organizations/{org_id}/snapshot-setup/blueprints
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:
    post:
      tags:
        - snapshot_setup
      summary: 创建组织或 repo 层级蓝图
      description: |-
        创建蓝图。``type`` 会根据 ``repo_name`` 推断。

        根据规范，这绝不会自动触发构建——调用方必须显式调用
        ``POST /builds``。
      operationId: >-
        create_org_blueprint_v3beta1_organizations__org_id__snapshot_setup_blueprints_post
      parameters:
        - 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/CreateOrgBlueprintBody'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Blueprint'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    CreateOrgBlueprintBody:
      properties:
        contents:
          anyOf:
            - type: string
            - type: 'null'
          description: 蓝图的可选初始 YAML 内容。
          title: Contents
        repo_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 如果设置，则为该代码仓库创建代码仓库层级蓝图；如果省略，则创建组织范围的蓝图（组织层级）。
          title: Repo Name
      title: CreateOrgBlueprintBody
      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

````