GitLab Imports API

Use this API to migrate groups and projects by using [direct transfer](https://docs.gitlab.com/user/group/import/direct_transfer_migrations/), and to [import repositories from external sources](https://docs.gitlab.com/user/import/). Before migrating by direct transfer, see the [prerequisites](https://docs.gitlab.com/user/group/import/direct_transfer_migrations/#prerequisites). > [!note] > User contribution mapping is not supported when you import projects to a > [personal namespace](https://docs.gitlab.com/user/namespace/#types-of-namespaces). All > contributions are assigned to the personal namespace owner and cannot be reassigned.

Operations 9

POST /api/v4/import/github/gists Import GitHub gists into GitLab snippets #
POST /api/v4/bulk_imports Start a group or project migration #
GET /api/v4/bulk_imports List all group or project migrations #
GET /api/v4/bulk_imports/entities List all group or project migration entities #
GET /api/v4/bulk_imports/{import_id} Retrieve a group or project migration #
GET /api/v4/bulk_imports/{import_id}/entities List all group or project migration entities #
GET /api/v4/bulk_imports/{import_id}/entities/{entity_id} Retrieve a group or project migration entity #
GET /api/v4/bulk_imports/{import_id}/entities/{entity_id}/failures List all failed import records for a migration entity #
POST /api/v4/bulk_imports/{import_id}/cancel Cancel a migration #

Documentation

📖
Documentation
https://docs.gitlab.com/api/openapi/
📖
Documentation
https://docs.gitlab.com/api/issues/
📖
Authentication
https://docs.gitlab.com/api/rest/authentication/
📖
Documentation
https://docs.gitlab.com/api/merge_requests/
📖
Documentation
https://docs.gitlab.com/api/pipelines/
📖
Documentation
https://docs.gitlab.com/api/jobs/
📖
Documentation
https://docs.gitlab.com/api/runners/
📖
Documentation
https://docs.gitlab.com/api/users/
📖
Documentation
https://docs.gitlab.com/api/repositories/
📖
Documentation
https://docs.gitlab.com/api/commits/
📖
Documentation
https://docs.gitlab.com/api/branches/
📖
Documentation
https://docs.gitlab.com/api/tags/
📖
Documentation
https://docs.gitlab.com/api/releases/
📖
Documentation
https://docs.gitlab.com/api/environments/
📖
Documentation
https://docs.gitlab.com/api/deployments/
📖
Documentation
https://docs.gitlab.com/api/pipeline_schedules/
📖
Documentation
https://docs.gitlab.com/api/labels/
📖
Documentation
https://docs.gitlab.com/api/milestones/
📖
Documentation
https://docs.gitlab.com/api/notes/
📖
Documentation
https://docs.gitlab.com/api/snippets/
📖
Documentation
https://docs.gitlab.com/api/packages/
📖
Documentation
https://docs.gitlab.com/api/container_registry/
📖
Documentation
https://docs.gitlab.com/api/vulnerabilities/
📖
Documentation
https://docs.gitlab.com/api/deploy_keys/
📖
Documentation
https://docs.gitlab.com/api/protected_branches/
📖
Documentation
https://docs.gitlab.com/api/wikis/
📖
Documentation
https://docs.gitlab.com/api/events/
📖
Documentation
https://docs.gitlab.com/api/search/
📖
Documentation
https://docs.gitlab.com/api/namespaces/
📖
Documentation
https://docs.gitlab.com/api/groups/
📖
Documentation
https://docs.gitlab.com/api/projects/
📖
Documentation
https://docs.gitlab.com/api/applications/
📖
Documentation
https://docs.gitlab.com/api/avatar/
📖
Documentation
https://docs.gitlab.com/api/broadcast_messages/
📖
Documentation
https://docs.gitlab.com/api/bulk_imports/
📖
Documentation
https://docs.gitlab.com/api/settings/
📖
Documentation
https://docs.gitlab.com/api/metadata/
📖
Documentation
https://docs.gitlab.com/api/version/
📖
Documentation
https://docs.gitlab.com/api/rest/
📖
APIReference
https://docs.gitlab.com/api/api_resources/
📖
RateLimits
https://docs.gitlab.com/security/rate_limits/
📖
Documentation
https://docs.gitlab.com/api/oauth2/
📖
Authentication
https://docs.gitlab.com/integration/oauth_provider/
📖
Documentation
https://docs.gitlab.com/user/project/integrations/webhooks.html
📖
APIReference
https://docs.gitlab.com/api/project_webhooks/

Specifications

Schemas & Data

📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-application-settings-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-node-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-geo-site-status-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-apientities-application-setting-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-post-api-v4-geo-status-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-put-api-v4-projects-id-request-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-cluster-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-batched-background-migration-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-ci-variable-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-dictionary-table-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-plan-limit-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-appearance-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-avatar-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-imports-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-bulk-import-schema.json
📊
JSONSchema
https://artifacts.apis.io/gitlab/json-schema/gitlab-api-entities-metadata-schema.json

Other Resources

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:gitlab-imports-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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-imports-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: GitLab REST Imports API
  description: GitLab REST API used to interact with a GitLab installation.
  termsOfService: https://handbook.gitlab.com/handbook/legal/api-terms/
  version: '19.6'
  license:
    name: CC BY-SA 4.0
    url: https://gitlab.com/gitlab-org/gitlab/-/blob/master/LICENSE
    x-gitlab-description: The license applies to the OpenAPI specification document itself. For terms governing use of the GitLab API, see the termsOfService field.
servers:
- url: https://{hostname}
  description: GitLab REST API
  variables:
    hostname:
      default: gitlab.com
      description: Your GitLab instance hostname
security:
- http: []
- oauth2: []
- apiKey: []
tags:
- name: Imports
  description: 'Use this API to migrate groups and projects by using

    direct transfer, and to

    import repositories from external sources.


    Before migrating by direct transfer, see the

    prerequisites.


    > [!note]

    > User contribution mapping is not supported when you import projects to a

    > personal namespace. All

    > contributions are assigned to the personal namespace owner and cannot be reassigned.'
  x-displayName: Imports
  externalDocs:
    url: https://docs.gitlab.com/api/bulk_imports/
paths:
  /api/v4/import/github/gists:
    post:
      operationId: postApiV4ImportGithubGists
      summary: Import GitHub gists into GitLab snippets
      description: Imports personal GitHub gists into GitLab snippets. You can import gists with up to 10 files. GitHub gists with more than 10 files are skipped. You should manually migrate these GitHub gists. If any gists cannot be imported, an email is sent with a list of gists that were not imported.
      tags:
      - Imports
      responses:
        '202':
          description: Accepted
        '401':
          description: Unauthorized
        '422':
          description: Unprocessable Entity
        '429':
          description: Too Many Requests
        '400':
          description: Bad Request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/postApiV4ImportGithubGistsRequest'
  /api/v4/bulk_imports:
    post:
      operationId: postApiV4BulkImports
      summary: Start a group or project migration
      description: Starts a group or project migration. To migrate a project, specify `entities[project_entity]`.
      tags:
      - Imports
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesBulkImport'
        '401':
          description: Unauthorized
        '400':
          description: Bad request
        '404':
          description: Not found
        '422':
          description: Unprocessable entity
        '503':
          description: Service unavailable
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/postApiV4BulkImportsRequest'
    get:
      operationId: getApiV4BulkImports
      summary: List all group or project migrations
      description: Lists all group or project migrations.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesBulkImport'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
      - name: sort
        required: false
        description: Sort results in ascending or descending order by creation date.
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
        in: query
      - name: status
        required: false
        description: Filter migrations by import status.
        schema:
          type:
          - string
          - 'null'
          enum:
          - created
          - started
          - finished
          - timeout
          - failed
          - canceled
          - null
        in: query
  /api/v4/bulk_imports/entities:
    get:
      operationId: getApiV4BulkImportsEntities
      summary: List all group or project migration entities
      description: Lists all group or project migration entities.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesBulkImportsEntity'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
      - name: sort
        required: false
        description: Sort results in ascending or descending order by creation date.
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
        in: query
      - name: status
        required: false
        description: Filter entities by import status.
        schema:
          type:
          - string
          - 'null'
          enum:
          - created
          - started
          - finished
          - timeout
          - failed
          - canceled
          - null
        in: query
  /api/v4/bulk_imports/{import_id}:
    get:
      operationId: getApiV4BulkImportsImportId
      summary: Retrieve a group or project migration
      description: Retrieves details of a group or project migration.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesBulkImport'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: import_id
        required: true
        description: ID of the GitLab Migration.
        schema:
          type: integer
        in: path
  /api/v4/bulk_imports/{import_id}/entities:
    get:
      operationId: getApiV4BulkImportsImportIdEntities
      summary: List all group or project migration entities
      description: Lists all group or project migration entities for a specified migration.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/APIEntitiesBulkImportsEntity'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: import_id
        required: true
        description: ID of the GitLab Migration.
        schema:
          type: integer
        in: path
      - name: status
        required: false
        description: Filter entities by import status.
        schema:
          type:
          - string
          - 'null'
          enum:
          - created
          - started
          - finished
          - timeout
          - failed
          - canceled
          - null
        in: query
      - name: page
        required: false
        description: Page number of results to retrieve.
        schema:
          type: integer
          default: 1
        in: query
        example: 1
      - name: per_page
        required: false
        description: Number of items to list per page.
        schema:
          type: integer
          default: 20
        in: query
        example: 20
  /api/v4/bulk_imports/{import_id}/entities/{entity_id}:
    get:
      operationId: getApiV4BulkImportsImportIdEntitiesEntityId
      summary: Retrieve a group or project migration entity
      description: Retrieves details of a group or project migration entity.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesBulkImportsEntity'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: import_id
        required: true
        description: ID of the GitLab Migration.
        schema:
          type: integer
        in: path
      - name: entity_id
        required: true
        description: ID of the GitLab Migration entity.
        schema:
          type: integer
        in: path
  /api/v4/bulk_imports/{import_id}/entities/{entity_id}/failures:
    get:
      operationId: getApiV4BulkImportsImportIdEntitiesEntityIdFailures
      summary: List all failed import records for a migration entity
      description: Lists all failed import records for a group or project migration entity. This feature was introduced in GitLab 16.6.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesBulkImportsEntityFailure'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: import_id
        required: true
        description: ID of the GitLab Migration.
        schema:
          type: integer
        in: path
      - name: entity_id
        required: true
        description: ID of the GitLab Migration entity.
        schema:
          type: integer
        in: path
  /api/v4/bulk_imports/{import_id}/cancel:
    post:
      operationId: postApiV4BulkImportsImportIdCancel
      summary: Cancel a migration
      description: Cancels a direct transfer migration. This feature was introduced in GitLab 17.1.
      tags:
      - Imports
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIEntitiesBulkImport'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '503':
          description: Service unavailable
        '400':
          description: Bad Request
      parameters:
      - name: import_id
        required: true
        description: ID of the GitLab Migration.
        schema:
          type: integer
        in: path
components:
  schemas:
    postApiV4BulkImportsRequest:
      type: object
      properties:
        configuration:
          type:
          - object
          - 'null'
          description: The source GitLab instance configuration
          properties:
            url:
              type:
              - string
              - 'null'
              description: Source GitLab instance URL
            access_token:
              type:
              - string
              - 'null'
              description: Access token to the source GitLab instance
          required:
          - url
          - access_token
        entities:
          type:
          - array
          - 'null'
          description: List of entities to import
          items:
            type: object
            properties:
              source_type:
                type: string
                enum:
                - group_entity
                - project_entity
                description: Source entity type
                minLength: 1
              source_full_path:
                type:
                - string
                - 'null'
                description: Relative path of the source entity to import
                example: '''source/full/path'' not ''https://example.com/source/full/path'''
              destination_namespace:
                type:
                - string
                - 'null'
                description: Destination namespace for the entity
                example: '''destination_namespace'' or ''destination/namespace'''
              destination_slug:
                type:
                - string
                - 'null'
                description: Destination slug for the entity
                example: '''destination_slug'' not ''destination/slug'''
              destination_name:
                type:
                - string
                - 'null'
                description: 'Deprecated: Use :destination_slug instead. Destination slug for the entity'
                example: '''destination_slug'' not ''destination/slug'''
              migrate_projects:
                type: boolean
                description: Indicates group migration should include nested projects
                default: true
              migrate_memberships:
                type: boolean
                description: The option to migrate memberships or not
                default: true
            required:
            - source_type
            - source_full_path
            - destination_namespace
      required:
      - configuration
      - entities
    APIEntitiesBulkImportsEntity:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        bulk_import_id:
          type: integer
          format: int64
          example: 1
        status:
          type: string
          enum:
          - created
          - started
          - finished
          - timeout
          - failed
          example: created
        entity_type:
          type: string
          enum:
          - group
          - project
        source_full_path:
          type: string
          example: source_group
        destination_full_path:
          type: string
          example: some_group/source_project
        destination_name:
          type: string
          example: destination_slug
        destination_slug:
          type: string
          example: destination_slug
        destination_namespace:
          type: string
          example: destination_path
        parent_id:
          type: integer
          format: int64
          example: 1
        namespace_id:
          type: integer
          format: int64
          example: 1
        project_id:
          type: integer
          format: int64
          example: 1
        created_at:
          type: string
          format: date-time
          example: '2012-05-28T04:42:42-07:00'
        updated_at:
          type: string
          format: date-time
          example: '2012-05-28T04:42:42-07:00'
        failures:
          type: array
          items:
            $ref: '#/components/schemas/APIEntitiesBulkImportsEntityFailure'
        migrate_projects:
          type: boolean
          example: true
        migrate_memberships:
          type: boolean
          example: true
        has_failures:
          type: boolean
          example: false
        stats:
          type: object
    APIEntitiesBulkImportsEntityFailure:
      type: object
      properties:
        relation:
          type: string
          example: label
        exception_message:
          type: string
          example: error message
        exception_class:
          type: string
          example: Exception
        correlation_id_value:
          type: string
          example: dfcf583058ed4508e4c7c617bd7f0edd
        source_url:
          type: string
          example: https://source.gitlab.com/group/-/epics/1
        source_title:
          type: string
          example: title
    APIEntitiesBulkImport:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
        status:
          type: string
          enum:
          - created
          - started
          - finished
          - timeout
          - failed
          example: finished
        source_type:
          type: string
          example: gitlab
        source_url:
          type: string
          example: https://source.gitlab.com/
        created_at:
          type: string
          format: date-time
          example: '2012-05-28T04:42:42-07:00'
        updated_at:
          type: string
          format: date-time
          example: '2012-05-28T04:42:42-07:00'
        has_failures:
          type: boolean
          example: false
    postApiV4ImportGithubGistsRequest:
      type: object
      properties:
        personal_access_token:
          type:
          - string
          - 'null'
          description: GitHub personal access token.
      required:
      - personal_access_token
  securitySchemes:
    http:
      type: http
      scheme: bearer
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://gitlab.com/oauth/authorize
          tokenUrl: https://gitlab.com/oauth/token
          refreshUrl: https://gitlab.com/oauth/token
          scopes:
            api: Grants complete read/write access to the API, including all groups and projects, the container registry, the dependency proxy, and the package registry.
            read_api: Grants read access to the API, including all groups and projects, the container registry, and the package registry.
            read_user: Grants read-only access to your profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users.
            create_runner: Grants create access to the runners.
            manage_runner: Grants access to manage the runners.
            k8s_proxy: Grants permission to perform Kubernetes API calls using the agent for Kubernetes.
            self_rotate: Grants permission for token to rotate itself.
            mcp: Grants read-write access to remote Model Context Protocol (MCP) server for tools execution.
            mcp_orbit: Grants access to the Orbit Knowledge Graph MCP server for graph queries and schema retrieval.
    apiKey:
      type: apiKey
      name: PRIVATE-TOKEN
      in: header