{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-codebuild/json-schema/aws-codebuild-update-webhook-input-schema.json",
  "title": "UpdateWebhookInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-codebuild-aws-codebuild-x-amz-target-codebuild-api-openapi.yml#/components/schemas/UpdateWebhookInput",
  "type": "object",
  "properties": {
    "projectName": {
      "type": "string",
      "description": "The name of the CodeBuild project."
    },
    "branchFilter": {
      "type": "string",
      "description": "A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If branchFilter is empty, then all branches are built. It is recommended that you use filterGroups instead of branchFilter."
    },
    "rotateSecret": {
      "type": "boolean",
      "description": "A boolean value that specifies whether the associated GitHub repository's secret token should be updated. If you use Bitbucket for your repository, rotateSecret is ignored."
    },
    "filterGroups": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/WebhookFilter"
        }
      },
      "description": "An array of arrays of WebhookFilter objects used to determine if a webhook event can trigger a build. A filter group must contain at least one EVENT WebhookFilter."
    },
    "buildType": {
      "type": "string",
      "enum": [
        "BUILD",
        "BUILD_BATCH",
        "RUNNER_BUILDKITE_BUILD"
      ],
      "description": "Specifies the type of build this webhook will trigger. RUNNER_BUILDKITE_BUILD is only available for NO_SOURCE source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see Tutorial: Configure a CodeBuild-hosted Buildkite runner in the CodeBuild user guide."
    },
    "pullRequestBuildPolicy": {
      "$ref": "#/$defs/PullRequestBuildPolicy"
    }
  },
  "required": [
    "projectName"
  ],
  "$defs": {
    "PullRequestBuildPolicy": {
      "type": "object",
      "properties": {
        "requiresCommentApproval": {
          "type": "string",
          "enum": [
            "DISABLED",
            "ALL_PULL_REQUESTS",
            "FORK_PULL_REQUESTS"
          ],
          "description": "Specifies when comment-based approval is required before triggering a build on pull requests. This setting determines whether builds run automatically or require explicit approval through comments. DISABLED: Builds trigger automatically without requiring comment approval ALL_PULL_REQUESTS: All pull requests require comment approval before builds execute (unless contributor is one of the approver roles) FORK_PULL_REQUESTS: Only pull requests from forked repositories require comment approval (unless contributor is one of the approver roles)"
        },
        "approverRoles": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "GITHUB_READ",
              "GITHUB_TRIAGE",
              "GITHUB_WRITE",
              "GITHUB_MAINTAIN",
              "GITHUB_ADMIN",
              "GITLAB_GUEST",
              "GITLAB_PLANNER",
              "GITLAB_REPORTER",
              "GITLAB_DEVELOPER",
              "GITLAB_MAINTAINER",
              "GITLAB_OWNER",
              "BITBUCKET_READ",
              "BITBUCKET_WRITE",
              "BITBUCKET_ADMIN"
            ]
          },
          "description": "List of repository roles that have approval privileges for pull request builds when comment approval is required. Only users with these roles can provide valid comment approvals. If a pull request contributor is one of these roles, their pull request builds will trigger automatically. This field is only applicable when requiresCommentApproval is not DISABLED."
        }
      },
      "required": [
        "requiresCommentApproval"
      ]
    },
    "WebhookFilter": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "EVENT",
            "BASE_REF",
            "HEAD_REF",
            "ACTOR_ACCOUNT_ID",
            "FILE_PATH",
            "COMMIT_MESSAGE",
            "WORKFLOW_NAME",
            "TAG_NAME",
            "RELEASE_NAME",
            "REPOSITORY_NAME",
            "ORGANIZATION_NAME"
          ],
          "description": "The type of webhook filter. There are 11 webhook filter types: EVENT, ACTOR_ACCOUNT_ID, HEAD_REF, BASE_REF, FILE_PATH, COMMIT_MESSAGE, TAG_NAME, RELEASE_NAME, REPOSITORY_NAME, ORGANIZATION_NAME, and WORKFLOW_NAME. EVENT A webhook event triggers a build when the provided pattern matches one of nine event types: PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, PULL_REQUEST_CLOSED, PULL_REQUEST_REOPENED, PULL_REQUEST_MERGED, RELEASED, PRERELEASED, and WORKFLOW_JOB_QUEUED. The EVENT patterns are specified as a comma-separated string. For example, PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED f"
        },
        "pattern": {
          "type": "string",
          "description": "For a WebHookFilter that uses EVENT type, a comma-separated string that specifies one or more events. For example, the webhook filter PUSH, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED allows all push, pull request created, and pull request updated events to trigger a build. For a WebHookFilter that uses any of the other filter types, a regular expression pattern. For example, a WebHookFilter that uses HEAD_REF for its type and the pattern ^refs/heads/ triggers a build when the head reference is a branch with a reference name refs/heads/branch-name."
        },
        "excludeMatchedPattern": {
          "type": "boolean",
          "description": "Used to indicate that the pattern determines which webhook events do not trigger a build. If true, then a webhook event that does not match the pattern triggers a build. If false, then a webhook event that matches the pattern triggers a build."
        }
      },
      "required": [
        "type",
        "pattern"
      ]
    }
  }
}