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)
| Property | Type | Description |
|---|---|---|
bitbucket_Required | String | Bit |
bitbucket_Required | String | Bit |
new_ | String | New repository name |
repo_Required | String | Repository path |
target_Required | String | Target namespace |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | Project |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
422 | Unprocessable entity | — |
503 | Service 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)
| Property | Type | Description |
|---|---|---|
bitbucket_Required | String | Bit |
bitbucket_Required | String | Bit |
bitbucket_Required | String | Bitbucket Server URL |
bitbucket_Required | String | Bit |
new_ | String | New repo name |
new_ | String | Namespace to import repo into |
personal_Required | String | Bit |
timeout_ | String | Strategy for behavior on timeouts Allowed values: optimistic,pessimistic |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | Project |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
422 | Unprocessable entity | — |
503 | Service unavailable | — |
Import a repository from GitHub
POST /api/v4/import/github
Imports a repository from GitHub to GitLab.
Request body (application/json)
| Property | Type | Description |
|---|---|---|
github_ | String | Custom Git/ |
new_ | String | New repo name |
optional_ | Object | Optional stages of import to be performed |
pagination_ | Integer | Pagination limit Maximum: 100Minimum: 1 |
personal_Required | String | Git |
repo_Required | Integer | Git |
target_Required | String | Namespace or group to import repository into |
timeout_ | String | Strategy for behavior on timeouts Allowed values: optimistic,pessimistic |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | Project |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
422 | Unprocessable entity | — |
503 | Service 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)
| Property | Type | Description |
|---|---|---|
project_Required | Integer | ID of importing project to be canceled |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Project |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The project export file to be imported |
file. | String | Etag of the file (generated by Workhorse) |
file. | String | MD5 checksum of the file (generated by Workhorse) |
file. | String | Real filename as send in Content- |
file. | String | Path to locally stored body (generated by Workhorse) |
file. | String | Remote_ |
file. | String | Remote_ |
file. | String | SHA1 checksum of the file (generated by Workhorse) |
file. | String | SHA256 checksum of the file (generated by Workhorse) |
file. | Integer | Real size of file (generated by Workhorse) |
file. | String | Real content type as send in Content- |
name | String | The name of the project to be imported. |
namespace | String | (deprecated) The ID or path of the namespace to import the project to.namespace_,namespace_ |
namespace_ | Integer | The ID of the namespace that the project will be imported into.namespace,namespace_Example: 1 |
namespace_ | String | The path of the namespace that the project will be imported into.namespace,namespace_Example: new_ |
override_ | Object | New project params to override values in the export |
override_ | Boolean | Allow to merge if pipeline is skipped |
override_ | String | Analytics access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Auto- Allowed values: disabled,enabled |
override_ | String | Auto Deploy strategy Allowed values: continuous,manual,timed_ |
override_ | Boolean | Flag indication if Auto Dev |
override_ | Boolean | Flag indication if referenced issues auto- |
override_ | String (binary) | Avatar image for project |
override_ | String | The Git strategy.fetchAllowed values: fetch,clone |
override_ | Integer | Build timeout |
override_ | String | Builds access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | The path to CI config file.. |
override_ | Boolean | Set whether the project is a CI/ |
override_ | Object | Object that contains information on the container expiration policy |
override_ | String | Container expiration policy cadence for recurring job |
override_ | Boolean | Flag indication if container expiration policy is enabled |
override_ | Integer | Container expiration policy number of images to keep |
override_ | String | Container expiration policy regex for image removal |
override_ | String | Container expiration policy regex for image retention |
override_ | String | Container expiration policy remove images older than value |
override_ | String | Controls visibility of the container registry.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 registryAllowed values: disabled,private,enabled |
override_ | Boolean | Deprecated: |
override_ | String | The description of the project |
override_ | Boolean | Deprecated: |
override_ | Boolean | Enable email notifications |
override_ | Boolean | Enforce auth check on uploads |
override_ | String | Environments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Feature flags access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Forks access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if group runners are enabled for that project |
override_ | String | Infrastructure access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Template used to create a branch from an issue |
override_ | String | Issues access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the issue tracker is enabled |
override_ | Boolean | Flag indication if jobs are enabled |
override_ | Boolean | Flag indication if Git LFS is enabled for that project |
override_ | String | Template used to create merge commit message |
override_ | String | The merge method used when merging merge requests Allowed values: ff,rebase_,merge |
override_ | String | Merge requests access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if merge requests are enabled |
override_ | String | Model experiments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Model registry access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Monitor access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Merge requests of this forked project targets itself by default |
override_ | String | Template used to generate the default merge request title. Maximum length: 100 |
override_ | Boolean | Only allow to merge if all threads are resolved |
override_ | Boolean | Only allow to merge if builds succeed |
override_ | String | Controls visibility of the package registry.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 registryAllowed values: disabled,private,enabled,public |
override_ | Boolean | Deprecated: |
override_ | String | Pages access level.disabled,private,enabled or publicAllowed values: disabled,private,enabled,public |
override_ | Boolean | Show link to create/ |
override_ | Boolean | Deprecated: |
override_ | Boolean | Perform public builds |
override_ | String | Releases access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Remove the source branch by default after merge |
override_ | String | Repository access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Which storage shard the repository is on. |
override_ | Boolean | Allow users to request member access |
override_ | Boolean | Automatically resolve merge request diff threads on lines changed with a push |
override_ | String | The process mode of the resource group Allowed values: unordered,oldest_,newest_,newest_ |
override_ | String | Security and compliance access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Disable or enable the service desk |
override_ | Boolean | Flag indication if shared runners are enabled for that project |
override_ | Boolean | Show default award emojis |
override_ | Boolean | Include the code diff preview in merge request notification emails |
override_ | String | Snippets access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if snippets are enabled |
override_ | String | Template used to create squash commit message |
override_ | String | Squash default for project.never,always,default_,default_Allowed values: never,always,default_,default_ |
override_ | String | The commit message used to apply merge request suggestions |
override_ | Array of strings | Deprecated: |
override_ | Array of strings | The list of topics for a project |
override_ | String | The visibility of the project Allowed values: private,internal,public |
override_ | Boolean | Warn about potentially unwanted characters |
override_ | String | Wiki access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the wiki is enabled |
overwrite | Boolean | If there is a project in the same namespace and with the same name overwrite it Default: false |
pathRequired | String | The new project path and name |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The project export file from which to extract the relation |
file. | String | Etag of the file (generated by Workhorse) |
file. | String | MD5 checksum of the file (generated by Workhorse) |
file. | String | Real filename as sent in Content- |
file. | String | Path to locally stored body (generated by Workhorse) |
file. | String | Remote_ |
file. | String | Remote_ |
file. | String | SHA1 checksum of the file (generated by Workhorse) |
file. | String | SHA256 checksum of the file (generated by Workhorse) |
file. | Integer | Real size of file (generated by Workhorse) |
file. | String | Real content type as send in Content- |
pathRequired | String | The project path and name |
relationRequired | String | The relation to import. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
Workhorse authorize the project import upload
POST /api/v4/projects/import/authorize
This feature was introduced in GitLab 12.9
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad 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)
| Property | Type | Description |
|---|---|---|
name | String | The name of the project to be imported. |
namespace | String | (deprecated) The ID or path of the namespace to import the project to.namespace_,namespace_ |
namespace_ | Integer | The ID of the namespace that the project will be imported into.namespace,namespace_Example: 1 |
namespace_ | String | The path of the namespace that the project will be imported into.namespace,namespace_Example: new_ |
override_ | Object | New project params to override values in the export |
override_ | Boolean | Allow to merge if pipeline is skipped |
override_ | String | Analytics access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Auto- Allowed values: disabled,enabled |
override_ | String | Auto Deploy strategy Allowed values: continuous,manual,timed_ |
override_ | Boolean | Flag indication if Auto Dev |
override_ | Boolean | Flag indication if referenced issues auto- |
override_ | String (binary) | Avatar image for project |
override_ | String | The Git strategy.fetchAllowed values: fetch,clone |
override_ | Integer | Build timeout |
override_ | String | Builds access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | The path to CI config file.. |
override_ | Boolean | Set whether the project is a CI/ |
override_ | Object | Object that contains information on the container expiration policy |
override_ | String | Container expiration policy cadence for recurring job |
override_ | Boolean | Flag indication if container expiration policy is enabled |
override_ | Integer | Container expiration policy number of images to keep |
override_ | String | Container expiration policy regex for image removal |
override_ | String | Container expiration policy regex for image retention |
override_ | String | Container expiration policy remove images older than value |
override_ | String | Controls visibility of the container registry.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 registryAllowed values: disabled,private,enabled |
override_ | Boolean | Deprecated: |
override_ | String | The description of the project |
override_ | Boolean | Deprecated: |
override_ | Boolean | Enable email notifications |
override_ | Boolean | Enforce auth check on uploads |
override_ | String | Environments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Feature flags access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Forks access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if group runners are enabled for that project |
override_ | String | Infrastructure access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Template used to create a branch from an issue |
override_ | String | Issues access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the issue tracker is enabled |
override_ | Boolean | Flag indication if jobs are enabled |
override_ | Boolean | Flag indication if Git LFS is enabled for that project |
override_ | String | Template used to create merge commit message |
override_ | String | The merge method used when merging merge requests Allowed values: ff,rebase_,merge |
override_ | String | Merge requests access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if merge requests are enabled |
override_ | String | Model experiments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Model registry access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Monitor access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Merge requests of this forked project targets itself by default |
override_ | String | Template used to generate the default merge request title. Maximum length: 100 |
override_ | Boolean | Only allow to merge if all threads are resolved |
override_ | Boolean | Only allow to merge if builds succeed |
override_ | String | Controls visibility of the package registry.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 registryAllowed values: disabled,private,enabled,public |
override_ | Boolean | Deprecated: |
override_ | String | Pages access level.disabled,private,enabled or publicAllowed values: disabled,private,enabled,public |
override_ | Boolean | Show link to create/ |
override_ | Boolean | Deprecated: |
override_ | Boolean | Perform public builds |
override_ | String | Releases access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Remove the source branch by default after merge |
override_ | String | Repository access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Which storage shard the repository is on. |
override_ | Boolean | Allow users to request member access |
override_ | Boolean | Automatically resolve merge request diff threads on lines changed with a push |
override_ | String | The process mode of the resource group Allowed values: unordered,oldest_,newest_,newest_ |
override_ | String | Security and compliance access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Disable or enable the service desk |
override_ | Boolean | Flag indication if shared runners are enabled for that project |
override_ | Boolean | Show default award emojis |
override_ | Boolean | Include the code diff preview in merge request notification emails |
override_ | String | Snippets access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if snippets are enabled |
override_ | String | Template used to create squash commit message |
override_ | String | Squash default for project.never,always,default_,default_Allowed values: never,always,default_,default_ |
override_ | String | The commit message used to apply merge request suggestions |
override_ | Array of strings | Deprecated: |
override_ | Array of strings | The list of topics for a project |
override_ | String | The visibility of the project Allowed values: private,internal,public |
override_ | Boolean | Warn about potentially unwanted characters |
override_ | String | Wiki access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the wiki is enabled |
overwrite | Boolean | If there is a project in the same namespace and with the same name overwrite it Default: false |
pathRequired | String | The new project path and name |
urlRequired | String | The URL for the file |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too many requests | — |
503 | Service 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)
| Property | Type | Description |
|---|---|---|
access_Required | String | Access key id |
bucket_Required | String | Bucket name |
file_Required | String | File key |
name | String | The name of the project to be imported. |
namespace | String | (deprecated) The ID or path of the namespace to import the project to.namespace_,namespace_ |
namespace_ | Integer | The ID of the namespace that the project will be imported into.namespace,namespace_Example: 1 |
namespace_ | String | The path of the namespace that the project will be imported into.namespace,namespace_Example: new_ |
override_ | Object | New project params to override values in the export |
override_ | Boolean | Allow to merge if pipeline is skipped |
override_ | String | Analytics access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Auto- Allowed values: disabled,enabled |
override_ | String | Auto Deploy strategy Allowed values: continuous,manual,timed_ |
override_ | Boolean | Flag indication if Auto Dev |
override_ | Boolean | Flag indication if referenced issues auto- |
override_ | String (binary) | Avatar image for project |
override_ | String | The Git strategy.fetchAllowed values: fetch,clone |
override_ | Integer | Build timeout |
override_ | String | Builds access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | The path to CI config file.. |
override_ | Boolean | Set whether the project is a CI/ |
override_ | Object | Object that contains information on the container expiration policy |
override_ | String | Container expiration policy cadence for recurring job |
override_ | Boolean | Flag indication if container expiration policy is enabled |
override_ | Integer | Container expiration policy number of images to keep |
override_ | String | Container expiration policy regex for image removal |
override_ | String | Container expiration policy regex for image retention |
override_ | String | Container expiration policy remove images older than value |
override_ | String | Controls visibility of the container registry.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 registryAllowed values: disabled,private,enabled |
override_ | Boolean | Deprecated: |
override_ | String | The description of the project |
override_ | Boolean | Deprecated: |
override_ | Boolean | Enable email notifications |
override_ | Boolean | Enforce auth check on uploads |
override_ | String | Environments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Feature flags access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Forks access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if group runners are enabled for that project |
override_ | String | Infrastructure access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Template used to create a branch from an issue |
override_ | String | Issues access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the issue tracker is enabled |
override_ | Boolean | Flag indication if jobs are enabled |
override_ | Boolean | Flag indication if Git LFS is enabled for that project |
override_ | String | Template used to create merge commit message |
override_ | String | The merge method used when merging merge requests Allowed values: ff,rebase_,merge |
override_ | String | Merge requests access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if merge requests are enabled |
override_ | String | Model experiments access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Model registry access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Monitor access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Merge requests of this forked project targets itself by default |
override_ | String | Template used to generate the default merge request title. Maximum length: 100 |
override_ | Boolean | Only allow to merge if all threads are resolved |
override_ | Boolean | Only allow to merge if builds succeed |
override_ | String | Controls visibility of the package registry.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 registryAllowed values: disabled,private,enabled,public |
override_ | Boolean | Deprecated: |
override_ | String | Pages access level.disabled,private,enabled or publicAllowed values: disabled,private,enabled,public |
override_ | Boolean | Show link to create/ |
override_ | Boolean | Deprecated: |
override_ | Boolean | Perform public builds |
override_ | String | Releases access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Remove the source branch by default after merge |
override_ | String | Repository access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | String | Which storage shard the repository is on. |
override_ | Boolean | Allow users to request member access |
override_ | Boolean | Automatically resolve merge request diff threads on lines changed with a push |
override_ | String | The process mode of the resource group Allowed values: unordered,oldest_,newest_,newest_ |
override_ | String | Security and compliance access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Disable or enable the service desk |
override_ | Boolean | Flag indication if shared runners are enabled for that project |
override_ | Boolean | Show default award emojis |
override_ | Boolean | Include the code diff preview in merge request notification emails |
override_ | String | Snippets access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if snippets are enabled |
override_ | String | Template used to create squash commit message |
override_ | String | Squash default for project.never,always,default_,default_Allowed values: never,always,default_,default_ |
override_ | String | The commit message used to apply merge request suggestions |
override_ | Array of strings | Deprecated: |
override_ | Array of strings | The list of topics for a project |
override_ | String | The visibility of the project Allowed values: private,internal,public |
override_ | Boolean | Warn about potentially unwanted characters |
override_ | String | Wiki access level.disabled,private or enabledAllowed values: disabled,private,enabled |
override_ | Boolean | Flag indication if the wiki is enabled |
overwrite | Boolean | If there is a project in the same namespace and with the same name overwrite it Default: false |
pathRequired | String | The new project path and name |
regionRequired | String | AWS region |
secret_Required | String | Secret access key |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too many requests | — |
503 | Service 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
description | String | Override the project description |
excluded_ | Array of strings | List of project relation names to exclude from the export (e. |
upload | Object | Object that contains information on the upload |
upload. | String | HTTP method to upload the exported project Allowed values: PUT,POSTDefault: PUT |
upload. | String | The URL to upload the project |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
429 | Too many requests | — |
503 | Service unavailable | — |
Download a project export
GET /api/v4/projects/{id}/export/download
Downloads the most recent export of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service unavailable | — |
Schedule a relations export for a project
POST /api/v4/projects/{id}/export_relations
Schedules a relations export for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
batched | Boolean | Whether to export in batches |
Responses
| Code | Description | Schema |
|---|---|---|
202 | Accepted | — |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service unavailable | — |
Download a relations export for a project
GET /api/v4/projects/{id}/export_relations/download
Downloads a project relations export file.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
relationQuery, | String | Project relation name |
batchedQuery | Boolean | Whether to download in batches |
batch_Query | Integer | Batch number to download |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/)String (binary) ( application/) |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
500 | Internal Server Error | — |
503 | Service 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
relationQuery | String | Project relation name |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
import_Required | String | The URL from which the project is imported |
import_ | String | Password for the import URL |
import_ | String | Username for the import URL |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
409 | Conflict | — |
422 | Unprocessable 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
503 | Service unavailable | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesBulkImportsExportBatchStatus
| Property | Type | Description |
|---|---|---|
batch_ | Integer | Example:1 |
error | String | Example:Error message |
objects_ | Integer | Example:100 |
status | String | Allowed values:started,finished,failedExample: started |
updated_ | String (date- | Example:2012- |
APIEntitiesBulkImportsExportStatus
| Property | Type | Description |
|---|---|---|
batched | Boolean | Example:true |
batches | APIEntities | — |
batches_ | Integer | Example:2 |
error | String | Example:Error message |
relation | String | Example:issues |
status | String | Allowed values:pending,started,finished,failedExample: started |
total_ | Integer | Example:100 |
updated_ | String (date- | Example:2012- |
APIEntitiesProjectExportStatus
| Property | Type | Description |
|---|---|---|
_ | Object | — |
_ | String | Example:https: |
_ | String | Example:https: |
created_ | String (date- | Example:2020- |
description | String | Example:desc |
export_ | String | Allowed values:queued,started,finished,failedExample: finished |
id | Integer (int64) | Example:1 |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
APIEntitiesProjectImportFailedRelation
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2012- |
exception_ | String | Example:Standard |
exception_ | String | — |
id | Integer (int64) | Example:1 |
line_ | Integer | Example:1 |
relation_ | String | Example:issues |
source | String | Example:Import |
APIEntitiesProjectImportStatus
| Property | Type | Description |
|---|---|---|
correlation_ | String | Example:dfcf583058ed4508e4c7 |
created_ | String (date- | Example:2020- |
description | String | Example:desc |
failed_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
import_ | String | Example:Error message |
import_ | String | Example:scheduled |
import_ | String | Example:gitlab_ |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
stats | Object | — |
APIEntitiesRelationImportTracker
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2022- |
id | Integer (int64) | Example:1 |
project_ | String | Example:namespace1/ |
relation | String | Example:issues |
status | String | Example:pending |
updated_ | String (date- | Example:2022- |
ProjectEntity
| Property | Type | Description |
|---|---|---|
forked | Boolean | Example:true |
full_ | String | Example:Git |
full_ | String | Example:gitlab- |
id | Integer | Example:1 |
name | String | Example:Git |
refs_ | String | — |
ProjectImportEntity
| Property | Type | Description |
|---|---|---|
forked | Boolean | Example:true |
full_ | String | Example:Git |
full_ | String | Example:gitlab- |
human_ | String | Example:canceled |
id | Integer | Example:1 |
import_ | String | — |
import_ | String | Example:source/ |
import_ | String | Allowed values:scheduled,started,finished,failed,canceledExample: scheduled |
import_ | String | — |
name | String | Example:Git |
provider_ | String | Example:/ |
refs_ | String | — |
relation_ | String | — |