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

# Start A Repository Migration

> Starts an asynchronous migration of a source Git repository into the project's working tree and returns the identifier of the migration. Poll the migration-status endpoint to track progress.



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml post /v1/projects/{projectId}/repository-migration
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: >-
      Start and track the migration of a Git repository into a project's working
      tree.
    name: Repository Migration
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/projects/{projectId}/repository-migration:
    post:
      tags:
        - Repository Migration
      summary: Start A Repository Migration
      description: >-
        Starts an asynchronous migration of a source Git repository into the
        project's working tree and returns the identifier of the migration. Poll
        the migration-status endpoint to track progress.
      operationId: startMigration
      parameters:
        - description: The unique identifier of the project that owns the working tree.
          in: path
          name: projectId
          required: true
          schema:
            type: string
            format: uuid
        - description: >-
            Personal access token or OAuth token used to authenticate with the
            target Git provider when pushing content. Required for private
            target repositories unless targetEnterpriseOauthId is supplied; omit
            for public repositories.
          in: header
          name: Git-Provider-Access-Token
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              Azure DevOps target:
                description: Azure DevOps target
                value:
                  mode: MIRROR_PUSH
                  targetCloneUrl: >-
                    https://dev.azure.com/my-azure-organisation/my-project/_git/new-pipelines
                  targetProvider: AZURE_DEVOPS
                  targetName: new-pipelines
                  providerParameters:
                    organization: my-azure-organisation
                    repositoryId: existing-repo-id
                    tenantId: my-tenant-id
              GitHub target:
                description: GitHub target
                value:
                  mode: MIRROR_PUSH
                  targetCloneUrl: https://github.com/acme/new-pipelines.git
                  targetProvider: GITHUB
                  targetName: new-pipelines
              GitLab target:
                description: GitLab target
                value:
                  mode: MIRROR_PUSH
                  targetCloneUrl: https://gitlab.com/acme/new-pipelines.git
                  targetProvider: GITLAB
                  targetName: new-pipelines
                  providerParameters:
                    repositoryId: existing-repo-id
            schema:
              $ref: '#/components/schemas/RepositoryMigrationRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryMigrationResponse'
          description: Repository migration accepted and started
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Invalid repository migration request
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Project not found
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: A repository migration is already in progress
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unexpected error occurred
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gateway timeout
components:
  schemas:
    RepositoryMigrationRequest:
      type: object
      description: >-
        Repository migration request describing the target repository to migrate
        the project's working tree to.
      properties:
        mode:
          type: string
          description: >-
            The migration mode. MIRROR_PUSH copies the full working tree to the
            target repository; RECONFIGURE points the project at the target
            repository without pushing content.
          enum:
            - MIRROR_PUSH
            - RECONFIGURE
        providerParameters:
          type:
            - object
            - 'null'
          additionalProperties:
            type: string
          description: >-
            Provider-specific parameters for the target repository, as key/value
            pairs. Required for some providers. For Azure DevOps, supply
            organization, repositoryId and tenantId. See the create-repository
            provider-specific request schemas for field details.
        targetCloneUrl:
          type: string
          description: The clone URL of the target Git repository to migrate to.
          example: https://github.com/acme/new-pipelines.git
          minLength: 1
        targetEnterpriseOauthId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The unique identifier of the enterprise OAuth connection used to
            authenticate with the target repository. Omit for public or personal
            repositories.
        targetName:
          type: string
          description: The display name of the target repository.
          example: new-pipelines
          minLength: 1
        targetProvider:
          type: string
          description: >-
            The Git provider hosting the target repository. One of GITHUB,
            GITLAB, AZURE_DEVOPS. Accepts any case.
          enum:
            - GITHUB
            - GITLAB
            - AZURE_DEVOPS
          example: GITHUB
      required:
        - mode
        - targetCloneUrl
        - targetName
        - targetProvider
    RepositoryMigrationResponse:
      type: object
      description: The result of accepting a repository migration request.
      properties:
        migrationId:
          type: string
          format: uuid
          description: >-
            The unique identifier of the started repository migration. Use this
            to poll the migration-status endpoint.
      required:
        - migrationId
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````