GitHub Merge API

The Merge API from GitHub — 2 operation(s) for merge.

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-merge-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Merge 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: Merge
paths:
  /repos/{owner}/{repo}/pulls/{pull_number}/merge:
    put:
      summary: GitHub Merge Pull Request
      description: 'Merges a pull request into the base branch.

        This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.9/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.9/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.9/rest/guides/best-practices-for-using-the-rest-api)."'
      tags:
      - Merge
      operationId: mergePullRequest
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/pulls/pulls#merge-a-pull-request
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/pull-number'
      - 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:
                commit_title:
                  type: string
                  description: Title for the automatic commit message.
                commit_message:
                  type: string
                  description: Extra detail to append to automatic commit message.
                sha:
                  type: string
                  description: SHA that pull request head must match to allow merge.
                merge_method:
                  type: string
                  description: The merge method to use.
                  enum:
                  - merge
                  - squash
                  - rebase
            examples:
              response-if-merge-was-successful:
                value:
                  commit_title: Expand enum
                  commit_message: Add a new value to the merge_method enum
      responses:
        '200':
          description: if merge was successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pull-request-merge-result'
              examples:
                response-if-merge-was-successful:
                  $ref: '#/components/examples/pull-request-merge-result-response-if-merge-was-successful'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '405':
          description: Method Not Allowed if merge cannot be performed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  documentation_url:
                    type: string
              examples:
                response-if-merge-cannot-be-performed:
                  value:
                    message: Pull Request is not mergeable
        '409':
          description: Conflict if sha was provided and pull request head did not match
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  documentation_url:
                    type: string
              examples:
                response-if-sha-was-provided-and-pull-request-head-did-not-match:
                  value:
                    message: Head branch was modified. Review and try the merge again.
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        triggersNotification: true
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: pulls
        subcategory: pulls
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/merges:
    post:
      summary: GitHub Merge Branch
      description: The GitHub Repos API merge branch endpoint allows you to perform a repository merge by making a POST request to /repos/{owner}/{repo}/merges. This operation merges a specified branch (the head) into another branch (the base) within the same repository. You must provide the base branch name, head branch name or SHA, and optionally a commit message in the request body. The merge will be performed automatically if there are no conflicts, and the API returns the resulting commit object upon success. If the merge cannot be completed due to conflicts or if the branches are already merged, the API will return an appropriate error response. This endpoint requires push access to the repository and is useful for programmatically managing branch merges without requiring a pull request workflow.
      tags:
      - Merge
      operationId: mergeBranch
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/branches/branches#merge-a-branch
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - 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: true
        content:
          application/json:
            schema:
              type: object
              properties:
                base:
                  type: string
                  description: The name of the base branch that the head will be merged into.
                head:
                  type: string
                  description: The head to merge. This can be a branch name or a commit SHA1.
                commit_message:
                  type: string
                  description: Commit message to use for the merge commit. If omitted, a default message will be used.
              required:
              - base
              - head
            examples:
              default:
                value:
                  base: master
                  head: cool_feature
                  commit_message: Shipped cool_feature!
      responses:
        '201':
          description: Successful Response (The resulting merge commit)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commit'
              examples:
                default:
                  $ref: '#/components/examples/commit'
        '204':
          description: Response when already merged
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          description: Not Found when the base or head does not exist
        '409':
          description: Conflict when there is a merge conflict
        '422':
          $ref: '#/components/responses/validation_failed'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: branches
        subcategory: branches
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  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'
    validation_failed:
      description: Validation failed, or the endpoint has been spammed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/validation-error'
  schemas:
    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
    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
    pull-request-merge-result:
      title: Pull Request Merge Result
      description: Pull Request Merge Result
      type: object
      properties:
        sha:
          type: string
          example: abc123def456789012345678901234567890
        merged:
          type: boolean
          example: true
        message:
          type: string
          example: Example body text
      required:
      - merged
      - message
      - sha
    verification:
      title: Verification
      type: object
      properties:
        verified:
          type: boolean
          example: true
        reason:
          type: string
          example: example_value
        payload:
          type: string
          example: example_value
        signature:
          type: string
          example: example_value
      required:
      - verified
      - reason
      - payload
      - signature
    empty-object:
      title: Empty Object
      description: An object without any properties.
      type: object
      additionalProperties: false
    nullable-git-user:
      title: Git User
      description: Metaproperties for Git author/committer information.
      type: object
      properties:
        name:
          type: string
          example: '"Chris Wanstrath"'
        email:
          type: string
          example: '"chris@ozmm.org"'
        date:
          type: string
          example: '"2007-10-29T02:42:39.000-07:00"'
    validation-error:
      title: Validation Error
      description: Validation Error
      type: object
      required:
      - message
      - documentation_url
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        errors:
          type: array
          items:
            type: object
            required:
            - code
            properties:
              resource:
                type: string
              field:
                type: string
              message:
                type: string
              code:
                type: string
              index:
                type: integer
              value:
                oneOf:
                - type: string
                - type: integer
                - type: array
                  items:
                    type: string
    commit:
      title: Commit
      description: Commit
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
        sha:
          type: string
          example: 6dcb09b5b57875f334f61aebed695e2e4193db5e
        node_id:
          type: string
          example: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==
        html_url:
          type: string
          format: uri
          example: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e
        comments_url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments
        commit:
          type: object
          properties:
            url:
              type: string
              format: uri
              example: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
            author:
              $ref: '#/components/schemas/nullable-git-user'
            committer:
              $ref: '#/components/schemas/nullable-git-user'
            message:
              type: string
              example: Fix all the bugs
            comment_count:
              type: integer
              example: 0
            tree:
              type: object
              properties:
                sha:
                  type: string
                  example: 827efc6d56897b048c772eb4087f854f46256132
                url:
                  type: string
                  format: uri
                  example: https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132
              required:
              - sha
              - url
            verification:
              $ref: '#/components/schemas/verification'
          required:
          - author
          - committer
          - comment_count
          - message
          - tree
          - url
        author:
          oneOf:
          - $ref: '#/components/schemas/simple-user'
          - $ref: '#/components/schemas/empty-object'
          example: example_value
        committer:
          oneOf:
          - $ref: '#/components/schemas/simple-user'
          - $ref: '#/components/schemas/empty-object'
          example: example_value
        parents:
          type: array
          items:
            type: object
            properties:
              sha:
                type: string
                example: 7638417db6d59f3c431d3e1f261cc637155684cd
              url:
                type: string
                format: uri
                example: https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd
              html_url:
                type: string
                format: uri
                example: https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd
            required:
            - sha
            - url
        stats:
          type: object
          properties:
            additions:
              type: integer
            deletions:
              type: integer
            total:
              type: integer
        files:
          type: array
          items:
            $ref: '#/components/schemas/diff-entry'
      required:
      - url
      - sha
      - node_id
      - html_url
      - comments_url
      - commit
      - author
      - committer
      - parents
    diff-entry:
      title: Diff Entry
      description: Diff Entry
      type: object
      properties:
        sha:
          type: string
          example: bbcd538c8e72b8c175046e27cc8f907076331401
        filename:
          type: string
          example: file1.txt
        status:
          type: string
          enum:
          - added
          - removed
          - modified
          - renamed
          - copied
          - changed
          - unchanged
          example: added
        additions:
          type: integer
          example: 103
        deletions:
          type: integer
          example: 21
        changes:
          type: integer
          example: 124
        blob_url:
          type: string
          format: uri
          example: https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt
        raw_url:
          type: string
          format: uri
          example: https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt
        contents_url:
          type: string
          format: uri
          example: https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e
        patch:
          type: string
          example: '@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test'
        previous_filename:
          type: string
          example: file.txt
      required:
      - additions
      - blob_url
      - changes
      - contents_url
      - deletions
      - filename
      - raw_url
      - sha
      - status
  parameters:
    pull-number:
      name: pull_number
      description: The number that identifies the pull request.
      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
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
  examples:
    pull-request-merge-result-response-if-merge-was-successful:
      value:
        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e
        merged: true
        message: Pull Request successfully merged
    commit:
      value:
        url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
        sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e
        node_id: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==
        html_url: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e
        comments_url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments
        commit:
          url: https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
          author:
            name: Monalisa Octocat
            email: mona@github.com
            date: '2011-04-14T16:00:49Z'
          committer:
            name: Monalisa Octocat
            email: mona@github.com
            date: '2011-04-14T16:00:49Z'
          message: Fix all the bugs
          tree:
            url: https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e
            sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e
          comment_count: 0
          verification:
            verified: false
            reason: unsigned
            signature: ''
            payload: ''
        author:
          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
        committer:
          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
        parents:
        - url: https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e
          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e
        stats:
          additions: 104
          deletions: 4
          total: 108
        files:
        - filename: file1.txt
          additions: 10
          sha: 6dcb09b5b57875f334f61aebed695e2e4193db5e
          deletions: 2
          changes: 12
          status: modified
          contents_url: https://api.github.com/repos/octocat/Hello-World/contents
          raw_url: https://github.com/octocat/Hello-World/raw/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt
          blob_url: https://github.com/octocat/Hello-World/blob/7ca483543807a51b6079e54ac4cc392bc29ae284/file1.txt
          patch: '@@ -29,7 +29,7 @@

            .....'
  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
        in: header
        example: repository
        schema:
          type: string
      - name: X-GitHub-Delivery
        in: header
        example: 0b989ba4-242f-1

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