Skip to content

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.”

API method documentation

package_type
required
string
Allowed values: npm maven rubygems docker nuget container

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.

package_name
required
string

The name of the package.

org
required
string

The organization name. The name is not case sensitive.

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

per_page
integer
default: 30

The number of results per page (max 100). For more information, see “Using pagination in the REST API.”

state
string
default: active
Allowed values: active deleted

The state of the package, either active or deleted.

Response

Media type application/json
Array<object>
Package Version

A version of a software package

object
id
required

Unique identifier of the package version.

integer
name
required

The name of the package version.

string
url
required
string
package_html_url
required
string
html_url
string
license
string
description
string
created_at
required
string format: date-time
updated_at
required
string format: date-time
deleted_at
string format: date-time
metadata
Package Version Metadata
object
package_type
required
string
Allowed values: npm maven rubygems docker nuget container
container
Container Metadata
object
tags
required
Array<string>
docker
Docker Metadata
object
tag
Array<string>
Examples
Example default
[
{
"id": 245301,
"name": "1.0.4",
"url": "https://api.github.com/orgs/octo-org/packages/npm/hello-world-npm/versions/245301",
"package_html_url": "https://github.com/octo-org/hello-world-npm/packages/43752",
"created_at": "2019-11-05T22:49:04Z",
"updated_at": "2019-11-05T22:49:04Z",
"html_url": "https://github.com/octo-org/hello-world-npm/packages/43752?version=1.0.4",
"metadata": {
"package_type": "npm"
}
},
{
"id": 209672,
"name": "1.0.3",
"url": "https://api.github.com/orgs/octo-org/packages/npm/hello-world-npm/versions/209672",
"package_html_url": "https://github.com/octo-org/hello-world-npm/packages/43752",
"created_at": "2019-10-29T15:42:11Z",
"updated_at": "2019-10-29T15:42:12Z",
"html_url": "https://github.com/octo-org/hello-world-npm/packages/43752?version=1.0.3",
"metadata": {
"package_type": "npm"
}
}
]

Requires authentication

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}