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

# Post apiv1repositoriesfork



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/repositories/fork
openapi: 3.1.0
info:
  title: Orchestrator Control Plane API
  description: ''
  license:
    name: ''
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/repositories/fork:
    post:
      tags:
        - repositories
      operationId: fork_repository
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForkRepositoryRequest'
        required: true
      responses:
        '201':
          description: Repository forked successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForkRepositoryResponse'
        '401':
          description: Unauthorized
        '404':
          description: Source repository or tag not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Target repository already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    ForkRepositoryRequest:
      type: object
      description: Request body for POST /api/v1/repositories/fork
      required:
        - source_org
        - source_repo
        - source_tag
      properties:
        repo_name:
          type:
            - string
            - 'null'
          description: >-
            Name for the new repository in your org (defaults to source_repo if
            omitted)
        source_org:
          type: string
          description: The organization that owns the source public repository
        source_repo:
          type: string
          description: The source repository name
        source_tag:
          type: string
          description: The tag to fork (e.g. "latest", "v1.0")
        tag_name:
          type:
            - string
            - 'null'
          description: Tag name in the new repo (defaults to source_tag if omitted)
    ForkRepositoryResponse:
      type: object
      description: Response body for POST /api/v1/repositories/fork
      required:
        - vm_id
        - commit_id
        - repo_name
        - tag_name
        - reference
      properties:
        commit_id:
          type: string
          format: uuid
          description: The new commit in your org (snapshot of the forked VM)
        reference:
          type: string
          description: 'Full reference: repo_name:tag_name'
        repo_name:
          type: string
          description: The new repository name in your org
        tag_name:
          type: string
          description: The tag name pointing to the forked commit
        vm_id:
          type: string
          description: The new VM that was created from the fork
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Reason of error
        success:
          type: boolean
          description: 'Is always: false'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: Token

````