REST API endpoints for packages

Use the REST API to interact with GitHub Packages.

About GitHub Packages

GitHub Packages supports a range of package managers for publishing packages. For more information, see Introduction to GitHub Packages.

After you publish a package, you can use the REST API to manage the package in your GitHub repositories and organizations. For more information, see Deleting and restoring a package.

To use the REST API to manage GitHub Packages, you must authenticate using a personal access token (classic).

If your package is in a registry that supports granular permissions, then your token does not need the repo scope to access or manage this package. If your package is in a registry that only supports repository-scoped permissions, then your token must also include the repo scope since your package inherits permissions from a GitHub repository. For a list of registries that only support repository-scoped permissions, see About permissions for GitHub Packages.

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.

Get list of conflicting packages during Docker migration for organization

GET /orgs/{org}/docker/conflicts

Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

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

Response schema (Status: 200):

Array of Package:

List packages for an organization

GET /orgs/{org}/packages

Lists packages in an organization readable by the user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  "https://api.github.com/orgs/ORG/packages?package_type=container"

Response schema (Status: 200):

Same response schema as Get list of conflicting packages during Docker migration for organization.

Get a package for an organization

GET /orgs/{org}/packages/{package_type}/{package_name}

Gets a specific package in an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 200):

Delete a package for an organization

DELETE /orgs/{org}/packages/{package_type}/{package_name}

Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 204):

Restore a package for an organization

POST /orgs/{org}/packages/{package_type}/{package_name}/restore

Restores an entire package in an organization.
You can restore a deleted package under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/restore

Response schema (Status: 204):

List package versions for a package owned by an organization

GET /orgs/{org}/packages/{package_type}/{package_name}/versions

Lists package versions for a package owned by an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions

Response schema (Status: 200):

Array of Package Version:

Get a package version for an organization

GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}

Gets a specific package version in an organization.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 200):

Delete package version for an organization

DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}

Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 204):

Restore package version for an organization

POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore

Restores a specific package version in an organization.
You can restore a deleted package under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

The authenticated user must have admin permissions in the organization to use this endpoint. If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore

Response schema (Status: 204):

Get list of conflicting packages during Docker migration for authenticated-user

GET /user/docker/conflicts

Lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint.

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/docker/conflicts

Response schema (Status: 200):

Same response schema as Get list of conflicting packages during Docker migration for organization.

List packages for the authenticated user's namespace

GET /user/packages

Lists packages owned by the authenticated user within the user's namespace.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  "https://api.github.com/user/packages?package_type=container"

Response schema (Status: 200):

Same response schema as Get list of conflicting packages during Docker migration for organization.

Get a package for the authenticated user

GET /user/packages/{package_type}/{package_name}

Gets a specific package for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 200):

Same response schema as Get a package for an organization.

Delete a package for the authenticated user

DELETE /user/packages/{package_type}/{package_name}

Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 204):

Restore a package for the authenticated user

POST /user/packages/{package_type}/{package_name}/restore

Restores a package owned by the authenticated user.
You can restore a deleted package under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/restore

Response schema (Status: 204):

List package versions for a package owned by the authenticated user

GET /user/packages/{package_type}/{package_name}/versions

Lists package versions for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions

Response schema (Status: 200):

Same response schema as List package versions for a package owned by an organization.

Get a package version for the authenticated user

GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}

Gets a specific package version for a package owned by the authenticated user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 200):

Same response schema as Get a package version for an organization.

Delete a package version for the authenticated user

DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}

Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
The authenticated user must have admin permissions in the organization to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 204):

Restore a package version for the authenticated user

POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore

Restores a package version owned by the authenticated user.
You can restore a deleted package version under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore

Response schema (Status: 204):

Get list of conflicting packages during Docker migration for user

GET /users/{username}/docker/conflicts

Lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/docker/conflicts

Response schema (Status: 200):

Same response schema as Get list of conflicting packages during Docker migration for organization.

List packages for a user

GET /users/{username}/packages

Lists all packages in a user's namespace for which the requesting user has access.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  "https://api.github.com/users/USERNAME/packages?package_type=container"

Response schema (Status: 200):

Same response schema as Get list of conflicting packages during Docker migration for organization.

Get a package for a user

GET /users/{username}/packages/{package_type}/{package_name}

Gets a specific package metadata for a public package owned by a user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 200):

Same response schema as Get a package for an organization.

Delete a package for a user

DELETE /users/{username}/packages/{package_type}/{package_name}

Deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.
If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME

Response schema (Status: 204):

Restore a package for a user

POST /users/{username}/packages/{package_type}/{package_name}/restore

Restores an entire package for a user.
You can restore a deleted package under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/restore

Response schema (Status: 204):

List package versions for a package owned by a user

GET /users/{username}/packages/{package_type}/{package_name}/versions

Lists package versions for a public package owned by a specified user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions

Response schema (Status: 200):

Same response schema as List package versions for a package owned by an organization.

Get a package version for a user

GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}

Gets a specific package version for a public package owned by a specified user.
OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 200):

Same response schema as Get a package version for an organization.

Delete package version for a user

DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}

Deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.
If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID

Response schema (Status: 204):

Restore package version for a user

POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore

Restores a specific package version for a user.
You can restore a deleted package under the following conditions:

The package was deleted within the last 30 days.
The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.

If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "About permissions for GitHub Packages."
OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see "About permissions for GitHub Packages."

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID/restore

Response schema (Status: 204):