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

# 上传企业蓝图文件

> 将文件附件（用于 env-var 替换的材料）上传到蓝图。

如果派生出的 env-var 名称与另一活动文件冲突，则返回 409。

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

需要服务用户在企业级别具有 `ManageAccountSnapshots` 权限。

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

将文件上传到企业蓝图。文件可在蓝图 YAML 中引用，并在快照构建期间使用。


## OpenAPI

````yaml zh/v3-openapi.yaml POST /v3beta1/enterprise/snapshot-setup/blueprints/{blueprint_id}/files
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/enterprise/snapshot-setup/blueprints/{blueprint_id}/files:
    post:
      tags:
        - snapshot_setup
      summary: 上传企业蓝图文件
      description: |-
        将文件附件（用于 env-var 替换的材料）上传到蓝图。

        如果派生出的 env-var 名称与另一活动文件冲突，则返回 409。
      operationId: >-
        upload_enterprise_blueprint_file_endpoint_v3beta1_enterprise_snapshot_setup_blueprints__blueprint_id__files_post
      parameters:
        - in: path
          name: blueprint_id
          required: true
          schema:
            title: Blueprint Id
            type: string
        - in: query
          name: name
          required: true
          schema:
            title: Name
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_enterprise_blueprint_file_endpoint_v3beta1_enterprise_snapshot_setup_blueprints__blueprint_id__files_post
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlueprintFile'
          description: 成功响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 验证错误
components:
  schemas:
    Body_upload_enterprise_blueprint_file_endpoint_v3beta1_enterprise_snapshot_setup_blueprints__blueprint_id__files_post:
      properties:
        file:
          format: binary
          title: File
          type: string
      required:
        - file
      title: >-
        Body_upload_enterprise_blueprint_file_endpoint_v3beta1_enterprise_snapshot_setup_blueprints__blueprint_id__files_post
      type: object
    BlueprintFile:
      description: 公开的 ``BlueprintFile`` 资源结构。
      properties:
        blueprint_id:
          title: Blueprint Id
          type: string
        created_at:
          title: Created At
          type: integer
        env_var_name:
          title: Env Var Name
          type: string
        file_id:
          title: File Id
          type: string
        name:
          title: Name
          type: string
        size_bytes:
          title: Size Bytes
          type: integer
        updated_at:
          title: Updated At
          type: integer
      required:
        - file_id
        - blueprint_id
        - name
        - env_var_name
        - size_bytes
        - created_at
        - updated_at
      title: BlueprintFile
      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

````