---
title: "Cancel a GitHub project import"
method: POST
path: "/api/v4/import/github/cancel"
tags: ["project_import"]
---

# Cancel a GitHub project import

`POST /api/v4/import/github/cancel`

## Request

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

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

## Request body

- PostApiV4ImportGithubCancel: Cancel a GitHub project import
  - `project_id` integer, required: ID of importing project to be canceled

## Response `200`

Cancel a GitHub project import

- ProjectImportEntity: ProjectImportEntity model
  - `id` integer, required
  - `name` string, required
  - `full_path` string, required
  - `full_name` string, required
  - `refs_url` string, required
  - `forked` boolean, required
  - `import_source` string, required
  - `import_status` 'scheduled' | 'started' | 'finished' | 'failed' | 'canceled', required
  - `human_import_status_name` string, required
  - `provider_link` string, required
  - `import_error` string
  - `import_warning` string
  - `relation_type` string, 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)
