Import a repository from GitHub
POST
/api/v4/import/github
Imports a repository from GitHub to GitLab.
Authorizations
Section titled “ Authorizations ”Request Body required
Section titled “ Request Body required ” Media type application/json
object
personal_access_token
required
GitHub personal access token
string
repo_id
required
GitHub repository ID
integer
new_name
New repo name
string
target_namespace
required
Namespace or group to import repository into
string
github_hostname
Custom GitHub enterprise hostname. For example: https://github.example.com. From GitLab 16.5 to GitLab 17.1, you must include the path /api/v3.
string
optional_stages
Optional stages of import to be performed
object
timeout_strategy
Strategy for behavior on timeouts
string
pagination_limit
Pagination limit
integer
Responses
Section titled “ Responses ”Created
Media type application/json
object
id
integer
name
string
full_path
string
full_name
string
refs_url
string
forked
boolean
Example
{ "id": 1, "name": "GitLab", "full_path": "gitlab-org/gitlab", "full_name": "GitLab Org / GitLab", "forked": true}Bad request
Unauthorized
Forbidden
Unprocessable entity
Service unavailable