REST API endpoints for organization migrations

Use the REST API to export one or more repositories so you can move them to GitHub Enterprise Server.

About organization migrations

These endpoints are only available to authenticated organization owners. For more information, see Roles in an organization and Authenticating to the REST API.

You can use these endpoints to export one or more repositories so you can move them to a GitHub Enterprise Server instance. For more information, see Exporting migration data from GitHub.com.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

List organization migrations

GET /orgs/{org}/migrations

Lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).
A list of repositories is only returned for export migrations.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/migrations

Response schema (Status: 200):

Array of Migration:

Start an organization migration

POST /orgs/{org}/migrations

Initiates the generation of a migration archive.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/migrations \
  -d '{
  "repositories": [
    "github/Hello-World"
  ],
  "lock_repositories": true
}'

Response schema (Status: 201):

Get an organization migration status

GET /orgs/{org}/migrations/{migration_id}

Fetches the status of a migration.
The state of a migration can be one of the following values:

pending, which means the migration hasn't started yet.
exporting, which means the migration is in progress.
exported, which means the migration finished successfully.
failed, which means the migration failed.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/migrations/MIGRATION_ID

Response schema (Status: 200):

Same response schema as Start an organization migration.

Download an organization migration archive

GET /orgs/{org}/migrations/{migration_id}/archive

Fetches the URL to a migration archive.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/migrations/MIGRATION_ID/archive

Response schema (Status: 302):

Delete an organization migration archive

DELETE /orgs/{org}/migrations/{migration_id}/archive

Deletes a previous migration archive. Migration archives are automatically deleted after seven days.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/migrations/MIGRATION_ID/archive

Response schema (Status: 204):

Unlock an organization repository

DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock

Unlocks a repository that was locked for migration. You should unlock each migrated repository and delete them when the migration is complete and you no longer need the source data.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/migrations/MIGRATION_ID/repos/REPO_NAME/lock

Response schema (Status: 204):

List repositories in an organization migration

GET /orgs/{org}/migrations/{migration_id}/repositories

List all the repositories for this organization migration.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/migrations/MIGRATION_ID/repositories

Response schema (Status: 200):