Use the REST API to interact with 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).
read:packages scope.read:packages and delete:packages scopes.read:packages and write:packages scopes.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 /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.
accept (string)application/vnd.github+json is recommended.org (string) (required)200 - OK
401 - Requires authentication
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/docker/conflicts
Response schema (Status: 200):
Array of Package:
id: required, integername: required, stringpackage_type: required, string, enum: npm, maven, rubygems, docker, nuget, containerurl: required, stringhtml_url: required, stringversion_count: required, integervisibility: required, string, enum: private, publicowner: any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringrepository: any of:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User (see above)private: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objectcustom_properties: object, additional properties allowedcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeGET /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
org (string) (required)
The organization name. The name is not case sensitive.
visibility (string)
The selected visibility of the packages. This parameter is optional and only filters an existing result set.
The internal visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems internal is synonymous with private.
For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."
Can be one of: public, private, internal
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
200 - OK
400 - The value of per_page multiplied by page cannot be greater than 10000.
401 - Requires authentication
403 - Forbidden
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME
Response schema (Status: 200):
id: required, integername: required, stringpackage_type: required, string, enum: npm, maven, rubygems, docker, nuget, containerurl: required, stringhtml_url: required, stringversion_count: required, integervisibility: required, string, enum: private, publicowner: any of:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringrepository: any of:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User (see above)private: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objects:
reviewer_id: required, integerreviewer_type: required, string, enum: TEAM, ROLEmode: string, enum: ALWAYS, EXEMPT, default: "ALWAYS"custom_properties: object, additional properties allowedcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeDELETE /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
token (string)
package token
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X POST \
https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
state (string)
The state of the package, either active or deleted.
Default: active
Can be one of: active, deleted
200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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:
id: required, integername: required, stringurl: required, stringpackage_html_url: required, stringhtml_url: stringlicense: stringdescription: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timedeleted_at: string, format: date-timemetadata: Package Version Metadata:
package_type: required, string, enum: npm, maven, rubygems, docker, nuget, containercontainer: Container Metadata:
tags: required, array of stringdocker: Docker Metadata:
tag: array of stringGET /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
package_version_id (integer) (required)
Unique identifier of the package version.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response schema (Status: 200):
id: required, integername: required, stringurl: required, stringpackage_html_url: required, stringhtml_url: stringlicense: stringdescription: stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timedeleted_at: string, format: date-timemetadata: Package Version Metadata:
package_type: required, string, enum: npm, maven, rubygems, docker, nuget, containercontainer: Container Metadata:
tags: required, array of stringdocker: Docker Metadata:
tag: array of stringDELETE /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
org (string) (required)
The organization name. The name is not case sensitive.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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 /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.
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.
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
visibility (string)
The selected visibility of the packages. This parameter is optional and only filters an existing result set.
The internal visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems internal is synonymous with private.
For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."
Can be one of: public, private, internal
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
200 - OK
400 - The value of per_page multiplied by page cannot be greater than 10000.
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
token (string)
package token
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X POST \
https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
state (string)
The state of the package, either active or deleted.
Default: active
Can be one of: active, deleted
200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
package_version_id (integer) (required)
Unique identifier of the package version.
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/user/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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 /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.
accept (string)application/vnd.github+json is recommended.username (string) (required)200 - OK
401 - Requires authentication
403 - Forbidden
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.
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
visibility (string)
The selected visibility of the packages. This parameter is optional and only filters an existing result set.
The internal visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems internal is synonymous with private.
For the list of GitHub Packages registries that support granular permissions, see "About permissions for GitHub Packages."
Can be one of: public, private, internal
username (string) (required)
The handle for the GitHub user account.
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
200 - OK
400 - The value of per_page multiplied by page cannot be greater than 10000.
401 - Requires authentication
403 - Forbidden
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
token (string)
package token
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X POST \
https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/restore
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
200 - OK
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
package_version_id (integer) (required)
Unique identifier of the package version.
username (string) (required)
The handle for the GitHub user account.
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 /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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X DELETE \
https://api.github.com/users/USERNAME/packages/PACKAGE_TYPE/PACKAGE_NAME/versions/PACKAGE_VERSION_ID
Response schema (Status: 204):
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."
accept (string)application/vnd.github+json is recommended.package_type (string) (required)
The 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.
Can be one of: npm, maven, rubygems, docker, nuget, container
package_name (string) (required)
The name of the package.
username (string) (required)
The handle for the GitHub user account.
package_version_id (integer) (required)
Unique identifier of the package version.
204 - No Content
401 - Requires authentication
403 - Forbidden
404 - Resource not found
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):