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

# 将代码仓库克隆到组织中

> 将代码仓库克隆到组织的快照中

需要 Enterprise 管理员的个人 API key。

在组织中克隆一个 Git 代码仓库，并生成一个新的快照版本。


## OpenAPI

````yaml zh/v2-openapi.yaml POST /v2/enterprise/organizations/{org_id}/clone
openapi: 3.1.0
info:
  description: 供企业管理员使用的 Devin v2 API（个人 API key）
  title: Devin API v2
  version: 2.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v2/enterprise/organizations/{org_id}/clone:
    post:
      tags:
        - organizations
      summary: 克隆仓库
      operationId: clone_repo_v2_enterprise_organizations__org_id__clone_post
      parameters:
        - in: path
          name: org_id
          required: true
          schema:
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloneRepoRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRepoSnapshotResponse'
          description: 成功的响应
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 校验错误
components:
  schemas:
    CloneRepoRequest:
      properties:
        pull_repo_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 用于拉取仓库的命令。建议留空，交由系统自动生成。
          title: Pull Repo Commands
        repo_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Note
        repo_path:
          description: 按“owner/repo_name”格式输入仓库路径（例如：“acme/my-project”）
          examples:
            - owner/repo_name
          title: Repo Path
          type: string
        run_lint_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Run Lint Commands
        run_project_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Run Project Commands
        run_tests_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Run Tests Commands
        update_dependencies_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Update Dependencies Commands
      required:
        - repo_path
      title: CloneRepoRequest
      type: object
    CreateRepoSnapshotResponse:
      description: 创建快照的响应。
      properties:
        ami_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 快照的 AMI ID（如果仍在创建中，可能为 null）
          title: Ami Id
        created_at:
          description: 快照创建时间戳
          format: date-time
          title: Created At
          type: string
        org_id:
          description: 快照所属组织的 ID
          title: Org Id
          type: string
        snapshot_id:
          description: 已创建的快照 ID
          title: Snapshot Id
          type: string
        status:
          description: 快照状态（例如：pending、available）
          title: Status
          type: string
      required:
        - snapshot_id
        - status
        - org_id
        - created_at
      title: CreateRepoSnapshotResponse
      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: 仅供 Enterprise 管理员使用的个人 API Key（apk_user_*）
      scheme: bearer
      type: http

````