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

# Clone a Repository into an Organization

> Clone a repository into an organization' snapshot

Requires an enterprise admin personal API key.

Clones a git repository in an organization and updates into a new snapshot version.


## OpenAPI

````yaml /v2-openapi.yaml POST /v2/enterprise/organizations/{org_id}/clone
openapi: 3.1.0
info:
  description: Devin v2 API with Personal API Keys for Enterprise Admins
  title: Devin API v2
  version: 2.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v2/enterprise/organizations/{org_id}/clone:
    post:
      tags:
        - organizations
      summary: Clone Repo
      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: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CloneRepoRequest:
      properties:
        pull_repo_commands:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Commands to pull the repository. Recommended to leave blank as it is
            auto-generated.
          title: Pull Repo Commands
        repo_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Repo Note
        repo_path:
          description: >-
            Repository path in the format 'owner/repo_name' (e.g.,
            '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: Response from creating a snapshot.
      properties:
        ami_id:
          anyOf:
            - type: string
            - type: 'null'
          description: AMI ID of the snapshot (may be null if still being created)
          title: Ami Id
        created_at:
          description: Timestamp when the snapshot was created
          format: date-time
          title: Created At
          type: string
        org_id:
          description: Organization ID the snapshot belongs to
          title: Org Id
          type: string
        snapshot_id:
          description: ID of the created snapshot
          title: Snapshot Id
          type: string
        status:
          description: Status of the snapshot (e.g., '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: Personal API Key (apk_user_*) for Enterprise Admins only
      scheme: bearer
      type: http

````