project_import

Import a project from a Git URL

Imports a project from a specified Git URL. This feature was introduced in GitLab 18.10.

post/api/v4/projects/{id}/import/git

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

import_urlstring required

The URL from which the project is imported

import_url_userstring

Username for the import URL

import_url_passwordstring

Password for the import URL

Response

Import a project from a Git URL

idinteger required
descriptionstring required
namestring required
name_with_namespacestring required
pathstring required
path_with_namespacestring required
created_atstring date-time required
import_statusstring required
import_typestring required
correlation_idstring required
import_errorstring required
statsobject required

Example response

{
  "id": 1,
  "description": "desc",
  "name": "project1",
  "name_with_namespace": "John Doe / project1",
  "path": "project1",
  "path_with_namespace": "namespace1/project1",
  "created_at": "2020-05-07T04:27:17.016Z",
  "import_status": "scheduled",
  "import_type": "gitlab_project",
  "correlation_id": "dfcf583058ed4508e4c7c617bd7f0edd",
  "failed_relations": [
    {
      "id": 1,
      "created_at": "2012-05-28T04:42:42-07:00",
      "exception_class": "StandardError",
      "source": "ImportRepositoryWorker",
      "relation_name": "issues",
      "line_number": 1
    }
  ],
  "import_error": "Error message"
}

Changes

No recorded changes to this operation across all 5 revisions of this API.