GitHub Versions API

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

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
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.0.3
info:
  version: 1.1.4
  title: GitHub Application About Versions API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
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
  /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
  /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
  /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
  /user/packages/{package_type}/{package_name}/versions:
    get:
      summary: GitHub List Package Versions for Package Owned by the Authenticated User
      description: '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. 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: listPackageVersionsForPackageOwnedByTheAuthenticatedUser
      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-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $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
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-versions-for-authenticated-user'
        '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
  /user/packages/{package_type}/{package_name}/versions/{package_version_id}:
    get:
      summary: GitHub Get Package Version for the Authenticated User
      description: '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. 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: getPackageVersionForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#get-a-package-version-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/package-version-id'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-version-authenticated-user'
      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 the Authenticated User
      description: '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. 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: deletePackageVersionForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#delete-a-package-version-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/package-version-id'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      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
  /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore:
    post:
      summary: GitHub Restore Package Version for the Authenticated User
      description: "Restores a package version owned by the authenticated user.\n\nYou can restore a deleted package version 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.\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: restorePackageVersionForTheAuthenticatedUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#restore-a-package-version-for-the-authenticated-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/package-version-id'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      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
  /users/{username}/packages/{package_type}/{package_name}/versions:
    get:
      summary: GitHub List Package Versions for Package Owned by User
      description: '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. 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: listPackageVersionsForPackageOwnedByUser
      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-a-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/username'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-versions-for-user'
        '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
  /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}:
    get:
      summary: GitHub Get Package Version for User
      description: '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. 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: getPackageVersionForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#get-a-package-version-for-a-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/package-version-id'
      - $ref: '#/components/parameters/username'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/package-version'
              examples:
                default:
                  $ref: '#/components/examples/package-version-user'
      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 User
      description: '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](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: deletePackageVersionForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#delete-package-version-for-a-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/username'
      - $ref: '#/components/parameters/package-version-id'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      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
  /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore:
    post:
      summary: GitHub Restore Package Version for User
      description: "Restores a specific package version for a user.\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.\nIf 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](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: restorePackageVersionForUser
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/packages/packages#restore-package-version-for-a-user
      parameters:
      - $ref: '#/components/parameters/package-type'
      - $ref: '#/components/parameters/package-name'
      - $ref: '#/components/parameters/username'
      - $ref: '#/components/parameters/package-version-id'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      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
components:
  responses:
    forbidden:
      description: Forbidden
      c

# --- truncated at 32 KB (645 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-versions-api-openapi.yml