Event payload

Managing webhooks in Bitbucket Server

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

When you have a webhook with an event, Bitbucket 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.

The following payloads contain some of the five common entity types – UserRepository,  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. 

HTTP headers

All event payload requests have the following HTTP headers:

HTTP header Description
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

repo:refs_changed.

X-Hub-Signature
See Webhook secrets

Repository events

You can create webhooks for the following events that occur in a repository.

Push

A user pushes one or more commits to a repository. This payload, with an event key of repo:refs_changed, provides the following fields:

Parameter Description
actor
The user who pushed the commits. 
repository
The repository with the commits.
changes
The details of the push.
repo:refs_changed payload
{  
  "eventKey":"repo:refs_changed",
  "date":"2017-09-19T09:45:32+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "repository":{  
    "slug":"repository",
    "id":84,
    "name":"repository",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  },
  "changes":[  
    {  
      "ref":{  
        "id":"refs/heads/master",
        "displayId":"master",
        "type":"BRANCH"
      },
      "refId":"refs/heads/master",
      "fromHash":"ecddabb624f6f5ba43816f5926e580a5f680a932",
      "toHash":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
      "type":"UPDATE"
    }
  ]
}

Modified

A user updates the Name of a repository. This payload, with an event key of repo:modified , provides the following fields:

Parameter Description
old

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:modified payload
{  
  "eventKey":"repo:modified",
  "date":"2017-09-19T09:51:20+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "old":{  
    "slug":"repository",
    "id":84,
    "name":"repository",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  },
  "new":{  
    "slug":"repository2",
    "id":84,
    "name":"repository2",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  }
}

Fork

A user forks a repository. This payload, with an event key of repo:fork, provides the following fields:

Parameter Description
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:forked payload
{  
  "eventKey":"repo:forked",
  "date":"2017-09-19T09:48:26+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "repository":{  
    "slug":"repository2",
    "id":86,
    "name":"repository2",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "origin":{  
      "slug":"repository",
      "id":84,
      "name":"repository",
      "scmId":"git",
      "state":"AVAILABLE",
      "statusMessage":"Available",
      "forkable":true,
      "project":{  
        "key":"PROJ",
        "id":84,
        "name":"project",
        "public":false,
        "type":"NORMAL"
      },
      "public":false
    },
    "project":{  
      "key":"~ADMIN",
      "id":22,
      "name":"Administrator",
      "type":"PERSONAL",
      "owner":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      }
    },
    "public":false
  }
}

Commit comment created

A user comments on a commit in a repository. This payload, with an event key of repo:comment:added, provides the following fields:

Parameter Description
actor
The user who comments on the commit.
comment
The comment created.
repository
The repository with the commit. 
commit
The hash.
repo:comment:added payload
{  
  "eventKey":"repo:comment:added",
  "date":"2017-09-19T09:53:06+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "comment":{  
    "properties":{  
      "repositoryId":84
    },
    "id":42,
    "version":0,
    "text":"This is a great line of code!",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505778786337,
    "updatedDate":1505778786337,
    "comments":[  

    ],
    "tasks":[  

    ],
    "permittedOperations":{  
      "editable":true,
      "deletable":true
    }
  },
  "repository":{  
    "slug":"repository",
    "id":84,
    "name":"repository",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  },
  "commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc"
}

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:

Parameter Description
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.
repo:comment:edited payload
{  
  "eventKey":"repo:comment:edited",
  "date":"2017-09-19T09:55:03+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "comment":{  
    "properties":{  
      "repositoryId":84
    },
    "id":42,
    "version":1,
    "text":"This is a okay line of code!",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505778786337,
    "updatedDate":1505778903525,
    "comments":[  

    ],
    "tasks":[  

    ],
    "permittedOperations":{  
      "editable":true,
      "deletable":true
    }
  },
  "repository":{  
    "slug":"repository",
    "id":84,
    "name":"repository",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  },
  "commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
  "previousComment":"This is a great line of code!"
}

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:

Parameter Description
actor
The user who deletes the commit.
comment
The comment deleted.
repository
The repository with the commit. 
commit
The hash of the commit.
repo:comment:deleted payload
{  
  "eventKey":"repo:comment:deleted",
  "date":"2017-09-19T09:56:29+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "comment":{  
    "id":42,
    "version":1,
    "text":"This is a okay line of code!",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505778786337,
    "updatedDate":1505778903525,
    "comments":[  

    ],
    "tasks":[  

    ]
  },
  "repository":{  
    "slug":"repository",
    "id":84,
    "name":"repository",
    "scmId":"git",
    "state":"AVAILABLE",
    "statusMessage":"Available",
    "forkable":true,
    "project":{  
      "key":"PROJ",
      "id":84,
      "name":"project",
      "public":false,
      "type":"NORMAL"
    },
    "public":false
  },
  "commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc"
}

Pull request events

You can create webhooks for the following events that occur on a pull request.

Opened

Parameter Description
actor
The user who created the pull request.
pullrequest
Details of the pull request created.
pr:opened payload
{  
  "eventKey":"pr:opened",
  "date":"2017-09-19T09:58:11+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":1,
    "version":0,
    "title":"a new file added",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505779091796,
    "updatedDate":1505779091796,
    "fromRef":{  
      "id":"refs/heads/a-branch",
      "displayId":"a-branch",
      "latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  

    ],
    "participants":[  

    ],
    "links":{  
      "self":[  
        null
      ]
    }
  }
}

Modified

Parameter Description
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 pull request, may not have changed
previousTarget Previous target of the pull request, may not have changed
pr:opened payload
{
  "eventKey": "pr:modified",
  "date": "2018-04-24T10:15:30+1000",
  "actor": {
    "name": "Administrator",
    "emailAddress": "example@atlassian.com",
    "id": 110653,
    "displayName": "Administrator",
    "active": true,
    "slug": "pathompson",
    "type": "NORMAL"
  },
  "pullRequest": {
    "id": 1,
    "version": 1,
    "title": "A new title",
    "description": "A new description",
    "state": "OPEN",
    "open": true,
    "closed": false,
    "createdDate": 1524528879329,
    "updatedDate": 1524528930110,
    "fromRef": {
      "id": "refs/heads/new-branch",
      "displayId": "new-branch",
      "latestCommit": "5a705e60111a4213da46839d9cbf4fc43639b771",
      "repository": {
        "slug": "example",
        "id": 12087,
        "name": "example",
        "scmId": "git",
        "state": "AVAILABLE",
        "statusMessage": "Available",
        "forkable": true,
        "project": {
          "key": "~ADMIN",
          "id": 8504,
          "name": "Administrator",
          "type": "PERSONAL",
          "owner": {
            "name": "Administrator",
            "emailAddress": "example@atlassian.com",
            "id": 110653,
            "displayName": "Administrator",
            "active": true,
            "slug": "admin",
            "type": "NORMAL"
          }
        },
        "public": false
      }
    },
    "toRef": {
      "id": "refs/heads/master",
      "displayId": "master",
      "latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
      "repository": {
        "slug": "example",
        "id": 12087,
        "name": "example",
        "scmId": "git",
        "state": "AVAILABLE",
        "statusMessage": "Available",
        "forkable": true,
        "project": {
          "key": "~ADMIN",
          "id": 8504,
          "name": "Administrator",
          "type": "PERSONAL",
          "owner": {
            "name": "Administrator",
            "emailAddress": "example@atlassian.com",
            "id": 110653,
            "displayName": "Administrator",
            "active": true,
            "slug": "admin",
            "type": "NORMAL"
          }
        },
        "public": false
      }
    },
    "locked": false,
    "author": {
      "user": {
        "name": "Administrator",
        "emailAddress": "example@atlassian.com",
        "id": 110653,
        "displayName": "Administrator",
        "active": true,
        "slug": "admin",
        "type": "NORMAL"
      },
      "role": "AUTHOR",
      "approved": false,
      "status": "UNAPPROVED"
    },
    "reviewers": [
      {
        "user": {
          "name": "User",
          "emailAddress": "user@atlassian.com",
          "id": 36303,
          "displayName": "User",
          "active": true,
          "slug": "user",
          "type": "NORMAL"
        },
        "role": "REVIEWER",
        "approved": false,
        "status": "UNAPPROVED"
      }
    ],
    "participants": [
      
    ]
  },
  "previousTitle": "A cool PR",
  "previousDescription": "A neat description",
  "previousTarget": {
    "id": "refs\/heads\/master",
    "displayId": "master",
    "type": "BRANCH",
    "latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
    "latestChangeset": "860c4eb4ed0f969b47144234ba13c31c498cca69"
  }
}

Reviewers Updated

Parameter Description
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:opened payload
{
  "eventKey": "pr:reviewer:updated",
  "date": "2018-04-24T10:20:07+1000",
  "actor": {
    "name": "Administrator",
    "emailAddress": "admin@atlassian.com",
    "id": 110653,
    "displayName": "Administrator",
    "active": true,
    "slug": "admin",
    "type": "NORMAL"
  },
  "pullRequest": {
    "id": 1,
    "version": 2,
    "title": "A title",
    "description": "A description",
    "state": "OPEN",
    "open": true,
    "closed": false,
    "createdDate": 1524528879329,
    "updatedDate": 1524529207598,
    "fromRef": {
      "id": "refs/heads/new-branch",
      "displayId": "new-branch",
      "latestCommit": "5a705e60111a4213da46839d9cbf4fc43639b771",
      "repository": {
        "slug": "example",
        "id": 12087,
        "name": "example",
        "scmId": "git",
        "state": "AVAILABLE",
        "statusMessage": "Available",
        "forkable": true,
        "project": {
          "key": "~ADMIN",
          "id": 8504,
          "name": "Administrator",
          "type": "PERSONAL",
          "owner": {
            "name": "admin",
            "emailAddress": "example@atlassian.com",
            "id": 110653,
            "displayName": "Administrator",
            "active": true,
            "slug": "admin",
            "type": "NORMAL"
          }
        },
        "public": false
      }
    },
    "toRef": {
      "id": "refs/heads/master",
      "displayId": "master",
      "latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
      "repository": {
        "slug": "example",
        "id": 12087,
        "name": "example",
        "scmId": "git",
        "state": "AVAILABLE",
        "statusMessage": "Available",
        "forkable": true,
        "project": {
          "key": "~ADMIN",
          "id": 8504,
          "name": "Administrator",
          "type": "PERSONAL",
          "owner": {
            "name": "Administrator",
            "emailAddress": "admin@atlassian.com",
            "id": 110653,
            "displayName": "Administrator",
            "active": true,
            "slug": "admin",
            "type": "NORMAL"
          }
        },
        "public": false
      }
    },
    "locked": false,
    "author": {
      "user": {
        "name": "Administrator",
        "emailAddress": "admin@atlassian.com",
        "id": 110653,
        "displayName": "Administrator",
        "active": true,
        "slug": "admin",
        "type": "NORMAL"
      },
      "role": "AUTHOR",
      "approved": false,
      "status": "UNAPPROVED"
    },
    "reviewers": [
      {
        "user": {
          "name": "pathompson_admin",
          "emailAddress": "pathompson@atlassian.com",
          "id": 129659,
          "displayName": "Paul Thompson Admin",
          "active": true,
          "slug": "pathompson_admin",
          "type": "NORMAL"
        },
        "role": "REVIEWER",
        "approved": false,
        "status": "UNAPPROVED"
      }
    ],
    "participants": [
      
    ]
  },
  "addedReviewers": [
    {
      "name": "new user",
      "emailAddress": "user2@atlassian.com",
      "id": 129659,
      "displayName": "New User",
      "active": true,
      "slug": "new_user",
      "type": "NORMAL"
    }
  ],
  "removedReviewers": [
    {
      "name": "user",
      "emailAddress": "user@atlassian.com",
      "id": 36303,
      "displayName": "User",
      "active": true,
      "slug": "user",
      "type": "NORMAL"
    }
  ]
}

Approved

A user approves a pull request for a repository. This payload, with an event key of pr:reviewer:approved, provides the following fields:

Parameter Description
actor
The user which made the approval.
pullrequest
Details of the pull request approved.
participant
Details of the PR participant status of the user making the change
previousStatus
The state of the approval before this change
pr:reviewer:approved
{  
  "eventKey":"pr:reviewer:approved",
  "date":"2017-09-19T10:10:01+1000",
  "actor":{  
    "name":"user",
    "emailAddress":"user@example.com",
    "id":2,
    "displayName":"User",
    "active":true,
    "slug":"user",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":1,
    "version":1,
    "title":"a new file added",
    "description":"A new description, added a user",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505779091796,
    "updatedDate":1505779257496,
    "fromRef":{  
      "id":"refs/heads/a-branch",
      "displayId":"a-branch",
      "latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
        "role":"REVIEWER",
        "approved":true,
        "status":"APPROVED"
      }
    ],
    "participants":[  

    ],
    "links":{  
      "self":[  
        null
      ]
    }
  },
  "participant":{  
    "user":{  
      "name":"user",
      "emailAddress":"user@example.com",
      "id":2,
      "displayName":"User",
      "active":true,
      "slug":"user",
      "type":"NORMAL"
    },
    "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
    "role":"REVIEWER",
    "approved":true,
    "status":"APPROVED"
  },
  "previousStatus":"UNAPPROVED"
}

Unapproved

A user removes an approval from a pull request for a repository. This payload, with an event key of pr:reviewer:unapproved, provides the following fields:

Parameter Description
actor
The user which removed the approval.
pullrequest
Details of the pull request unapproved.
participant
Details of the PR participant status of the user making the change
previousStatus
The state of the approval before this change
pr:reveiwer:unapproved payload
{  
  "eventKey":"pr:reviewer:unapproved",
  "date":"2017-09-19T10:13:43+1000",
  "actor":{  
    "name":"user",
    "emailAddress":"user@example.com",
    "id":2,
    "displayName":"User",
    "active":true,
    "slug":"user",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":1,
    "version":1,
    "title":"a new file added",
    "description":"A new description, added a user",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505779091796,
    "updatedDate":1505779257496,
    "fromRef":{  
      "id":"refs/heads/a-branch",
      "displayId":"a-branch",
      "latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
        "role":"REVIEWER",
        "approved":false,
        "status":"UNAPPROVED"
      }
    ],
    "participants":[  

    ]
  },
  "participant":{  
    "user":{  
      "name":"user",
      "emailAddress":"user@example.com",
      "id":2,
      "displayName":"User",
      "active":true,
      "slug":"user",
      "type":"NORMAL"
    },
    "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
    "role":"REVIEWER",
    "approved":false,
    "status":"UNAPPROVED"
  },
  "previousStatus":"APPROVED"
}

Needs work

A user marks a pull request as needs work. This payload, with an event key of pr:reviewer:needs_work, provides the following fields:

Parameter Description
actor
The user which marked the PR as "Needs work".
pullrequest
Details of the pull request marked "Needs work".
participant
Details of the PR participant status of the user making the change.
previousStatus
The state of the approval before this change.
pr:reviewer:needs_work payload
{  
  "eventKey":"pr:reviewer:needs_work",
  "date":"2017-09-19T10:14:47+1000",
  "actor":{  
    "name":"user",
    "emailAddress":"user@example.com",
    "id":2,
    "displayName":"User",
    "active":true,
    "slug":"user",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":1,
    "version":1,
    "title":"a new file added",
    "description":"A new description, added a user",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505779091796,
    "updatedDate":1505779257496,
    "fromRef":{  
      "id":"refs/heads/a-branch",
      "displayId":"a-branch",
      "latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
        "role":"REVIEWER",
        "approved":false,
        "status":"NEEDS_WORK"
      }
    ],
    "participants":[  

    ]
  },
  "participant":{  
    "user":{  
      "name":"user",
      "emailAddress":"user@example.com",
      "id":2,
      "displayName":"User",
      "active":true,
      "slug":"user",
      "type":"NORMAL"
    },
    "lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
    "role":"REVIEWER",
    "approved":false,
    "status":"NEEDS_WORK"
  },
  "previousStatus":"UNAPPROVED"
}

Merged

A user merges a pull request for a repository. This payload, with an event key of pullrequest:fulfilled, provides the following fields:

Parameter Description
actor
The user who merged the pull request.
pullrequest
Details of the pull request merged.
pr:merged payload
{  
  "eventKey":"pr:merged",
  "date":"2017-09-19T10:39:36+1000",
  "actor":{  
    "name":"user",
    "emailAddress":"user@example.com",
    "id":2,
    "displayName":"User",
    "active":true,
    "slug":"user",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":9,
    "version":2,
    "title":"file edited online with Bitbucket",
    "state":"MERGED",
    "open":false,
    "closed":true,
    "createdDate":1505781560908,
    "updatedDate":1505781576361,
    "closedDate":1505781576361,
    "fromRef":{  
      "id":"refs/heads/admin/file-1505781548644",
      "displayId":"admin/file-1505781548644",
      "latestCommit":"45f9690c928915a5e1c4366d5ee1985eea03f05d",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"8d2ad38c918fa6943859fca2176c89ea98b92a21",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  

    ],
    "participants":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "role":"PARTICIPANT",
        "approved":false,
        "status":"UNAPPROVED"
      }
    ],
    "properties":{  
      "mergeCommit":{  
        "displayId":"7e48f426f0a",
        "id":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c"
      }
    },
  }
}

Declined

A user declines a pull request for a repository. This payload, with an event key of pr:declined, provides the following fields:

Parameter Description
actor
The user who declined the pull request.
pullrequest
Details of the pull request declined.
pr:declined
{  
  "eventKey":"pr:declined",
  "date":"2017-09-19T11:14:43+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":10,
    "version":2,
    "title":"Commit message",
    "state":"DECLINED",
    "open":false,
    "closed":true,
    "createdDate":1505783668760,
    "updatedDate":1505783683969,
    "closedDate":1505783683969,
    "fromRef":{  
      "id":"refs/heads/decline-me",
      "displayId":"decline-me",
      "latestCommit":"2d9fb6b9a46eafb1dcef7b008d1a429d45ca742c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "role":"REVIEWER",
        "approved":false,
        "status":"UNAPPROVED"
      }
    ],
    "participants":[  

    ]
  }
}

Deleted

A user deletes a pull request for a repository. This payload, with an event key of pr:deleted, provides the following fields:

Parameter Description
actor
The user who deleted the pull request.
pullrequest
Details of the pull request deleted.
pr:deleted
{  
  "eventKey":"pr:deleted",
  "date":"2017-09-19T11:16:17+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":10,
    "version":3,
    "title":"Commit message",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505783668760,
    "updatedDate":1505783750704,
    "fromRef":{  
      "id":"refs/heads/decline-me",
      "displayId":"decline-me",
      "latestCommit":"2d9fb6b9a46eafb1dcef7b008d1a429d45ca742c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  
      {  
        "user":{  
          "name":"user",
          "emailAddress":"user@example.com",
          "id":2,
          "displayName":"User",
          "active":true,
          "slug":"user",
          "type":"NORMAL"
        },
        "role":"REVIEWER",
        "approved":false,
        "status":"UNAPPROVED"
      }
    ],
    "participants":[  

    ]
  }
}

Comment added

A user comments on a pull request. This payload, with an event key of pr:comment:added, provides the following fields:

Parameter Description
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:added payload
{  
  "eventKey":"pr:comment:added",
  "date":"2017-09-19T11:21:06+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":11,
    "version":1,
    "title":"A cool PR",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505783860548,
    "updatedDate":1505783878981,
    "fromRef":{  
      "id":"refs/heads/comment-pr",
      "displayId":"comment-pr",
      "latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  

    ],
    "participants":[  

    ]
  },
  "comment":{  
    "properties":{  
      "repositoryId":84
    },
    "id":62,
    "version":0,
    "text":"I am a PR comment",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505784066751,
    "updatedDate":1505784066751,
    "comments":[  

    ],
    "tasks":[  

    ]
  },
  "commentParentId":43
}

Comment edited

This payload, with an event key of pr:comment:edited, provides the following fields:

Parameter Description
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.
pr:comment:edited payload
{  
  "eventKey":"pr:comment:edited",
  "date":"2017-09-19T11:24:19+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":11,
    "version":1,
    "title":"A cool PR",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505783860548,
    "updatedDate":1505783878981,
    "fromRef":{  
      "id":"refs/heads/comment-pr",
      "displayId":"comment-pr",
      "latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  

    ],
    "participants":[  

    ]
  },
  "comment":{  
    "properties":{  
      "repositoryId":84
    },
    "id":62,
    "version":1,
    "text":"I am a PR comment that was edited",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505784066751,
    "updatedDate":1505784259446,
    "comments":[  

    ],
    "tasks":[  

    ]
  },
  "commentParentId":43,
  "previousComment":"I am a PR comment"
}

Comment deleted

A user deletes a comment on a pull request. This payload, with an event key of pr:comment:deleted, provides the following fields:

Parameter Description
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.
pr:comment:deleted payload
{  
  "eventKey":"pr:comment:deleted",
  "date":"2017-09-19T11:25:47+1000",
  "actor":{  
    "name":"admin",
    "emailAddress":"admin@example.com",
    "id":1,
    "displayName":"Administrator",
    "active":true,
    "slug":"admin",
    "type":"NORMAL"
  },
  "pullRequest":{  
    "id":11,
    "version":1,
    "title":"A cool PR",
    "state":"OPEN",
    "open":true,
    "closed":false,
    "createdDate":1505783860548,
    "updatedDate":1505783878981,
    "fromRef":{  
      "id":"refs/heads/comment-pr",
      "displayId":"comment-pr",
      "latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "toRef":{  
      "id":"refs/heads/master",
      "displayId":"master",
      "latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
      "repository":{  
        "slug":"repository",
        "id":84,
        "name":"repository",
        "scmId":"git",
        "state":"AVAILABLE",
        "statusMessage":"Available",
        "forkable":true,
        "project":{  
          "key":"PROJ",
          "id":84,
          "name":"project",
          "public":false,
          "type":"NORMAL"
        },
        "public":false
      }
    },
    "locked":false,
    "author":{  
      "user":{  
        "name":"admin",
        "emailAddress":"admin@example.com",
        "id":1,
        "displayName":"Administrator",
        "active":true,
        "slug":"admin",
        "type":"NORMAL"
      },
      "role":"AUTHOR",
      "approved":false,
      "status":"UNAPPROVED"
    },
    "reviewers":[  

    ],
    "participants":[  

    ]
  },
  "comment":{  
    "id":62,
    "version":1,
    "text":"I am a PR comment that was edited",
    "author":{  
      "name":"admin",
      "emailAddress":"admin@example.com",
      "id":1,
      "displayName":"Administrator",
      "active":true,
      "slug":"admin",
      "type":"NORMAL"
    },
    "createdDate":1505784066751,
    "updatedDate":1505784259446,
    "comments":[  

    ],
    "tasks":[  

    ]
  },
  "commentParentId":43
}
Last modified on Oct 19, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.