---
title: "Import project resources"
method: POST
path: "/api/v4/projects/import-relation"
tags: ["project_import"]
---

# Import project resources

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

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/import-relation`
- Auth: none declared

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`

- object
  - `path` string, required: The project path and name
  - `file` string, binary, required: The project export file from which to extract the relation.
  - `relation` string, required: The relation to import. Must be one of issues, merge_requests, ci_pipelines, or milestones.
  - `file.path` string: Path to locally stored body (generated by Workhorse)
  - `file.name` string: Real filename as sent in Content-Disposition (generated by Workhorse)
  - `file.type` string: Real content type as send in Content-Type (generated by Workhorse)
  - `file.size` integer: Real size of file (generated by Workhorse)
  - `file.md5` string: MD5 checksum of the file (generated by Workhorse)
  - `file.sha1` string: SHA1 checksum of the file (generated by Workhorse)
  - `file.sha256` string: SHA256 checksum of the file (generated by Workhorse)
  - `file.etag` string: Etag of the file (generated by Workhorse)
  - `file.remote_id` string: Remote_id of the file (generated by Workhorse)
  - `file.remote_url` string: Remote_url of the file (generated by Workhorse)

## Response `201`

Import project resources

- APIEntitiesRelationImportTracker: API_Entities_RelationImportTracker model
  - `id` integer, required
  - `project_path` string, required
  - `relation` string, required
  - `status` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `503`: Service unavailable

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
