Text of docs.github.com › en › rest › migrations › source-imports as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

REST API endpoints for source imports - GitHub Docs

Skip to main content Skip to content Collapse sidebar Expand sidebar The REST API is now versioned. For more information, see " About API versioning ." REST API endpoints for source imports Use the REST API to start an import from a Git source repository. About source imports Warning Due to very low levels of usage and available alternatives, the Source Imports API has been retired. For more details and alternatives, see the changelog .

You can use these endpoints to start an import from a Git repository hosted with another service. This is the same functionality as the GitHub Importer. For more information, see Importing a repository with GitHub Importer . A typical source import would start the import and then (optionally) update the authors and/or update the preference for using Git LFS if large files exist in the import. You can also create a webhook that listens for the RepositoryImportEvent to find out the status of the import.

Note These endpoints only support authentication using a personal access token (classic). For more information, see Managing your personal access tokens . The following diagram provides a more detailed example: +---------+ +--------+ +---------------------+ | Tooling | | GitHub | | Original Repository | +---------+ +--------+ +---------------------+ | | | | Start import | | |----------------------------->| | | | | | | Download source data | | |--------------------------------------------->| | | Begin streaming data | | |<---------------------------------------------| | | | | Get import progress | | |----------------------------->| | | "status": "importing" | | |<-----------------------------| | | | | | Get commit authors | | |----------------------------->| | | | | | Map a commit author | | |----------------------------->| | | | | | | | | | Finish streaming data | | |<---------------------------------------------| | | | | | Rewrite commits with mapped authors | | |------+ | | | | | | |<-----+ | | | | | | Update repository on GitHub | | |------+ | | | | | | |<-----+ | | | | | Map a commit author | | |----------------------------->| | | | Rewrite commits with mapped authors | | |------+ | | | | | | |<-----+ | | | | | | Update repository on GitHub | | |------+ | | | | | | |<-----+ | | | | | Get large files | | |----------------------------->| | | | | | opt_in to Git LFS | | |----------------------------->| | | | Rewrite commits for large files | | |------+ | | | | | | |<-----+ | | | | | | Update repository on GitHub | | |------+ | | | | | | |<-----+ | | | | | Get import progress | | |----------------------------->| | | "status": "complete" | | |<-----------------------------| | | | | | | | Get an import status View the progress of an import.

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 . Import status This section includes details about the possible values of the status field of the Import Progress response. An import that does not have errors will progress through these steps: detecting - the "detection" step of the import is in progress because the request did not include a vcs parameter.

The import is identifying the type of source control present at the URL. importing - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include commit_count (the total number of raw commits that will be imported) and percent (0 - 100, the current progress through the import). mapping - the "rewrite" step of the import is in progress.

This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. pushing - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include push_percent , which is the percent value reported by git push when it is "Writing objects". complete - the import is complete, and the repository is ready on GitHub.

If there are problems, you will see one of these in the status field: auth_failed - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the Update an import section. error - the import encountered an error. The import progress response will include the failed_step and an error message. Contact GitHub Support for more information. detection_needs_auth - the importer requires authentication for the originating repository to continue detection.

To update authentication for the import, please see the Update an import section. detection_found_nothing - the importer didn't recognize any source control at the URL. To resolve, Cancel the import and retry with the correct URL. detection_found_multiple - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a project_choices field with the possible project choices as values.

To update project choice, please see the Update an import section. The project_choices field When multiple projects are found at the provided URL, the response hash will include a project_choices field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. Git LFS related fields This section includes details about Git LFS related fields that may be present in the Import Progress response. use_lfs - describes whether the import has been opted in or out of using Git LFS.

The value can be opt_in , opt_out , or undecided if no action has been taken. has_large_files - the boolean value describing whether files larger than 100MB were found during the importing step. large_files_size - the total size in gigabytes of files larger than 100MB found in the originating repository. large_files_count - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.

Fine-grained access tokens for "Get an import status" This endpoint works with the following fine-grained token types : GitHub App user access tokens Fine-grained personal access tokens The fine-grained token must have the following permission set: "Contents" repository permissions (read) Parameters for "Get an import status" Headers Name, Type, Description accept string Setting to application/vnd.github+json is recommended.

Path parameters Name, Type, Description owner string Required The account owner of the repository. The name is not case sensitive. repo string Required The name of the repository without the .git extension. The name is not case sensitive. HTTP response status codes for "Get an import status" Status code Description 200 OK 404 Resource not found 503 Unavailable due to service under maintenance. Code samples for "Get an import status" Request example get /repos /{owner} /{repo} /import Copy to clipboard curl request example curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/import Response Status: 200 { "vcs": "subversion", "use_lfs": true, "vcs_url": "http://svn.example.com/svn/myproject", "status": "complete", "status_text": "Done", "has_large_files": true, "large_files_size": 132331036, "large_files_count": 1, "authors_count": 4, "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" } Start an import Start a source import to a GitHub repository using GitHub Importer.

The rest of this page is on the live site.