← All tags

Packages API Reference

Manage packages for authenticated users and organizations.

27 endpoints tagged packages, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

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.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
401Requires authenticationyes

List packages for an organization

GET /orgs/{org}/packages

Lists packages in an organization readable by the user.

Parameters

NameInRequiredDescription
package_typequeryyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
orgpathyesThe organization name. The name is not case sensitive.
visibilityquerynoThe selected visibility of the packages. This parameter is optional and only filters an existing result set.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
401Requires authenticationyes
400The value of per_page multiplied by page cannot be greater than 10000.no

Get a package for an organization

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

Gets a specific package in an organization.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

Restore a package for an organization

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

Restores an entire package in an organization.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.
tokenquerynopackage token

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
statequerynoThe state of the package, either active or deleted.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
orgpathyesThe organization name. The name is not case sensitive.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

No parameters.

Responses

StatusDescriptionHas JSON body
200Responseyes

List packages for the authenticated user's namespace

GET /user/packages

Lists packages owned by the authenticated user within the user's namespace.

Parameters

NameInRequiredDescription
package_typequeryyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
visibilityquerynoThe selected visibility of the packages. This parameter is optional and only filters an existing result set.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
400The value of per_page multiplied by page cannot be greater than 10000.no

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

Restore a package for the authenticated user

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

Restores a package owned by the authenticated user.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
tokenquerynopackage token

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
statequerynoThe state of the package, either active or deleted.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
401Requires authenticationyes

List packages for a user

GET /users/{username}/packages

Lists all packages in a user's namespace for which the requesting user has access.

Parameters

NameInRequiredDescription
package_typequeryyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
visibilityquerynoThe selected visibility of the packages. This parameter is optional and only filters an existing result set.
usernamepathyesThe handle for the GitHub user account.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
403Forbiddenyes
401Requires authenticationyes
400The value of per_page multiplied by page cannot be greater than 10000.no

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

Restore a package for a user

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

Restores an entire package for a user.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.
tokenquerynopackage token

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
package_version_idpathyesUnique identifier of the package version.
usernamepathyesThe handle for the GitHub user account.

Responses

StatusDescriptionHas JSON body
200Responseyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes

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.

Parameters

NameInRequiredDescription
package_typepathyesThe type of supported package. Packages in GitHub's Gradle registry have the type maven. Docker images pushed to GitHub's Container registry (ghcr.io) have the type container. You can use the type docker to find images that were pushed to GitHub's Docker registry (docker.pkg.github.com), even if these have now been migrated to the Container registry.
package_namepathyesThe name of the package.
usernamepathyesThe handle for the GitHub user account.
package_version_idpathyesUnique identifier of the package version.

Responses

StatusDescriptionHas JSON body
204Responseno
404Resource not foundyes
403Forbiddenyes
401Requires authenticationyes