Skip to content

Import a project from a local archive

POST
/api/v4/projects/import

Imports a project from a local archive.

Media type multipart/form-data
object
path
required

The new project path and name

string
nullable
file
required

The project export file to be imported

string format: binary
nullable
name

The name of the project to be imported. Defaults to the path of the project if not provided.

string
nullable
namespace

(deprecated) The ID or path of the namespace to import the project to. Defaults to the current user’s namespace.

string
nullable
namespace_id

The ID of the namespace that the project will be imported into. Defaults to the current user’s namespace.

integer
nullable
Example
1
namespace_path

The path of the namespace that the project will be imported into. Defaults to the current user’s namespace.

string
nullable
Example
new_path/gitlab
overwrite

If there is a project in the same namespace and with the same name overwrite it

boolean
nullable
override_params

New project params to override values in the export

object
description

The description of the project

string
nullable
build_git_strategy

The Git strategy. Defaults to fetch

string
nullable
Allowed values: fetch clone
build_timeout

Build timeout

integer
nullable
auto_cancel_pending_pipelines

Auto-cancel pending pipelines

string
nullable
Allowed values: disabled enabled
ci_config_path

The path to CI config file. Defaults to .gitlab-ci.yml

string
nullable
service_desk_enabled

Disable or enable the service desk

boolean
nullable
issues_enabled

Flag indication if the issue tracker is enabled

boolean
nullable
merge_requests_enabled

Flag indication if merge requests are enabled

boolean
nullable
wiki_enabled

Flag indication if the wiki is enabled

boolean
nullable
jobs_enabled

Flag indication if jobs are enabled

boolean
nullable
snippets_enabled

Flag indication if snippets are enabled

boolean
nullable
issues_access_level

Issues access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
repository_access_level

Repository access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
merge_requests_access_level

Merge requests access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
forking_access_level

Forks access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
wiki_access_level

Wiki access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
builds_access_level

Builds access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
snippets_access_level

Snippets access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
package_registry_access_level

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

string
nullable
Allowed values: disabled private enabled public
pages_access_level

Pages access level. One of disabled, private, enabled or public

string
nullable
Allowed values: disabled private enabled public
analytics_access_level

Analytics access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
container_registry_access_level

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

string
nullable
Allowed values: disabled private enabled
security_and_compliance_access_level

Security and compliance access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
releases_access_level

Releases access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
environments_access_level

Environments access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
feature_flags_access_level

Feature flags access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
infrastructure_access_level

Infrastructure access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
monitor_access_level

Monitor access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
model_experiments_access_level

Model experiments access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
model_registry_access_level

Model registry access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
emails_disabled

Deprecated: Use emails_enabled instead.

boolean
nullable
emails_enabled

Enable email notifications

boolean
nullable
show_default_award_emojis

Show default award emojis

boolean
nullable
show_diff_preview_in_email

Include the code diff preview in merge request notification emails

boolean
nullable
warn_about_potentially_unwanted_characters

Warn about potentially unwanted characters

boolean
nullable
enforce_auth_checks_on_uploads

Enforce auth check on uploads

boolean
nullable
shared_runners_enabled

Flag indication if shared runners are enabled for that project

boolean
nullable
group_runners_enabled

Flag indication if group runners are enabled for that project

boolean
nullable
resource_group_default_process_mode

The process mode of the resource group

string
nullable
Allowed values: unordered oldest_first newest_first newest_ready_first
resolve_outdated_diff_discussions

Automatically resolve merge request diff threads on lines changed with a push

boolean
nullable
remove_source_branch_after_merge

Remove the source branch by default after merge

boolean
nullable
packages_enabled

Deprecated: Use :package_registry_access_level instead. Enable project packages feature

boolean
nullable
container_registry_enabled

Deprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project

boolean
nullable
container_expiration_policy_attributes

Object that contains information on the container expiration policy

object
cadence

Container expiration policy cadence for recurring job

string
nullable
keep_n

Container expiration policy number of images to keep

integer
nullable
older_than

Container expiration policy remove images older than value

string
nullable
name_regex

Container expiration policy regex for image removal

string
nullable
name_regex_keep

Container expiration policy regex for image retention

string
nullable
enabled

Flag indication if container expiration policy is enabled

boolean
nullable
lfs_enabled

Flag indication if Git LFS is enabled for that project

boolean
nullable
visibility

The visibility of the project.

string
nullable
Allowed values: private internal public
public_builds

Deprecated: Use public_jobs instead.

boolean
nullable
public_jobs

Perform public builds

boolean
nullable
request_access_enabled

Allow users to request member access

boolean
nullable
only_allow_merge_if_pipeline_succeeds

Only allow to merge if builds succeed

boolean
nullable
allow_merge_on_skipped_pipeline

Allow to merge if pipeline is skipped

boolean
nullable
only_allow_merge_if_all_discussions_are_resolved

Only allow to merge if all threads are resolved

boolean
nullable
tag_list

Deprecated: Use :topics instead

Array<string>
nullable
topics

The list of topics for a project

Array<string>
nullable
avatar

Avatar image for project

string format: binary
nullable
printing_merge_request_link_enabled

Show link to create/view merge request when pushing from the command line

boolean
nullable
merge_method

The merge method used when merging merge requests

string
nullable
Allowed values: ff rebase_merge merge
suggestion_commit_message

The commit message used to apply merge request suggestions

string
nullable
merge_commit_template

Template used to create merge commit message

string
nullable
squash_commit_template

Template used to create squash commit message

string
nullable
issue_branch_template

Template used to create a branch from an issue

string
nullable
auto_devops_enabled

Flag indication if Auto DevOps is enabled

boolean
nullable
auto_devops_deploy_strategy

Auto Deploy strategy

string
nullable
Allowed values: continuous manual timed_incremental
autoclose_referenced_issues

Flag indication if referenced issues auto-closing is enabled

boolean
nullable
repository_storage

Which storage shard the repository is on. Available only to admins

string
nullable
squash_option

Squash default for project. One of never, always, default_on, or default_off.

string
nullable
Allowed values: never always default_on default_off
mr_default_target_self

Merge requests of this forked project targets itself by default

boolean
nullable
mr_default_title_template

Template used to generate the default merge request title. Maximum 100 characters.

string
nullable <= 100 characters
only_allow_merge_if_all_status_checks_passed

Blocks merge requests from merging unless all status checks have passed

boolean
nullable
approvals_before_merge

How many approvers should approve merge request by default

integer
nullable
mirror

[Deprecated] Enables pull mirroring in a project

boolean
nullable
mirror_trigger_builds

[Deprecated] Pull mirroring triggers builds

boolean
nullable
external_authorization_classification_label

The classification label for the project

string
nullable
requirements_access_level

Requirements feature access level. One of disabled, private or enabled

string
nullable
Allowed values: disabled private enabled
prevent_merge_without_jira_issue

Require an associated issue from Jira

boolean
nullable
auto_duo_code_review_enabled

Enable automatic reviews by GitLab Duo on merge requests

boolean
nullable
duo_remote_flows_enabled

Enable GitLab Duo remote flows for this project

boolean
nullable
duo_sast_fp_detection_enabled

Enable GitLab Duo SAST false positive detection for this project

boolean
nullable
duo_secret_detection_fp_enabled

Enable GitLab Duo Secret Detection false positive detection for this project

boolean
nullable
duo_dependency_bump_breaking_changes_enabled

Turn on Agentic Breaking Change Resolution for this project

boolean
nullable
duo_sast_vr_workflow_enabled

Enable GitLab Duo SAST vulnerability resolution workflow for this project

boolean
nullable
spp_repository_pipeline_access

Grant read-only access to security policy configurations for enforcement in linked CI/CD projects

boolean
nullable
merge_request_title_regex

The regex the Merge Request must adhere to

string
nullable
merge_request_title_regex_description

The description for the regex the Merge Request must adhere to

string
nullable
file.path

Path to locally stored body (generated by Workhorse)

string
nullable
file.name

Real filename as send in Content-Disposition (generated by Workhorse)

string
nullable
file.type

Real content type as send in Content-Type (generated by Workhorse)

string
nullable
file.size

Real size of file (generated by Workhorse)

integer
nullable
file.md5

MD5 checksum of the file (generated by Workhorse)

string
nullable
file.sha1

SHA1 checksum of the file (generated by Workhorse)

string
nullable
file.sha256

SHA256 checksum of the file (generated by Workhorse)

string
nullable
file.etag

Etag of the file (generated by Workhorse)

string
nullable
file.remote_id

Remote_id of the file (generated by Workhorse)

string
nullable
file.remote_url

Remote_url of the file (generated by Workhorse)

string
nullable

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

Service unavailable