GitLab CI/CD project_import API

Operations related to importing projects

Operations 19

GET /api/v4/projects/{id}/export Get export status #
POST /api/v4/projects/{id}/export Start export #
GET /api/v4/projects/{id}/export/download Download export #
POST /api/v4/projects/{id}/export_relations Start relations export #
GET /api/v4/projects/{id}/export_relations/download Download relations export #
GET /api/v4/projects/{id}/export_relations/status Relations export status #
POST /api/v4/projects/import/authorize Workhorse authorize the project import upload #
POST /api/v4/projects/import Create a new project import #
GET /api/v4/projects/{id}/import Get a project import status #
POST /api/v4/projects/{id}/import/git Import a project from a Git URL #
POST /api/v4/projects/remote-import Create a new project import using a remote object storage path #
POST /api/v4/projects/import-relation/authorize Workhorse authorize the project relation import upload #
POST /api/v4/projects/import-relation Re-import a relation into a project #
GET /api/v4/projects/{id}/relation-imports Get the statuses of relation imports for specified project #
POST /api/v4/projects/remote-import-s3 Create a new project import using a file from AWS S3 #
POST /api/v4/import/bitbucket Import a BitBucket Cloud repository #
POST /api/v4/import/bitbucket_server Import a BitBucket Server repository #
POST /api/v4/import/github Import a GitHub project #
POST /api/v4/import/github/cancel Cancel GitHub project import #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/gitlab-ci-project-import-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

gitlab-ci-project-import-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab access_requests Project Import API
  version: v4
  description: Operations related to access requests
servers:
- url: https://gitlab.com
tags:
- name: project_import
  description: Operations related to importing projects
paths:
  /api/v4/projects/{id}/export:
    get:
      summary: Get export status
      description: This feature was introduced in GitLab 10.6.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get export status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProjectExportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: getApiV4ProjectsIdExport
    post:
      summary: Start export
      description: This feature was introduced in GitLab 10.6.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '202':
          description: Start export
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '429':
          description: Too many requests
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: postApiV4ProjectsIdExport
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdExport'
        required: true
  /api/v4/projects/{id}/export/download:
    get:
      summary: Download export
      description: This feature was introduced in GitLab 10.6.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Download export
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: getApiV4ProjectsIdExportDownload
  /api/v4/projects/{id}/export_relations:
    post:
      summary: Start relations export
      description: This feature was introduced in GitLab 14.4
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '202':
          description: Start relations export
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: postApiV4ProjectsIdExportRelations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdExportRelations'
        required: true
  /api/v4/projects/{id}/export_relations/download:
    get:
      summary: Download relations export
      description: This feature was introduced in GitLab 14.4
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: query
        name: relation
        description: Project relation name
        required: true
        schema:
          type: string
      - in: query
        name: batched
        description: Whether to download in batches
        required: false
        schema:
          type: boolean
      - in: query
        name: batch_number
        description: Batch number to download
        required: false
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: Download relations export
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '500':
          description: Internal Server Error
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: getApiV4ProjectsIdExportRelationsDownload
  /api/v4/projects/{id}/export_relations/status:
    get:
      summary: Relations export status
      description: This feature was introduced in GitLab 14.4
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      - in: query
        name: relation
        description: Project relation name
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Relations export status
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/API_Entities_BulkImports_ExportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: getApiV4ProjectsIdExportRelationsStatus
  /api/v4/projects/import/authorize:
    post:
      summary: Workhorse authorize the project import upload
      description: This feature was introduced in GitLab 12.9
      responses:
        '201':
          description: Workhorse authorize the project import upload
      tags:
      - project_import
      operationId: postApiV4ProjectsImportAuthorize
  /api/v4/projects/import:
    post:
      summary: Create a new project import
      description: This feature was introduced in GitLab 10.6.
      responses:
        '201':
          description: Create a new project import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProjectImportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '400':
          description: Bad request
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: postApiV4ProjectsImport
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: The new project path and name
                file:
                  type: string
                  description: The project export file to be imported
                  format: binary
                name:
                  type: string
                  description: The name of the project to be imported. Defaults to the path of the project if not provided.
                namespace:
                  type: string
                  description: (deprecated) The ID or path of the namespace to import the project to. Defaults to the current user's namespace.
                namespace_id:
                  type: integer
                  format: int32
                  description: The ID of the namespace that the project will be imported into. Defaults to the current user's namespace.
                namespace_path:
                  type: string
                  description: The path of the namespace that the project will be imported into. Defaults to the current user's namespace.
                overwrite:
                  type: boolean
                  default: false
                  description: If there is a project in the same namespace and with the same name overwrite it
                override_params[description]:
                  type: string
                  description: The description of the project
                override_params[build_git_strategy]:
                  type: string
                  enum:
                  - fetch
                  - clone
                  description: The Git strategy. Defaults to `fetch`
                override_params[build_timeout]:
                  type: integer
                  format: int32
                  description: Build timeout
                override_params[auto_cancel_pending_pipelines]:
                  type: string
                  enum:
                  - disabled
                  - enabled
                  description: Auto-cancel pending pipelines
                override_params[ci_config_path]:
                  type: string
                  description: The path to CI config file. Defaults to `.gitlab-ci.yml`
                override_params[service_desk_enabled]:
                  type: boolean
                  description: Disable or enable the service desk
                override_params[issues_enabled]:
                  type: boolean
                  description: Flag indication if the issue tracker is enabled
                override_params[merge_requests_enabled]:
                  type: boolean
                  description: Flag indication if merge requests are enabled
                override_params[wiki_enabled]:
                  type: boolean
                  description: Flag indication if the wiki is enabled
                override_params[jobs_enabled]:
                  type: boolean
                  description: Flag indication if jobs are enabled
                override_params[snippets_enabled]:
                  type: boolean
                  description: Flag indication if snippets are enabled
                override_params[issues_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Issues access level. One of `disabled`, `private` or `enabled`
                override_params[repository_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Repository access level. One of `disabled`, `private` or `enabled`
                override_params[merge_requests_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Merge requests access level. One of `disabled`, `private` or `enabled`
                override_params[forking_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Forks access level. One of `disabled`, `private` or `enabled`
                override_params[wiki_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Wiki access level. One of `disabled`, `private` or `enabled`
                override_params[builds_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Builds access level. One of `disabled`, `private` or `enabled`
                override_params[snippets_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Snippets access level. One of `disabled`, `private` or `enabled`
                override_params[package_registry_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  - public
                  description: Controls visibility of the package registry. One of `disabled`, `private`, `enabled` or `public`. `private` will make the package registry accessible only to project members (reporter role and above). `enabled` will make the package registry accessible to everyone who has access to the project. `public` will make the package registry accessible to everyone. `disabled` will disable the package registry
                override_params[pages_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  - public
                  description: Pages access level. One of `disabled`, `private`, `enabled` or `public`
                override_params[analytics_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Analytics access level. One of `disabled`, `private` or `enabled`
                override_params[container_registry_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Controls visibility of the container registry. One of `disabled`, `private` or `enabled`. `private` will make the container registry accessible only to project members (reporter role and above). `enabled` will make the container registry accessible to everyone who has access to the project. `disabled` will disable the container registry
                override_params[security_and_compliance_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Security and compliance access level. One of `disabled`, `private` or `enabled`
                override_params[releases_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Releases access level. One of `disabled`, `private` or `enabled`
                override_params[environments_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Environments access level. One of `disabled`, `private` or `enabled`
                override_params[feature_flags_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Feature flags access level. One of `disabled`, `private` or `enabled`
                override_params[infrastructure_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Infrastructure access level. One of `disabled`, `private` or `enabled`
                override_params[monitor_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Monitor access level. One of `disabled`, `private` or `enabled`
                override_params[model_experiments_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Model experiments access level. One of `disabled`, `private` or `enabled`
                override_params[model_registry_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Model registry access level. One of `disabled`, `private` or `enabled`
                override_params[emails_disabled]:
                  type: boolean
                  description: 'Deprecated: Use emails_enabled instead.'
                override_params[emails_enabled]:
                  type: boolean
                  description: Enable email notifications
                override_params[show_default_award_emojis]:
                  type: boolean
                  description: Show default award emojis
                override_params[show_diff_preview_in_email]:
                  type: boolean
                  description: Include the code diff preview in merge request notification emails
                override_params[warn_about_potentially_unwanted_characters]:
                  type: boolean
                  description: Warn about potentially unwanted characters
                override_params[enforce_auth_checks_on_uploads]:
                  type: boolean
                  description: Enforce auth check on uploads
                override_params[shared_runners_enabled]:
                  type: boolean
                  description: Flag indication if shared runners are enabled for that project
                override_params[group_runners_enabled]:
                  type: boolean
                  description: Flag indication if group runners are enabled for that project
                override_params[resource_group_default_process_mode]:
                  type: string
                  enum:
                  - unordered
                  - oldest_first
                  - newest_first
                  - newest_ready_first
                  description: The process mode of the resource group
                override_params[resolve_outdated_diff_discussions]:
                  type: boolean
                  description: Automatically resolve merge request diff threads on lines changed with a push
                override_params[remove_source_branch_after_merge]:
                  type: boolean
                  description: Remove the source branch by default after merge
                override_params[packages_enabled]:
                  type: boolean
                  description: 'Deprecated: Use :package_registry_access_level instead. Enable project packages feature'
                override_params[container_registry_enabled]:
                  type: boolean
                  description: 'Deprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project'
                override_params[container_expiration_policy_attributes][cadence]:
                  type: string
                  description: Container expiration policy cadence for recurring job
                override_params[container_expiration_policy_attributes][keep_n]:
                  type: integer
                  format: int32
                  description: Container expiration policy number of images to keep
                override_params[container_expiration_policy_attributes][older_than]:
                  type: string
                  description: Container expiration policy remove images older than value
                override_params[container_expiration_policy_attributes][name_regex]:
                  type: string
                  description: Container expiration policy regex for image removal
                override_params[container_expiration_policy_attributes][name_regex_keep]:
                  type: string
                  description: Container expiration policy regex for image retention
                override_params[container_expiration_policy_attributes][enabled]:
                  type: boolean
                  description: Flag indication if container expiration policy is enabled
                override_params[lfs_enabled]:
                  type: boolean
                  description: Flag indication if Git LFS is enabled for that project
                override_params[visibility]:
                  type: string
                  enum:
                  - private
                  - internal
                  - public
                  description: The visibility of the project.
                override_params[public_builds]:
                  type: boolean
                  description: 'Deprecated: Use public_jobs instead.'
                override_params[public_jobs]:
                  type: boolean
                  description: Perform public builds
                override_params[request_access_enabled]:
                  type: boolean
                  description: Allow users to request member access
                override_params[only_allow_merge_if_pipeline_succeeds]:
                  type: boolean
                  description: Only allow to merge if builds succeed
                override_params[allow_merge_on_skipped_pipeline]:
                  type: boolean
                  description: Allow to merge if pipeline is skipped
                override_params[only_allow_merge_if_all_discussions_are_resolved]:
                  type: boolean
                  description: Only allow to merge if all threads are resolved
                override_params[tag_list]:
                  type: array
                  items:
                    type: string
                  description: 'Deprecated: Use :topics instead'
                override_params[topics]:
                  type: array
                  items:
                    type: string
                  description: The list of topics for a project
                override_params[avatar]:
                  type: string
                  description: Avatar image for project
                  format: binary
                override_params[printing_merge_request_link_enabled]:
                  type: boolean
                  description: Show link to create/view merge request when pushing from the command line
                override_params[merge_method]:
                  type: string
                  enum:
                  - ff
                  - rebase_merge
                  - merge
                  description: The merge method used when merging merge requests
                override_params[suggestion_commit_message]:
                  type: string
                  description: The commit message used to apply merge request suggestions
                override_params[merge_commit_template]:
                  type: string
                  description: Template used to create merge commit message
                override_params[squash_commit_template]:
                  type: string
                  description: Template used to create squash commit message
                override_params[issue_branch_template]:
                  type: string
                  description: Template used to create a branch from an issue
                override_params[auto_devops_enabled]:
                  type: boolean
                  description: Flag indication if Auto DevOps is enabled
                override_params[auto_devops_deploy_strategy]:
                  type: string
                  enum:
                  - continuous
                  - manual
                  - timed_incremental
                  description: Auto Deploy strategy
                override_params[autoclose_referenced_issues]:
                  type: boolean
                  description: Flag indication if referenced issues auto-closing is enabled
                override_params[repository_storage]:
                  type: string
                  description: Which storage shard the repository is on. Available only to admins
                override_params[squash_option]:
                  type: string
                  enum:
                  - never
                  - always
                  - default_on
                  - default_off
                  description: Squash default for project. One of `never`, `always`, `default_on`, or `default_off`.
                override_params[mr_default_target_self]:
                  type: boolean
                  description: Merge requests of this forked project targets itself by default
                override_params[mr_default_title_template]:
                  type: string
                  description: Template used to generate the default merge request title. Maximum 100 characters.
                override_params[only_allow_merge_if_all_status_checks_passed]:
                  type: boolean
                  description: Blocks merge requests from merging unless all status checks have passed
                override_params[approvals_before_merge]:
                  type: integer
                  format: int32
                  description: How many approvers should approve merge request by default
                override_params[mirror]:
                  type: boolean
                  description: '[Deprecated] Enables pull mirroring in a project'
                override_params[mirror_trigger_builds]:
                  type: boolean
                  description: '[Deprecated] Pull mirroring triggers builds'
                override_params[external_authorization_classification_label]:
                  type: string
                  description: The classification label for the project
                override_params[requirements_access_level]:
                  type: string
                  enum:
                  - disabled
                  - private
                  - enabled
                  description: Requirements feature access level. One of `disabled`, `private` or `enabled`
                override_params[prevent_merge_without_jira_issue]:
                  type: boolean
                  description: Require an associated issue from Jira
                override_params[auto_duo_code_review_enabled]:
                  type: boolean
                  description: Enable automatic reviews by GitLab Duo on merge requests
                override_params[duo_remote_flows_enabled]:
                  type: boolean
                  description: Enable GitLab Duo remote flows for this project
                override_params[duo_sast_fp_detection_enabled]:
                  type: boolean
                  description: Enable GitLab Duo SAST false positive detection for this project
                override_params[duo_secret_detection_fp_enabled]:
                  type: boolean
                  description: Enable GitLab Duo Secret Detection false positive detection for this project
                override_params[duo_sast_vr_workflow_enabled]:
                  type: boolean
                  description: Enable GitLab Duo SAST vulnerability resolution workflow for this project
                override_params[spp_repository_pipeline_access]:
                  type: boolean
                  description: Grant read-only access to security policy configurations for enforcement in linked CI/CD projects
                override_params[merge_request_title_regex]:
                  type: string
                  description: The regex the Merge Request must adhere to
                override_params[merge_request_title_regex_description]:
                  type: string
                  description: The description for the regex the Merge Request must adhere to
                file.path:
                  type: string
                  description: Path to locally stored body (generated by Workhorse)
                file.name:
                  type: string
                  description: Real filename as send in Content-Disposition (generated by Workhorse)
                file.type:
                  type: string
                  description: Real content type as send in Content-Type (generated by Workhorse)
                file.size:
                  type: integer
                  format: int32
                  description: Real size of file (generated by Workhorse)
                file.md5:
                  type: string
                  description: MD5 checksum of the file (generated by Workhorse)
                file.sha1:
                  type: string
                  description: SHA1 checksum of the file (generated by Workhorse)
                file.sha256:
                  type: string
                  description: SHA256 checksum of the file (generated by Workhorse)
                file.etag:
                  type: string
                  description: Etag of the file (generated by Workhorse)
                file.remote_id:
                  type: string
                  description: Remote_id of the file (generated by Workhorse)
                file.remote_url:
                  type: string
                  description: Remote_url of the file (generated by Workhorse)
              required:
              - path
              - file
  /api/v4/projects/{id}/import:
    get:
      summary: Get a project import status
      description: This feature was introduced in GitLab 10.6.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Get a project import status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProjectImportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '400':
          description: Bad request
        '404':
          description: Not found
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: getApiV4ProjectsIdImport
  /api/v4/projects/{id}/import/git:
    post:
      summary: Import a project from a Git URL
      description: This feature was introduced in GitLab 18.10.
      parameters:
      - in: path
        name: id
        description: The ID or URL-encoded path of the project
        required: true
        schema:
          type: string
      responses:
        '201':
          description: Import a project from a Git URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProjectImportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '400':
          description: Bad request
        '404':
          description: Not found
        '409':
          description: Conflict
        '422':
          description: Unprocessable Entity
      tags:
      - project_import
      operationId: postApiV4ProjectsIdImportGit
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ProjectsIdImportGit'
        required: true
  /api/v4/projects/remote-import:
    post:
      summary: Create a new project import using a remote object storage path
      description: This feature was introduced in GitLab 13.2.
      responses:
        '201':
          description: Create a new project import using a remote object storage path
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/API_Entities_ProjectImportStatus'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '400':
          description: Bad request
        '404':
          description: Not found
        '429':
          description: Too many requests
        '503':
          description: Service unavailable
      tags:
      - project_import
      operationId: postApiV4ProjectsRemoteImport
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The URL for the file.
                path:
                  type: string
                  description: The new project path and name
                name:
                  type: st

# --- truncated at 32 KB (94 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/gitlab-ci/refs/heads/main/openapi/gitlab-ci-project-import-api-openapi.yml