Import a project from a Git URL
POST
/api/v4/projects/{id}/import/git
This feature was introduced in GitLab 18.10.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Request Body required
Section titled “ Request Body required ” Media type application/json
object
import_url
required
The URL from which the project is imported
string
import_url_user
Username for the import URL
string
import_url_password
Password for the import URL
string
Example generated
{ "import_url": "example", "import_url_user": "example", "import_url_password": "example"}Responses
Section titled “ Responses ”Created
Media type application/json
object
id
integer format: int64
description
string
name
string
name_with_namespace
string
path
string
path_with_namespace
string
created_at
string format: date-time
import_status
string
import_type
string
correlation_id
string
failed_relations
Array<object>
object
id
integer format: int64
created_at
string format: date-time
exception_class
string
source
string
exception_message
string
relation_name
string
line_number
integer
import_error
string
stats
object
Example
{ "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"}Bad request
Unauthorized
Forbidden
Not found
Conflict
Unprocessable Entity