GitHub Assets API

The Assets API from GitHub — 2 operation(s) for assets.

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-assets-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Assets 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: Assets
paths:
  /repos/{owner}/{repo}/releases/assets/{asset_id}:
    get:
      summary: GitHub Get Release Asset
      description: To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.9/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response.
      tags:
      - Assets
      operationId: getReleaseAsset
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/releases/assets#get-a-release-asset
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/asset-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/release-asset'
              examples:
                default:
                  $ref: '#/components/examples/release-asset'
        '302':
          $ref: '#/components/responses/found'
        '404':
          $ref: '#/components/responses/not_found'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: releases
        subcategory: assets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: GitHub Update Release Asset
      description: Users with push access to the repository can edit a release asset.
      tags:
      - Assets
      operationId: updateReleaseAsset
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/releases/assets#update-a-release-asset
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/asset-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
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The file name of the asset.
                label:
                  type: string
                  description: An alternate short description of the asset. Used in place of the filename.
                state:
                  type: string
                  example: '"uploaded"'
            examples:
              default:
                value:
                  name: foo-1.0.0-osx.zip
                  label: Mac binary
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/release-asset'
              examples:
                default:
                  $ref: '#/components/examples/release-asset'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: releases
        subcategory: assets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete Release Asset
      description: The Delete Release Asset operation removes a specific asset file from a GitHub repository release by targeting its unique asset ID. This DELETE endpoint requires authentication and appropriate permissions to modify releases in the specified repository. When executed, it permanently deletes the asset file (such as binaries, archives, or documentation) that was previously uploaded to a release, freeing up storage space and removing the download option for users. The operation is irreversible and returns a 204 No Content status upon successful deletion, making it useful for removing outdated, incorrect, or unnecessary release artifacts from your GitHub releases.
      tags:
      - Assets
      operationId: deleteReleaseAsset
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/releases/assets#delete-a-release-asset
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/asset-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
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: releases
        subcategory: assets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/releases/{release_id}/assets:
    get:
      summary: GitHub List Release Assets
      description: Lists all assets attached to a specific release in a GitHub repository. This endpoint requires the repository owner's username, the repository name, and the unique identifier of the release to retrieve its associated assets. Assets typically include downloadable files such as compiled binaries, source code archives, documentation, or other artifacts that are bundled with a particular release. The response includes metadata for each asset such as name, size, download count, content type, browser download URL, and creation timestamp. This operation is useful for programmatically accessing release artifacts, monitoring download statistics, or integrating release assets into automated deployment pipelines.
      tags:
      - Assets
      operationId: listReleaseAssets
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/releases/assets#list-release-assets
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/release-id'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      - 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/release-asset'
              examples:
                default:
                  $ref: '#/components/examples/release-asset-items'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: releases
        subcategory: assets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: GitHub Upload Release Asset
      description: 'This endpoint makes use of a [Hypermedia relation](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in

        the response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.9/rest/releases/releases#create-a-release) to upload a release asset.


        You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.


        Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example:


        `application/zip`


        GitHub Enterprise Server expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,

        you''ll still need to pass your authentication to be able to upload an asset.


        When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.


        **Notes:**

        *   GitHub Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/enterprise-server@3.9/rest/releases/assets#list-release-assets)"

        endpoint lists the renamed filenames. For more information and help, contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).

        *   To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/enterprise-server@3.9/rest/releases/releases#get-the-latest-release).

        *   If you upload an asset with the same filename as another uploaded asset, you''ll receive an error and must delete the old file before you can re-upload the new asset.'
      tags:
      - Assets
      operationId: uploadReleaseAsset
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/releases/assets#upload-a-release-asset
      servers:
      - url: https://uploads.github.com
        description: The URL origin (protocol + host name + port) is included in `upload_url` returned in the response of the "Create a release" endpoint
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/release-id'
      - name: name
        in: query
        required: true
        schema:
          type: string
        example: octocat
      - name: label
        in: query
        schema:
          type: string
        example: Example Title
      - 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
      requestBody:
        required: false
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
              description: The raw file data
            examples:
              default:
                value: '@example.zip'
      responses:
        '201':
          description: Response for successful upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/release-asset'
              examples:
                response-for-successful-upload:
                  $ref: '#/components/examples/release-asset-response-for-successful-upload'
        '422':
          description: Response if you upload an asset with the same filename as another uploaded asset
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: releases
        subcategory: assets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    nullable-simple-user:
      title: Simple User
      description: GitHub user.
      type: object
      properties:
        name:
          type: string
          example: octocat
        email:
          type: string
          example: octocat@github.com
        login:
          type: string
          example: octocat
        id:
          type: integer
          format: int64
          example: 1
        node_id:
          type: string
          example: MDQ6VXNlcjE=
        avatar_url:
          type: string
          format: uri
          example: https://github.com/images/error/octocat_happy.gif
        gravatar_id:
          type: string
          example: 41d064eb2195891e12d0413f63227ea7
        url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat
        html_url:
          type: string
          format: uri
          example: https://github.com/octocat
        followers_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/followers
        following_url:
          type: string
          example: https://api.github.com/users/octocat/following{/other_user}
        gists_url:
          type: string
          example: https://api.github.com/users/octocat/gists{/gist_id}
        starred_url:
          type: string
          example: https://api.github.com/users/octocat/starred{/owner}{/repo}
        subscriptions_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/subscriptions
        organizations_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/orgs
        repos_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/repos
        events_url:
          type: string
          example: https://api.github.com/users/octocat/events{/privacy}
        received_events_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/received_events
        type:
          type: string
          example: User
        site_admin:
          type: boolean
          example: true
        starred_at:
          type: string
          example: '"2020-07-09T00:17:55Z"'
      required:
      - avatar_url
      - events_url
      - followers_url
      - following_url
      - gists_url
      - gravatar_id
      - html_url
      - id
      - node_id
      - login
      - organizations_url
      - received_events_url
      - repos_url
      - site_admin
      - starred_url
      - subscriptions_url
      - type
      - url
    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
    release-asset:
      title: Release Asset
      description: Data related to a release.
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World
        browser_download_url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World
        id:
          type: integer
          example: 42
        node_id:
          type: string
          example: '12345678'
        name:
          description: The file name of the asset.
          type: string
          example: Team Environment
        label:
          type: string
          example: Example Title
        state:
          description: State of the release asset.
          type: string
          enum:
          - uploaded
          - open
          example: uploaded
        content_type:
          type: string
          example: User
        size:
          type: integer
          example: 42
        download_count:
          type: integer
          example: 42
        created_at:
          type: string
          format: date-time
          example: '2026-04-17T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-04-17T12:00:00Z'
        uploader:
          $ref: '#/components/schemas/nullable-simple-user'
      required:
      - id
      - name
      - content_type
      - size
      - state
      - url
      - node_id
      - download_count
      - label
      - uploader
      - browser_download_url
      - created_at
      - updated_at
  responses:
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    found:
      description: Found
  parameters:
    asset-id:
      name: asset_id
      description: The unique identifier of the asset.
      in: path
      required: true
      schema:
        type: integer
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    release-id:
      name: release_id
      description: The unique identifier of the release.
      in: path
      required: true
      schema:
        type: integer
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    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
    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:
    release-asset:
      value:
        url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1
        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip
        id: 1
        node_id: MDEyOlJlbGVhc2VBc3NldDE=
        name: example.zip
        label: short description
        state: uploaded
        content_type: application/zip
        size: 1024
        download_count: 42
        created_at: '2013-02-27T19:35:32Z'
        updated_at: '2013-02-27T19:35:32Z'
        uploader:
          login: octocat
          id: 1
          node_id: MDQ6VXNlcjE=
          avatar_url: https://github.com/images/error/octocat_happy.gif
          gravatar_id: ''
          url: https://api.github.com/users/octocat
          html_url: https://github.com/octocat
          followers_url: https://api.github.com/users/octocat/followers
          following_url: https://api.github.com/users/octocat/following{/other_user}
          gists_url: https://api.github.com/users/octocat/gists{/gist_id}
          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}
          subscriptions_url: https://api.github.com/users/octocat/subscriptions
          organizations_url: https://api.github.com/users/octocat/orgs
          repos_url: https://api.github.com/users/octocat/repos
          events_url: https://api.github.com/users/octocat/events{/privacy}
          received_events_url: https://api.github.com/users/octocat/received_events
          type: User
          site_admin: false
    release-asset-response-for-successful-upload:
      value:
        url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1
        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip
        id: 1
        node_id: MDEyOlJlbGVhc2VBc3NldDE=
        name: example.zip
        label: short description
        state: uploaded
        content_type: application/zip
        size: 1024
        download_count: 42
        created_at: '2013-02-27T19:35:32Z'
        updated_at: '2013-02-27T19:35:32Z'
        uploader:
          login: octocat
          id: 1
          node_id: MDQ6VXNlcjE=
          avatar_url: https://github.com/images/error/octocat_happy.gif
          gravatar_id: ''
          url: https://api.github.com/users/octocat
          html_url: https://github.com/octocat
          followers_url: https://api.github.com/users/octocat/followers
          following_url: https://api.github.com/users/octocat/following{/other_user}
          gists_url: https://api.github.com/users/octocat/gists{/gist_id}
          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}
          subscriptions_url: https://api.github.com/users/octocat/subscriptions
          organizations_url: https://api.github.com/users/octocat/orgs
          repos_url: https://api.github.com/users/octocat/repos
          events_url: https://api.github.com/users/octocat/events{/privacy}
          received_events_url: https://api.github.com/users/octocat/received_events
          type: User
          site_admin: false
    release-asset-items:
      value:
      - url: https://api.github.com/repos/octocat/Hello-World/releases/assets/1
        browser_download_url: https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip
        id: 1
        node_id: MDEyOlJlbGVhc2VBc3NldDE=
        name: example.zip
        label: short description
        state: uploaded
        content_type: application/zip
        size: 1024
        download_count: 42
        created_at: '2013-02-27T19:35:32Z'
        updated_at: '2013-02-27T19:35:32Z'
        uploader:
          login: octocat
          id: 1
          node_id: MDQ6VXNlcjE=
          avatar_url: https://github.com/images/error/octocat_happy.gif
          gravatar_id: ''
          url: https://api.github.com/users/octocat
          html_url: https://github.com/octocat
          followers_url: https://api.github.com/users/octocat/followers
          following_url: https://api.github.com/users/octocat/following{/other_user}
          gists_url: https://api.github.com/users/octocat/gists{/gist_id}
          starred_url: https://api.github.com/users/octocat/starred{/owner}{/repo}
          subscriptions_url: https://api.github.com/users/octocat/subscriptions
          organizations_url: https://api.github.com/users/octocat/orgs
          repos_url: https://api.github.com/users/octocat/repos
          events_url: https://api.github.com/users/octocat/events{/privacy}
          received_events_url: https://api.github.com/users/octocat/received_events
          type: User
          site_admin: false
  headers:
    link:
      example: <https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"
      schema:
        type: string
  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-webhooks:
  branch-protection-rule-created:
    post:
      summary: 'This event occurs when there is activity relating to branch protection rules. For more information, see "[About protected branches](https://docs.github.com/enterprise-server@3.9/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)." For information about the APIs to manage branch protection rules, see [the GraphQL documentation](https://docs.github.com/enterprise-server@3.9/graphql/reference/objects#branchprotectionrule) or "[Branch protection](https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection)" in the REST API documentation.


        To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" repository permission.'
      description: A branch protection rule was created.
      operationId: branch-protection-rule/created
      externalDocs:
        url: https://docs.github.com/enterprise-server@3.9/webhooks/webhook-events-and-payloads#branch_protection_rule
      parameters:
      - name: User-Agent
        in: header
        example: GitHub-Hookshot/123abc
        schema:
          type: string
      - name: X-Github-Hook-Id
        in: header
        example: 12312312
        schema:
          type: string
      - name: X-Github-Event
        in: header
        example: issues
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Id
        in: header
        example: 123123
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Type
        in: header
        example: repository
        schema:
          type: string
      - name: X-GitHub-Delivery
        in: header
        example: 0b989ba4-242f-11e5-81e1-c7b6966d2516
        schema:
          type: string
      - name: X-Hub-Signature-256
        in: header
        example: sha256=6dcb09b5b57875f334f61aebed695e2e4193db5e
        schema:
          type: string
      - name: X-GitHub-Enterprise-Version
        in: header
        example: 3.1.9
        schema:
          type: string
      - name: X-GitHub-Enterprise-Host
        in: header
        example: ghes.github.com
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/webhook-branch-protection-rule-created'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
      x-github:
        githubCloudOnly: false
        category: webhooks
        subcategory: branch_protection_rule
        supported-webhook-types:
        - repository
        - organization
        - app
  branch-protection-rule-deleted:
    post:
      summary: 'This event occurs when there is activity relating to branch protection rules. For more information, see "[About protected branches](https://docs.github.com/enterprise-server@3.9/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)." For information about the APIs to manage branch protection rules, see [the GraphQL documentation](https://docs.github.com/enterprise-server@3.9/graphql/reference/objects#branchprotectionrule) or "[Branch protection](https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection)" in the REST API documentation.


        To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" repository permission.'
      description: A branch protection rule was deleted.
      operationId: branch-protection-rule/deleted
      externalDocs:
        url: https://docs.github.com/enterprise-server@3.9/webhooks/webhook-events-and-payloads#branch_protection_rule
      parameters:
      - name: User-Agent
        in: header
        example: GitHub-Hookshot/123abc
        schema:
          type: string
      - name: X-Github-Hook-Id
        in: header
        example: 12312312
        schema:
          type: string
      - name: X-Github-Event
        in: header
        example: issues
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Id
        in: header
        example: 123123
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Type
        in: header
        example: repository
        schema:
          type: string
      - name: X-GitHub-Delivery
        in: header
        example: 0b989ba4-242f-11e5-81e1-c7b6966d2516
        schema:
          type: string
      - name: X-Hub-Signature-256
        in: header
        example: sha256=6dcb09b5b57875f334f61aebed695e2e4193db5e
        schema:
          type: string
      - name: X-GitHub-Enterprise-Version
        in: header
        example: 3.1.9
        schema:
          type: string
      - name: X-GitHub-Enterprise-Host
        in: header
        example: ghes.github.com
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/webhook-branch-protection-rule-deleted'
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
      x-github:
        githubCloudOnly: false
        category: webhooks
        subcategory: branch_protection_rule
        supported-webhook-types:
        - repository
        - organization
        - app
  branch-protection-rule-edited:
    post:
      summary: 'This event occurs when there is activity relating to branch protection rules. For more information, see "[About protected branches](https://docs.github.com/enterprise-server@3.9/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)." For information about the APIs to manage branch protection rules, see [the GraphQL documentation](https://docs.github.com/enterprise-server@3.9/graphql/reference/objects#branchprotectionrule) or "[Branch protection](https://docs.github.com/enterprise-server@3.9/rest/branches/branch-protection)" in the REST API documentation.


        To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" repository permission.'
      description: A branch protection rule was edited.
      operationId: branch-protection-rule/edited
      externalDocs:
        url: https://docs.github.com/enterprise-server@3.9/webhooks/webhook-events-and-payloads#branch_protection_rule
      parameters:
      - name: User-Agent
        in: header
        example: GitHub-Hookshot/123abc
        schema:
          type: string
      - name: X-Github-Hook-Id
        in: header
        example: 12312312
        schema:
          type: string
      - name: X-Github-Event
        in: header
        example: issues
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Id
        in: header
        example: 123123
        schema:
          type: string
      - name: X-Github-Hook-Installation-Target-Type
      

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