--- title: REST API endpoints for source imports shortTitle: Source endpoints allowTitleToDifferFromFilename: true intro: >- Use the REST API to start an import from a Git source repository. versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖 fpt: '*' ghec: '*' topics: - API autogenerated: rest --- ## About source imports > [!WARNING] > Due to very low levels of usage and available alternatives, the Source Imports API has been {% data variables.release-phases.retired %}. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation). {% data variables.migrations.source_imports_intro %} 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`](/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import) to find out the status of the import. {% data reusables.user-settings.imports-api-classic-pat-only %} The following diagram provides a more detailed example: ```text +---------+ +--------+ +---------------------+ | 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" | | |<-----------------------------| | | | | | | | ```