Event payload
When you have a webhook with an event, Bitbucket Data Center sends the event request to the server URL for the webhook whenever that event occurs. This page describes the structure of these requests.
For Bitbucket to send event payload requests for a webhook with HTTPS endpoints, make sure your URL has a valid SSL certificate that a public certificate authority has signed. Learn how to use self-signed certificates
The following payloads contain some of the common entity types – U
ser
, Repository
, Comment
, and Pull Request
– which have consistent representations in all the payloads where they appear. For example, the actor
property in the repo:refs_changed
payload is a representation of the event's user.
The following events are supported:
Project event | trigger |
---|---|
Project modified | The name of a project is modified. |
Repository event | trigger |
プッシュ | A push is made to the repository. |
最終変更日 | The name of a repository is modified. |
Forked | A repository is forked. |
コメント追加時 | A comment is added to a commit in the repository. |
コメント編集時 | A commit comment is modified in the repository. |
コメントの削除 | A commit comment is deleted in the repository. |
Mirror synchronized | A mirror finishes synchronizing the repository. |
Secret deleted | A secret is pushed to the repository. |
Pull request event | trigger |
Opened | A pull request is created. |
Source branch updated | The source branch of a pull request is updated. |
Target branch updated | The target branch of a pull request is updated. |
最終変更日 | A pull request is modified. |
Reviewers updated | The reviewers in a pull request are updated. |
承認 | A pull request is approved. |
Unapproved | A pull request is unapproved. |
Changes requested | A pull request is marked as Changes requested. |
マージ | A pull request is merged. |
却下 | A pull request is declined. |
Deleted | A pull request is deleted. |
コメント追加時 | A comment is added to a pull request. |
コメント編集時 | A comment on a pull request is edited. |
コメントの削除 | A comment on a pull request is deleted. |
HTTP ヘッダー
All event payload requests may have the following HTTP headers:
HTTP ヘッダー | 説明 |
---|---|
X-Request-Id | A unique UUID for each webhook request |
X-Event-Key | The event that kicked off this webhook. For example, a repository push will have |
X-Hub-Signature | See Webhook secrets |
Authorization | The Base64 encoded credentials that authenticate the webhook request. This header will only be present if the webhook has basic authentication configured. |
Project events
You can create project-level webhooks for the following events and all the events that occur in a repository.
最終変更日
A user updates the Name of a project. This payload, with an event key of project:modified
, provides the following fields:
パラメーター | 説明 |
---|---|
古い | The details of the old version of the project. |
new | The defaults of the current version of the project. |
actor | The user who made the update. |
リポジトリ イベント
リポジトリで発生する次のイベント用に Webhook を作成できます。
プッシュ
A user pushes one or more commits to a repository. This payload, with an event key of repo:refs_changed
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who pushed the commits. |
repository | The repository with the commits. |
変更 | The details of the push. |
コミット | The details of the commit pushed. By default, the maximum number of commits included is 5. If the number of commits pushed is greater than the limit set, the list will include only the most recent commits. |
toCommit | The details of the new head commit. |
最終変更日
A user updates the Name of a repository. This payload, with an event key of repo:modified
, provides the following fields:
パラメーター | 説明 |
---|---|
古い | The details of the old version of the repository. |
new | The defaults of the current version of the repository. |
actor | The user who made the update. |
フォーク
ユーザーはリポジトリをフォークします。このペイロードには repo:fork
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user who forks the repository. This user is also the owner of the fork. |
repository | The new repository. |
repository.origin | The original repository that was forked. |
作成したコメントのコミット
ユーザーはリポジトリのコミットにコメントを追加します。このペイロードには repo:comment:added
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user who comments on the commit. |
comment | The comment created. |
repository | The repository with the commit. |
commit | The hash. |
Commit edit on comment
A user edits a comment on a commit in a repository. This payload, with an event key of repo:comment:edited
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who edits the commit. |
comment | The comment edited. |
previousComment | The text of the comment prior to editing. |
repository | The repository with the commit. |
commit | The hash of the commit. |
Comment deleted on commit
A user deletes a comment on a commit in a repository. This payload, with an event key of repo:comment:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who deletes the commit. |
comment | The comment deleted. |
repository | The repository with the commit. |
commit | The hash of the commit. |
Mirror synchronized
A mirror has finished synchronizing this repository. This payload, with an event key of mirror:repo_synchronized
, provides the following fields:
パラメーター | 説明 |
---|---|
mirrorServer | The mirror which synchronized the changes. This JSON object contains both the name and the id of the mirrorServer which synchronized the changes. |
syncType | The sync type the mirror used to synchronize the changes which are announced by this webhook. This value can be |
repository | The repository. |
repository.links | This JSON object contains the HTTP and SSH clone URLs of the primary server as well as the mirror that synchronized these changes. It also contains a link to view this repository in Bitbucket. |
変更 | The ref changes for this push. |
refLimitExceeded | If this value is true , the list of changes will be empty because it exceeded the limit of refs that can be included. |
Secret detected
A user pushes one or more commits that contain a secret to a repository. This payload, with an event key of repo:secret_detected,
provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who pushed the commits. |
secretLocations | The details of the commits that contain a secret. |
プル リクエスト イベント
プル リクエストで発生する次のイベントのために webhook を作成できます。
Opened
パラメーター | 説明 |
---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
Source branch updated
パラメーター | 説明 |
---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
previousFromHash | Previous from-ref hash |
Target branch updated
The Target branch updated webhook isn't available due to the following bug: - BSERV-14136Getting issue details... STATUS . Share your feedback in this Jira issue or start watching it to follow the updates.
パラメーター | 説明 |
---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
previousToHash | Previous to-ref hash |
最終変更日
パラメーター | 説明 |
---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
previousTitle | Previous title of the pull request, may not have changed |
previousDescription | Previous description of the pull request, may not have changed |
previousTarget | Previous target of the pull request, may not have changed |
previousDraft | Previous draft status of the pull request, may not have changed Learn more about draft pull requests |
Reviewers Updated
パラメーター | 説明 |
---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
removedReviewers | Users that are no longer reviewers |
addedReviewers | Users that have been added as reviewers |
承認
ユーザーによるリポジトリでのプル リクエストの承認です。このペイロードには pr:reviewer:approved
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user which made the approval. |
pullrequest | Details of the pull request approved. |
参加者 | Details of the PR participant status of the user making the change |
previousStatus | The state of the approval before this change |
Unapproved
ユーザーによるリポジトリでのプル リクエストからの承認の削除です。このペイロードには pr:reviewer:unapproved
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user which removed the approval. |
pullrequest | Details of the pull request unapproved. |
参加者 | Details of the PR participant status of the user making the change |
previousStatus | The state of the approval before this change |
Changes requested
A user marks a pull request as changes requested. This payload, with an event key of pr:reviewer:changes requested, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who marked the PR as "Changes requested". |
pullrequest | Details of the pull request marked "Changes requested". |
参加者 | Details of the PR participant status of the user making the change. |
previousStatus | The state of the approval before this change. |
マージ
A user merges a pull request for a repository. This payload, with an event key of pr:merged
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who merged the pull request. |
pullrequest | Details of the pull request merged. |
却下
ユーザーによるリポジトリでのプル リクエストの却下です。このペイロードには pr:declined
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user who declined the pull request. |
pullrequest | Details of the pull request declined. |
Deleted
A user deletes a pull request for a repository. This payload, with an event key of pr:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user who deleted the pull request. |
pullrequest | Details of the pull request deleted. |
コメント追加時
ユーザーによるプル リクエストへのコメント追加です。このペイロードには pr:comment:added
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user that created the comment. |
pullRequest | The pull request comment on. |
comment | The comment created. |
commentParentId | Id of the parent comment if one exists. |
コメント編集時
このペイロードには pr:comment:edited
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | The user that edited the comment. |
pullRequest | The pull request where the comment exists. |
comment | The comment edited. |
commentParentId | Id of the parent comment if one exists. |
previousComment | Text of the previous comment. |
コメントの削除
A user deletes a comment on a pull request. This payload, with an event key of pr:comment:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | The user that deleted the comment. |
pullRequest | The pull request where the comment existed. |
comment | The comment deleted. |
commentParentId | Id of the parent comment if one exists. |