GitHub Versions API

The Versions API from GitHub — 10 operation(s) for versions.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-versions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Versions API
  version: 1.1.4
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  description: 'Operations tagged Versions across 2 of this provider''s published API definitions: github-manage-openapi.yml, github-organizations-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:
- name: Versions
paths:
  /manage/v1/version:
    get:
      summary: GitHub Get All Ghes Release Versions for All Nodes
      description: Gets the GitHub Enterprise Server release versions that are currently installed on all available nodes. For more information, see "[GitHub Enterprise Server releases](https://docs.github.com/enterprise-server@3.9/admin/all-releases)."
      operationId: getAllGhesReleaseVersionsForAllNodes
      tags:
      - Versions
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes
      servers:
      - url: '{protocol}://{hostname}'
        variables:
          hostname:
            default: HOSTNAME
            description: Self-hosted Enterprise Server hostname
          protocol:
            default: http
            description: Self-hosted Enterprise Server protocol
      parameters:
      - $ref: '#/components/parameters/uuid'
      - $ref: '#/components/parameters/cluster-roles'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ghes-version'
              examples:
                default:
                  $ref: '#/components/examples/ghes-version'
        '401':
          description: Unauthorized
        '500':
          description: Internal error
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: enterprise-admin
        subcategory: manage-ghes
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/packages/{package_type}/{package_name}/versions:
    get:
      summary: GitHub List Package Versions for Package Owned by an Organization
      description: 'Lists package versions for a package owned by an organization.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)."'
      tags:
      - Versions
      operationId: listPackageVersionsForPackageOwnedByAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - name: state
        in: query
        required: false
        description: The state of the package, either active or deleted.
        schema:
          type: string
          enum:
          - active
          - deleted
          default: active
        example: active
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-versions-for-org'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: packages
        subcategory: packages
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}:
    get:
      summary: GitHub Get Package Version for an Organization
      description: '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. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)."'
      tags:
      - Versions
      operationId: getPackageVersionForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#get-a-package-version-for-an-organization
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/package-version-id'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-version-org'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: packages
        subcategory: packages
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete Package Version for an Organization
      description: '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](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."


        OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)."'
      tags:
      - Versions
      operationId: deletePackageVersionForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#delete-package-version-for-an-organization
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/package-version-id'
      responses:
        '204':
          description: Response
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: packages
        subcategory: packages
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore:
    post:
      summary: GitHub Restore Package Version for an Organization
      description: "Restores a specific package version in an organization.\n\nYou can restore a deleted package under the following conditions:\n  - The package was deleted within the last 30 days.\n  - 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\nscenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.\nThe 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](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages).\"\n\nOAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see \"[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.9/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages).\""
      tags:
      - Versions
      operationId: restorePackageVersionForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#restore-package-version-for-an-organization
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/package-version-id'
      responses:
        '204':
          description: Response
        '401':
          $ref: '#/components/responses/requires_authentication'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: false
        category: packages
        subcategory: packages
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
components:
  parameters:
    cluster-roles:
      name: cluster_roles
      description: The cluster roles from the cluster configuration file.
      in: query
      required: false
      schema:
        type: string
    uuid:
      name: uuid
      description: The UUID which identifies a node.
      in: query
      required: false
      schema:
        type: string
    package-version-id:
      name: package_version_id
      description: Unique identifier of the package version.
      in: path
      required: true
      schema:
        type: integer
    package-type:
      name: package_type
      description: 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.
      in: path
      required: true
      schema:
        type: string
        enum:
        - npm
        - maven
        - rubygems
        - docker
        - nuget
        - container
    per-page:
      name: per_page
      description: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 30
    package-name:
      name: package_name
      description: The name of the package.
      in: path
      required: true
      schema:
        type: string
    org:
      name: org
      description: The organization name. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    page:
      name: page
      description: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 1
  examples:
    ghes-version:
      value:
      - hostname: ghe-local-primary
        version:
          version: 3.9.0
          platform: azure
          build_id: fc542058b5
          build_date: '2023-05-02'
    package-versions-for-org:
      value:
      - 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
    package-version-org:
      value:
        id: 836
        name: sha256:b3d3e366b55f9a54599220198b3db5da8f53592acbbb7dc7e4e9878762fc5344
        url: https://api.github.com/orgs/github/packages/container/hello_docker/versions/836
        package_html_url: https://github.com/orgs/github/packages/container/package/hello_docker
        created_at: '2020-05-19T22:19:11Z'
        updated_at: '2020-05-19T22:19:11Z'
        html_url: https://github.com/orgs/github/packages/container/hello_docker/836
        metadata:
          package_type: container
          container:
            tags:
            - latest
  schemas:
    ghes-version:
      type: array
      items:
        type: object
        properties:
          hostname:
            type: string
            format: hostname
          version:
            type: object
            properties:
              version:
                type: string
                pattern: '[0-9]\.[0-9]{2}\.[0-9]'
              platform:
                type: string
                enum:
                - ami
                - azure
                - esx
                - gce
                - hyperv
                - kvm
              build_id:
                type: string
                pattern: '[0-9a-f]{8}'
              build_date:
                type: string
                format: date
    package-version:
      title: Package Version
      description: A version of a software package
      type: object
      properties:
        id:
          description: Unique identifier of the package version.
          type: integer
          example: 1
        name:
          description: The name of the package version.
          type: string
          example: latest
        url:
          type: string
          example: https://api.github.com/orgs/github/packages/container/super-linter/versions/786068
        package_html_url:
          type: string
          example: https://github.com/orgs/github/packages/container/package/super-linter
        html_url:
          type: string
          example: https://github.com/orgs/github/packages/container/super-linter/786068
        license:
          type: string
          example: MIT
        description:
          type: string
          example: This is an example repository
        created_at:
          type: string
          format: date-time
          example: '2011-04-10T20:09:31Z'
        updated_at:
          type: string
          format: date-time
          example: '2014-03-03T18:58:10Z'
        deleted_at:
          type: string
          format: date-time
          example: '2014-03-03T18:58:10Z'
        metadata:
          type: object
          title: Package Version Metadata
          properties:
            package_type:
              type: string
              example: docker
              enum:
              - npm
              - maven
              - rubygems
              - docker
              - nuget
              - container
            container:
              type: object
              title: Container Metadata
              properties:
                tags:
                  type: array
                  items:
                    type: string
              required:
              - tags
            docker:
              type: object
              title: Docker Metadata
              properties:
                tag:
                  type: array
                  items:
                    type: string
              required:
              - tags
          required:
          - package_type
      required:
      - id
      - name
      - url
      - package_html_url
      - created_at
      - updated_at
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
  responses:
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    requires_authentication:
      description: Requires authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/
x-refined-from:
- github-manage-openapi.yml
- github-organizations-openapi.yml