Use this API to import repositories from external sources and to migrate a project between GitLab instances.

If you first migrate the parent group structure with the group import and export API, you can preserve relationships that span the group, such as connections between project issues and group epics. After an import, use the project-level CI/CD variables API to restore CI/CD variables. You must still migrate your container registry over a series of Docker pulls and pushes, and re-run any CI/CD pipelines to retrieve build artifacts.

The project relations export endpoints are used by the destination instance during group migration by direct transfer to migrate a project structure, and you don’t usually need to call them yourself. In this context, a relation is an exportable item such as a merge request, including any related items such as a label.

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.

Import repository from Bitbucket Cloud

POST /api/v4/import/bitbucket

Imports a repository from Bitbucket Cloud to GitLab. Prerequisites: - The prerequisites for Bitbucket Cloud importer. This feature was introduced in GitLab 17.0.

Request body (application/json)

PropertyTypeDescription
bitbucket_api_token
Required
StringBitBucket API token
bitbucket_email
Required
StringBitBucket email
new_nameStringNew repository name
repo_path
Required
StringRepository path
target_namespace
Required
StringTarget namespace

Responses

CodeDescriptionSchema
201CreatedProjectImportEntity
400Bad request—
401Unauthorized—
403Forbidden—
422Unprocessable entity—
503Service unavailable—

Import repository from Bitbucket Server

POST /api/v4/import/bitbucket_server

Imports a repository from Bitbucket Server to GitLab. The Bitbucket Project Key is only used for finding the repository in Bitbucket. You must specify a target_namespace if you want to import the repository to a GitLab group.

Request body (application/json)

PropertyTypeDescription
bitbucket_server_project
Required
StringBitBucket Server Project Key
bitbucket_server_repo
Required
StringBitBucket Server Repository Name
bitbucket_server_url
Required
StringBitbucket Server URL
bitbucket_server_username
Required
StringBitBucket Server Username
new_nameStringNew repo name
new_namespaceStringNamespace to import repo into
personal_access_token
Required
StringBitBucket Server personal access token/password
timeout_strategyStringStrategy for behavior on timeouts
Allowed values: optimistic, pessimistic

Responses

CodeDescriptionSchema
201CreatedProjectEntity
400Bad request—
401Unauthorized—
403Forbidden—
422Unprocessable entity—
503Service unavailable—

Import a repository from GitHub

POST /api/v4/import/github

Imports a repository from GitHub to GitLab.

Request body (application/json)

PropertyTypeDescription
github_hostnameStringCustom GitHub enterprise hostname. For example: https://github.example.com. From GitLab 16.5 to GitLab 17.1, you must include the path /api/v3
new_nameStringNew repo name
optional_stagesObjectOptional stages of import to be performed
pagination_limitIntegerPagination limit
Maximum: 100
Minimum: 1
personal_access_token
Required
StringGitHub personal access token
repo_id
Required
IntegerGitHub repository ID
target_namespace
Required
StringNamespace or group to import repository into
timeout_strategyStringStrategy for behavior on timeouts
Allowed values: optimistic, pessimistic

Responses

CodeDescriptionSchema
201CreatedProjectEntity
400Bad request—
401Unauthorized—
403Forbidden—
422Unprocessable entity—
503Service unavailable—

Cancel a GitHub project import

POST /api/v4/import/github/cancel

Cancels an in-progress import of a GitHub project to GitLab.

Request body (application/json)

PropertyTypeDescription
project_id
Required
IntegerID of importing project to be canceled

Responses

CodeDescriptionSchema
200OKProjectImportEntity
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Import a project from a local archive

POST /api/v4/projects/import

Imports a project from a local archive.

Request body (multipart/form-data)

PropertyTypeDescription
file
Required
String (binary)The project export file to be imported
file.etagStringEtag of the file (generated by Workhorse)
file.md5StringMD5 checksum of the file (generated by Workhorse)
file.nameStringReal filename as send in Content-Disposition (generated by Workhorse)
file.pathStringPath to locally stored body (generated by Workhorse)
file.remote_idStringRemote_id of the file (generated by Workhorse)
file.remote_urlStringRemote_url of the file (generated by Workhorse)
file.sha1StringSHA1 checksum of the file (generated by Workhorse)
file.sha256StringSHA256 checksum of the file (generated by Workhorse)
file.sizeIntegerReal size of file (generated by Workhorse)
file.typeStringReal content type as send in Content-Type (generated by Workhorse)
nameStringThe name of the project to be imported. Defaults to the path of the project if not provided
namespaceString(deprecated) The ID or path of the namespace to import the project to. Defaults to the current user’s namespace. Mutually exclusive with namespace_id, namespace_path
namespace_idIntegerThe ID of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_path
Example: 1
namespace_pathStringThe path of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_id
Example: new_path/gitlab
override_paramsObjectNew project params to override values in the export
override_params.allow_merge_on_skipped_pipelineBooleanAllow to merge if pipeline is skipped
override_params.analytics_access_levelStringAnalytics access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.auto_cancel_pending_pipelinesStringAuto-cancel pending pipelines
Allowed values: disabled, enabled
override_params.auto_devops_deploy_strategyStringAuto Deploy strategy
Allowed values: continuous, manual, timed_incremental
override_params.auto_devops_enabledBooleanFlag indication if Auto DevOps is enabled
override_params.autoclose_referenced_issuesBooleanFlag indication if referenced issues auto-closing is enabled
override_params.avatarString (binary)Avatar image for project
override_params.build_git_strategyStringThe Git strategy. Defaults to fetch
Allowed values: fetch, clone
override_params.build_timeoutIntegerBuild timeout
override_params.builds_access_levelStringBuilds access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.ci_config_pathStringThe path to CI config file. Defaults to .gitlab-ci.yml
override_params.cicd_catalog_enabledBooleanSet whether the project is a CI/CD catalog project
override_params.container_expiration_policy_attributesObjectObject that contains information on the container expiration policy
override_params.container_expiration_policy_attributes.cadenceStringContainer expiration policy cadence for recurring job
override_params.container_expiration_policy_attributes.enabledBooleanFlag indication if container expiration policy is enabled
override_params.container_expiration_policy_attributes.keep_nIntegerContainer expiration policy number of images to keep
override_params.container_expiration_policy_attributes.name_regexStringContainer expiration policy regex for image removal
override_params.container_expiration_policy_attributes.name_regex_keepStringContainer expiration policy regex for image retention
override_params.container_expiration_policy_attributes.older_thanStringContainer expiration policy remove images older than value
override_params.container_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled
override_params.container_registry_enabledBooleanDeprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project
override_params.descriptionStringThe description of the project
override_params.emails_disabledBooleanDeprecated: Use emails_enabled instead
override_params.emails_enabledBooleanEnable email notifications
override_params.enforce_auth_checks_on_uploadsBooleanEnforce auth check on uploads
override_params.environments_access_levelStringEnvironments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.feature_flags_access_levelStringFeature flags access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.forking_access_levelStringForks access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.group_runners_enabledBooleanFlag indication if group runners are enabled for that project
override_params.infrastructure_access_levelStringInfrastructure access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issue_branch_templateStringTemplate used to create a branch from an issue
override_params.issues_access_levelStringIssues access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issues_enabledBooleanFlag indication if the issue tracker is enabled
override_params.jobs_enabledBooleanFlag indication if jobs are enabled
override_params.lfs_enabledBooleanFlag indication if Git LFS is enabled for that project
override_params.merge_commit_templateStringTemplate used to create merge commit message
override_params.merge_methodStringThe merge method used when merging merge requests
Allowed values: ff, rebase_merge, merge
override_params.merge_requests_access_levelStringMerge requests access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.merge_requests_enabledBooleanFlag indication if merge requests are enabled
override_params.model_experiments_access_levelStringModel experiments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.model_registry_access_levelStringModel registry access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.monitor_access_levelStringMonitor access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.mr_default_target_selfBooleanMerge requests of this forked project targets itself by default
override_params.mr_default_title_templateStringTemplate used to generate the default merge request title. Maximum 100 characters
Maximum length: 100
override_params.only_allow_merge_if_all_discussions_are_resolvedBooleanOnly allow to merge if all threads are resolved
override_params.only_allow_merge_if_pipeline_succeedsBooleanOnly allow to merge if builds succeed
override_params.package_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled, public
override_params.packages_enabledBooleanDeprecated: Use :package_registry_access_level instead. Enable project packages feature
override_params.pages_access_levelStringPages access level. One of disabled, private, enabled or public
Allowed values: disabled, private, enabled, public
override_params.printing_merge_request_link_enabledBooleanShow link to create/view merge request when pushing from the command line
override_params.public_buildsBooleanDeprecated: Use public_jobs instead
override_params.public_jobsBooleanPerform public builds
override_params.releases_access_levelStringReleases access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.remove_source_branch_after_mergeBooleanRemove the source branch by default after merge
override_params.repository_access_levelStringRepository access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.repository_storageStringWhich storage shard the repository is on. Available only to admins
override_params.request_access_enabledBooleanAllow users to request member access
override_params.resolve_outdated_diff_discussionsBooleanAutomatically resolve merge request diff threads on lines changed with a push
override_params.resource_group_default_process_modeStringThe process mode of the resource group
Allowed values: unordered, oldest_first, newest_first, newest_ready_first
override_params.security_and_compliance_access_levelStringSecurity and compliance access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.service_desk_enabledBooleanDisable or enable the service desk
override_params.shared_runners_enabledBooleanFlag indication if shared runners are enabled for that project
override_params.show_default_award_emojisBooleanShow default award emojis
override_params.show_diff_preview_in_emailBooleanInclude the code diff preview in merge request notification emails
override_params.snippets_access_levelStringSnippets access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.snippets_enabledBooleanFlag indication if snippets are enabled
override_params.squash_commit_templateStringTemplate used to create squash commit message
override_params.squash_optionStringSquash default for project. One of never, always, default_on, or default_off
Allowed values: never, always, default_on, default_off
override_params.suggestion_commit_messageStringThe commit message used to apply merge request suggestions
override_params.tag_listArray of stringsDeprecated: Use :topics instead
override_params.topicsArray of stringsThe list of topics for a project
override_params.visibilityStringThe visibility of the project
Allowed values: private, internal, public
override_params.warn_about_potentially_unwanted_charactersBooleanWarn about potentially unwanted characters
override_params.wiki_access_levelStringWiki access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.wiki_enabledBooleanFlag indication if the wiki is enabled
overwriteBooleanIf there is a project in the same namespace and with the same name overwrite it
Default: false
path
Required
StringThe new project path and name

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Import project resources

POST /api/v4/projects/import-relation

Imports project resources included with a project archive. The type of item to import is controlled by the relation attribute. Skips items that were previously imported. This feature was introduced in GitLab 16.11.

Request body (multipart/form-data)

PropertyTypeDescription
file
Required
String (binary)The project export file from which to extract the relation
file.etagStringEtag of the file (generated by Workhorse)
file.md5StringMD5 checksum of the file (generated by Workhorse)
file.nameStringReal filename as sent in Content-Disposition (generated by Workhorse)
file.pathStringPath to locally stored body (generated by Workhorse)
file.remote_idStringRemote_id of the file (generated by Workhorse)
file.remote_urlStringRemote_url of the file (generated by Workhorse)
file.sha1StringSHA1 checksum of the file (generated by Workhorse)
file.sha256StringSHA256 checksum of the file (generated by Workhorse)
file.sizeIntegerReal size of file (generated by Workhorse)
file.typeStringReal content type as send in Content-Type (generated by Workhorse)
path
Required
StringThe project path and name
relation
Required
StringThe relation to import. Must be one of issues, merge_requests, ci_pipelines, or milestones

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesRelationImportTracker
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Authorize project relation import

POST /api/v4/projects/import-relation/authorize

Authorizes uploading a project relation import file. This feature was introduced in GitLab 16.11.

Responses

CodeDescriptionSchema
201Created—
400Bad Request—

Workhorse authorize the project import upload

POST /api/v4/projects/import/authorize

This feature was introduced in GitLab 12.9

Responses

CodeDescriptionSchema
201Created—
400Bad Request—

Import a project from a remote archive

POST /api/v4/projects/remote-import

Imports a project from a remote archive.

Request body (multipart/form-data)

PropertyTypeDescription
nameStringThe name of the project to be imported. Defaults to the path of the project if not provided
namespaceString(deprecated) The ID or path of the namespace to import the project to. Defaults to the current user’s namespace. Mutually exclusive with namespace_id, namespace_path
namespace_idIntegerThe ID of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_path
Example: 1
namespace_pathStringThe path of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_id
Example: new_path/gitlab
override_paramsObjectNew project params to override values in the export
override_params.allow_merge_on_skipped_pipelineBooleanAllow to merge if pipeline is skipped
override_params.analytics_access_levelStringAnalytics access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.auto_cancel_pending_pipelinesStringAuto-cancel pending pipelines
Allowed values: disabled, enabled
override_params.auto_devops_deploy_strategyStringAuto Deploy strategy
Allowed values: continuous, manual, timed_incremental
override_params.auto_devops_enabledBooleanFlag indication if Auto DevOps is enabled
override_params.autoclose_referenced_issuesBooleanFlag indication if referenced issues auto-closing is enabled
override_params.avatarString (binary)Avatar image for project
override_params.build_git_strategyStringThe Git strategy. Defaults to fetch
Allowed values: fetch, clone
override_params.build_timeoutIntegerBuild timeout
override_params.builds_access_levelStringBuilds access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.ci_config_pathStringThe path to CI config file. Defaults to .gitlab-ci.yml
override_params.cicd_catalog_enabledBooleanSet whether the project is a CI/CD catalog project
override_params.container_expiration_policy_attributesObjectObject that contains information on the container expiration policy
override_params.container_expiration_policy_attributes.cadenceStringContainer expiration policy cadence for recurring job
override_params.container_expiration_policy_attributes.enabledBooleanFlag indication if container expiration policy is enabled
override_params.container_expiration_policy_attributes.keep_nIntegerContainer expiration policy number of images to keep
override_params.container_expiration_policy_attributes.name_regexStringContainer expiration policy regex for image removal
override_params.container_expiration_policy_attributes.name_regex_keepStringContainer expiration policy regex for image retention
override_params.container_expiration_policy_attributes.older_thanStringContainer expiration policy remove images older than value
override_params.container_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled
override_params.container_registry_enabledBooleanDeprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project
override_params.descriptionStringThe description of the project
override_params.emails_disabledBooleanDeprecated: Use emails_enabled instead
override_params.emails_enabledBooleanEnable email notifications
override_params.enforce_auth_checks_on_uploadsBooleanEnforce auth check on uploads
override_params.environments_access_levelStringEnvironments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.feature_flags_access_levelStringFeature flags access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.forking_access_levelStringForks access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.group_runners_enabledBooleanFlag indication if group runners are enabled for that project
override_params.infrastructure_access_levelStringInfrastructure access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issue_branch_templateStringTemplate used to create a branch from an issue
override_params.issues_access_levelStringIssues access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issues_enabledBooleanFlag indication if the issue tracker is enabled
override_params.jobs_enabledBooleanFlag indication if jobs are enabled
override_params.lfs_enabledBooleanFlag indication if Git LFS is enabled for that project
override_params.merge_commit_templateStringTemplate used to create merge commit message
override_params.merge_methodStringThe merge method used when merging merge requests
Allowed values: ff, rebase_merge, merge
override_params.merge_requests_access_levelStringMerge requests access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.merge_requests_enabledBooleanFlag indication if merge requests are enabled
override_params.model_experiments_access_levelStringModel experiments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.model_registry_access_levelStringModel registry access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.monitor_access_levelStringMonitor access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.mr_default_target_selfBooleanMerge requests of this forked project targets itself by default
override_params.mr_default_title_templateStringTemplate used to generate the default merge request title. Maximum 100 characters
Maximum length: 100
override_params.only_allow_merge_if_all_discussions_are_resolvedBooleanOnly allow to merge if all threads are resolved
override_params.only_allow_merge_if_pipeline_succeedsBooleanOnly allow to merge if builds succeed
override_params.package_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled, public
override_params.packages_enabledBooleanDeprecated: Use :package_registry_access_level instead. Enable project packages feature
override_params.pages_access_levelStringPages access level. One of disabled, private, enabled or public
Allowed values: disabled, private, enabled, public
override_params.printing_merge_request_link_enabledBooleanShow link to create/view merge request when pushing from the command line
override_params.public_buildsBooleanDeprecated: Use public_jobs instead
override_params.public_jobsBooleanPerform public builds
override_params.releases_access_levelStringReleases access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.remove_source_branch_after_mergeBooleanRemove the source branch by default after merge
override_params.repository_access_levelStringRepository access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.repository_storageStringWhich storage shard the repository is on. Available only to admins
override_params.request_access_enabledBooleanAllow users to request member access
override_params.resolve_outdated_diff_discussionsBooleanAutomatically resolve merge request diff threads on lines changed with a push
override_params.resource_group_default_process_modeStringThe process mode of the resource group
Allowed values: unordered, oldest_first, newest_first, newest_ready_first
override_params.security_and_compliance_access_levelStringSecurity and compliance access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.service_desk_enabledBooleanDisable or enable the service desk
override_params.shared_runners_enabledBooleanFlag indication if shared runners are enabled for that project
override_params.show_default_award_emojisBooleanShow default award emojis
override_params.show_diff_preview_in_emailBooleanInclude the code diff preview in merge request notification emails
override_params.snippets_access_levelStringSnippets access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.snippets_enabledBooleanFlag indication if snippets are enabled
override_params.squash_commit_templateStringTemplate used to create squash commit message
override_params.squash_optionStringSquash default for project. One of never, always, default_on, or default_off
Allowed values: never, always, default_on, default_off
override_params.suggestion_commit_messageStringThe commit message used to apply merge request suggestions
override_params.tag_listArray of stringsDeprecated: Use :topics instead
override_params.topicsArray of stringsThe list of topics for a project
override_params.visibilityStringThe visibility of the project
Allowed values: private, internal, public
override_params.warn_about_potentially_unwanted_charactersBooleanWarn about potentially unwanted characters
override_params.wiki_access_levelStringWiki access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.wiki_enabledBooleanFlag indication if the wiki is enabled
overwriteBooleanIf there is a project in the same namespace and with the same name overwrite it
Default: false
path
Required
StringThe new project path and name
url
Required
StringThe URL for the file

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too many requests—
503Service unavailable—

Import a project from an AWS S3 bucket

POST /api/v4/projects/remote-import-s3

Imports a project from an archive stored in a specified AWS S3 bucket.

Request body (multipart/form-data)

PropertyTypeDescription
access_key_id
Required
StringAccess key id
bucket_name
Required
StringBucket name
file_key
Required
StringFile key
nameStringThe name of the project to be imported. Defaults to the path of the project if not provided
namespaceString(deprecated) The ID or path of the namespace to import the project to. Defaults to the current user’s namespace. Mutually exclusive with namespace_id, namespace_path
namespace_idIntegerThe ID of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_path
Example: 1
namespace_pathStringThe path of the namespace that the project will be imported into. Defaults to the current user’s namespace. Mutually exclusive with namespace, namespace_id
Example: new_path/gitlab
override_paramsObjectNew project params to override values in the export
override_params.allow_merge_on_skipped_pipelineBooleanAllow to merge if pipeline is skipped
override_params.analytics_access_levelStringAnalytics access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.auto_cancel_pending_pipelinesStringAuto-cancel pending pipelines
Allowed values: disabled, enabled
override_params.auto_devops_deploy_strategyStringAuto Deploy strategy
Allowed values: continuous, manual, timed_incremental
override_params.auto_devops_enabledBooleanFlag indication if Auto DevOps is enabled
override_params.autoclose_referenced_issuesBooleanFlag indication if referenced issues auto-closing is enabled
override_params.avatarString (binary)Avatar image for project
override_params.build_git_strategyStringThe Git strategy. Defaults to fetch
Allowed values: fetch, clone
override_params.build_timeoutIntegerBuild timeout
override_params.builds_access_levelStringBuilds access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.ci_config_pathStringThe path to CI config file. Defaults to .gitlab-ci.yml
override_params.cicd_catalog_enabledBooleanSet whether the project is a CI/CD catalog project
override_params.container_expiration_policy_attributesObjectObject that contains information on the container expiration policy
override_params.container_expiration_policy_attributes.cadenceStringContainer expiration policy cadence for recurring job
override_params.container_expiration_policy_attributes.enabledBooleanFlag indication if container expiration policy is enabled
override_params.container_expiration_policy_attributes.keep_nIntegerContainer expiration policy number of images to keep
override_params.container_expiration_policy_attributes.name_regexStringContainer expiration policy regex for image removal
override_params.container_expiration_policy_attributes.name_regex_keepStringContainer expiration policy regex for image retention
override_params.container_expiration_policy_attributes.older_thanStringContainer expiration policy remove images older than value
override_params.container_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled
override_params.container_registry_enabledBooleanDeprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project
override_params.descriptionStringThe description of the project
override_params.emails_disabledBooleanDeprecated: Use emails_enabled instead
override_params.emails_enabledBooleanEnable email notifications
override_params.enforce_auth_checks_on_uploadsBooleanEnforce auth check on uploads
override_params.environments_access_levelStringEnvironments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.feature_flags_access_levelStringFeature flags access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.forking_access_levelStringForks access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.group_runners_enabledBooleanFlag indication if group runners are enabled for that project
override_params.infrastructure_access_levelStringInfrastructure access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issue_branch_templateStringTemplate used to create a branch from an issue
override_params.issues_access_levelStringIssues access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.issues_enabledBooleanFlag indication if the issue tracker is enabled
override_params.jobs_enabledBooleanFlag indication if jobs are enabled
override_params.lfs_enabledBooleanFlag indication if Git LFS is enabled for that project
override_params.merge_commit_templateStringTemplate used to create merge commit message
override_params.merge_methodStringThe merge method used when merging merge requests
Allowed values: ff, rebase_merge, merge
override_params.merge_requests_access_levelStringMerge requests access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.merge_requests_enabledBooleanFlag indication if merge requests are enabled
override_params.model_experiments_access_levelStringModel experiments access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.model_registry_access_levelStringModel registry access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.monitor_access_levelStringMonitor access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.mr_default_target_selfBooleanMerge requests of this forked project targets itself by default
override_params.mr_default_title_templateStringTemplate used to generate the default merge request title. Maximum 100 characters
Maximum length: 100
override_params.only_allow_merge_if_all_discussions_are_resolvedBooleanOnly allow to merge if all threads are resolved
override_params.only_allow_merge_if_pipeline_succeedsBooleanOnly allow to merge if builds succeed
override_params.package_registry_access_levelStringControls 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
Allowed values: disabled, private, enabled, public
override_params.packages_enabledBooleanDeprecated: Use :package_registry_access_level instead. Enable project packages feature
override_params.pages_access_levelStringPages access level. One of disabled, private, enabled or public
Allowed values: disabled, private, enabled, public
override_params.printing_merge_request_link_enabledBooleanShow link to create/view merge request when pushing from the command line
override_params.public_buildsBooleanDeprecated: Use public_jobs instead
override_params.public_jobsBooleanPerform public builds
override_params.releases_access_levelStringReleases access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.remove_source_branch_after_mergeBooleanRemove the source branch by default after merge
override_params.repository_access_levelStringRepository access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.repository_storageStringWhich storage shard the repository is on. Available only to admins
override_params.request_access_enabledBooleanAllow users to request member access
override_params.resolve_outdated_diff_discussionsBooleanAutomatically resolve merge request diff threads on lines changed with a push
override_params.resource_group_default_process_modeStringThe process mode of the resource group
Allowed values: unordered, oldest_first, newest_first, newest_ready_first
override_params.security_and_compliance_access_levelStringSecurity and compliance access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.service_desk_enabledBooleanDisable or enable the service desk
override_params.shared_runners_enabledBooleanFlag indication if shared runners are enabled for that project
override_params.show_default_award_emojisBooleanShow default award emojis
override_params.show_diff_preview_in_emailBooleanInclude the code diff preview in merge request notification emails
override_params.snippets_access_levelStringSnippets access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.snippets_enabledBooleanFlag indication if snippets are enabled
override_params.squash_commit_templateStringTemplate used to create squash commit message
override_params.squash_optionStringSquash default for project. One of never, always, default_on, or default_off
Allowed values: never, always, default_on, default_off
override_params.suggestion_commit_messageStringThe commit message used to apply merge request suggestions
override_params.tag_listArray of stringsDeprecated: Use :topics instead
override_params.topicsArray of stringsThe list of topics for a project
override_params.visibilityStringThe visibility of the project
Allowed values: private, internal, public
override_params.warn_about_potentially_unwanted_charactersBooleanWarn about potentially unwanted characters
override_params.wiki_access_levelStringWiki access level. One of disabled, private or enabled
Allowed values: disabled, private, enabled
override_params.wiki_enabledBooleanFlag indication if the wiki is enabled
overwriteBooleanIf there is a project in the same namespace and with the same name overwrite it
Default: false
path
Required
StringThe new project path and name
region
Required
StringAWS region
secret_access_key
Required
StringSecret access key

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too many requests—
503Service unavailable—

Retrieve the status of a project export

GET /api/v4/projects/{id}/export

Retrieves the status of the most recent export for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectExportStatus
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Export a project

POST /api/v4/projects/{id}/export

Exports a project. Use the upload hash parameter to upload the exported project to a web server or any S3-compatible platform.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
descriptionStringOverride the project description
excluded_relationsArray of stringsList of project relation names to exclude from the export (e.g. [“merge_requests”, “issues”])
uploadObjectObject that contains information on the upload
upload.http_methodStringHTTP method to upload the exported project
Allowed values: PUT, POST
Default: PUT
upload.urlStringThe URL to upload the project

Responses

CodeDescriptionSchema
202Accepted—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
429Too many requests—
503Service unavailable—

Download a project export

GET /api/v4/projects/{id}/export/download

Downloads the most recent export of a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Schedule a relations export for a project

POST /api/v4/projects/{id}/export_relations

Schedules a relations export for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
batchedBooleanWhether to export in batches

Responses

CodeDescriptionSchema
202Accepted—
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Download a relations export for a project

GET /api/v4/projects/{id}/export_relations/download

Downloads a project relations export file.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
relation
Query, required
StringProject relation name
batched
Query
BooleanWhether to download in batches
batch_number
Query
IntegerBatch number to download

Responses

CodeDescriptionSchema
200OKString (binary) (application/gzip)
String (binary) (application/octet-stream)
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
500Internal Server Error—
503Service unavailable—

Retrieve the status of an relations export for a project

GET /api/v4/projects/{id}/export_relations/status

Retrieves the status of a relations export for a project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project
relation
Query
StringProject relation name

Responses

CodeDescriptionSchema
200OKAPIEntitiesBulkImportsExportStatus
400Bad Request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Retrieve the status of a project import

GET /api/v4/projects/{id}/import

Retrieves the status of the most recent import for a specified project.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Import a project from a Git URL

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

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

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Request body (application/json)

PropertyTypeDescription
import_url
Required
StringThe URL from which the project is imported
import_url_passwordStringPassword for the import URL
import_url_userStringUsername for the import URL

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
409Conflict—
422Unprocessable Entity—

Retrieve the status of a project resource import

GET /api/v4/projects/{id}/relation-imports

Retrieves the status of the most recent relation import for a specified project. Because only one relation import can be scheduled at a time, you can use this endpoint to check whether the previous import completed successfully. This feature was introduced in GitLab 16.11.

Parameters

NameTypeDescription
id
Path, required
String or integerThe ID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKAPIEntitiesProjectImportStatus
400Bad request—
401Unauthorized—
403Forbidden—
404Not found—
503Service unavailable—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesBulkImportsExportBatchStatus

PropertyTypeDescription
batch_numberIntegerExample: 1
errorStringExample: Error message
objects_countIntegerExample: 100
statusStringAllowed values: started, finished, failed
Example: started
updated_atString (date-time)Example: 2012-05-28T04:42:42-07:00

APIEntitiesBulkImportsExportStatus

PropertyTypeDescription
batchedBooleanExample: true
batchesAPIEntitiesBulkImportsExportBatchStatus—
batches_countIntegerExample: 2
errorStringExample: Error message
relationStringExample: issues
statusStringAllowed values: pending, started, finished, failed
Example: started
total_objects_countIntegerExample: 100
updated_atString (date-time)Example: 2012-05-28T04:42:42-07:00

APIEntitiesProjectExportStatus

PropertyTypeDescription
_linksObject—
_links.api_urlStringExample: https://gitlab.example.com/api/v4/projects/1/export/download
_links.web_urlStringExample: https://gitlab.example.com/gitlab-org/gitlab-test/download_export
created_atString (date-time)Example: 2020-05-07T04:27:17.016Z
descriptionStringExample: desc
export_statusStringAllowed values: queued, started, finished, failed
Example: finished
idInteger (int64)Example: 1
nameStringExample: project1
name_with_namespaceStringExample: John Doe / project1
pathStringExample: project1
path_with_namespaceStringExample: namespace1/project1

APIEntitiesProjectImportFailedRelation

PropertyTypeDescription
created_atString (date-time)Example: 2012-05-28T04:42:42-07:00
exception_classStringExample: StandardError
exception_messageString—
idInteger (int64)Example: 1
line_numberIntegerExample: 1
relation_nameStringExample: issues
sourceStringExample: ImportRepositoryWorker

APIEntitiesProjectImportStatus

PropertyTypeDescription
correlation_idStringExample: dfcf583058ed4508e4c7c617bd7f0edd
created_atString (date-time)Example: 2020-05-07T04:27:17.016Z
descriptionStringExample: desc
failed_relationsArray of APIEntitiesProjectImportFailedRelation—
idInteger (int64)Example: 1
import_errorStringExample: Error message
import_statusStringExample: scheduled
import_typeStringExample: gitlab_project
nameStringExample: project1
name_with_namespaceStringExample: John Doe / project1
pathStringExample: project1
path_with_namespaceStringExample: namespace1/project1
statsObject—

APIEntitiesRelationImportTracker

PropertyTypeDescription
created_atString (date-time)Example: 2022-01-31T15:10:45.080Z
idInteger (int64)Example: 1
project_pathStringExample: namespace1/project1
relationStringExample: issues
statusStringExample: pending
updated_atString (date-time)Example: 2022-01-31T15:10:45.080Z

ProjectEntity

PropertyTypeDescription
forkedBooleanExample: true
full_nameStringExample: GitLab Org / GitLab
full_pathStringExample: gitlab-org/gitlab
idIntegerExample: 1
nameStringExample: GitLab
refs_urlString—

ProjectImportEntity

PropertyTypeDescription
forkedBooleanExample: true
full_nameStringExample: GitLab Org / GitLab
full_pathStringExample: gitlab-org/gitlab
human_import_status_nameStringExample: canceled
idIntegerExample: 1
import_errorString—
import_sourceStringExample: source/source-repo
import_statusStringAllowed values: scheduled, started, finished, failed, canceled
Example: scheduled
import_warningString—
nameStringExample: GitLab
provider_linkStringExample: /source/source-repo
refs_urlString—
relation_typeString—