Sample - GitHub REST API
PUT/repos/{owner}/{repo}/importDeprecated

Start an 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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 5 body fields
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
vcs_urlstringrequired
The URL of the originating repository.
vcsstringoptional
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.
Allowed:subversiongitmercurialtfvc
vcs_usernamestringoptional
If authentication is required, the username to provide to `vcs_url`.
vcs_passwordstringoptional
If authentication is required, the password to provide to `vcs_url`.
tfvc_projectstringoptional
For a tfvc import, the name of the project that is being imported.

4 status codes
201Response
vcsstringrequired
use_lfsbooleanoptional
vcs_urlstringrequired
The URL of the originating repository.
svc_rootstringoptional
tfvc_projectstringoptional
statusstringrequired
Allowed:autherrornonedetectingchooseauth_failedimportingmappingwaiting_to_pushpushingcompletesetup
status_textstringoptional
failed_stepstringoptional
error_messagestringoptional
import_percentintegeroptional
commit_countintegeroptional
push_percentintegeroptional
has_large_filesbooleanoptional
large_files_sizeintegeroptional
large_files_countintegeroptional
project_choicesarray<object>optional
messagestringoptional
authors_countintegeroptional
urlstringrequired
html_urlstringrequired
authors_urlstringrequired
repository_urlstringrequired
svn_rootstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
503Unavailable due to service under maintenance.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed. A 503 is returned: Unavailable due to service under maintenance.