Skip to content

Start an import

Deprecated
PUT
/repos/{owner}/{repo}/import

Start a source import to a GitHub repository using GitHub Importer. Importing into a GitHub repository with GitHub Actions enabled is not supported and will return a status 422 Unprocessable Entity response.

[!WARNING] Endpoint closing down notice: Due to very low levels of usage and available alternatives, this endpoint is closing down and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the changelog.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Media type application/json
object
vcs_url
required

The URL of the originating repository.

string
vcs

The originating VCS type. Without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response.

string
Allowed values: subversion git mercurial tfvc
vcs_username

If authentication is required, the username to provide to vcs_url.

string
vcs_password

If authentication is required, the password to provide to vcs_url.

string
tfvc_project

For a tfvc import, the name of the project that is being imported.

string
Examples
Example default
{
"vcs": "subversion",
"vcs_url": "http://svn.example.com/svn/myproject",
"vcs_username": "octocat",
"vcs_password": "secret"
}

Response

Media type application/json
Import

A repository import from an external source.

object
vcs
required
string
nullable
use_lfs
boolean
vcs_url
required

The URL of the originating repository.

string
svc_root
string
tfvc_project
string
status
required
string
Allowed values: auth error none detecting choose auth_failed importing mapping waiting_to_push pushing complete setup unknown detection_found_multiple detection_found_nothing detection_needs_auth
status_text
string
nullable
failed_step
string
nullable
error_message
string
nullable
import_percent
integer
nullable
commit_count
integer
nullable
push_percent
integer
nullable
has_large_files
boolean
large_files_size
integer
large_files_count
integer
project_choices
Array<object>
object
vcs
string
tfvc_project
string
human_name
string
message
string
authors_count
integer
nullable
url
required
string format: uri
html_url
required
string format: uri
authors_url
required
string format: uri
repository_url
required
string format: uri
svn_root
string
Examples
Example default
{
"vcs": "subversion",
"use_lfs": true,
"vcs_url": "http://svn.example.com/svn/myproject",
"status": "importing",
"status_text": "Importing...",
"has_large_files": false,
"large_files_size": 0,
"large_files_count": 0,
"authors_count": 0,
"commit_count": 1042,
"url": "https://api.github.com/repos/octocat/socm/import",
"html_url": "https://import.github.com/octocat/socm/import",
"authors_url": "https://api.github.com/repos/octocat/socm/import/authors",
"repository_url": "https://api.github.com/repos/octocat/socm"
}
Location
string
Example
https://api.github.com/repos/spraints/socm/import

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}

Unavailable due to service under maintenance.

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}