Repo administrators can add a POST service to a repository. bitbucket POSTs to the service URL you specify. The service receives an POST whenever user pushes to the repository. This services behaves similarly to an HTTP publish/subscribe service.
You need administrator permission for the repository, to have access to the bitbucket Admin tab. See Repository privacy, permissions, and more.
Setting Up the Service
- Go to the Bitbucket Admin tab.
- Click Services in the Additional options/settings section on the right-hand side of the screen.
- Select the POST service from the dropdown list in the Services Administration section.
- Click Add service.
A new section appears for the POST service:
- Enter the URL to which Bitbucket should send its update messages.
- Click Save settings.
POST Data
When a user makes a push against a repository, bitbucket POSTs to the URL you provided. The body of POST request contains information about the repository where the change originated, a list of commits, and the user that made the push.
Example






15 Comments
Hide/Show CommentsApr 05, 2011
Anonymous
This has not worked for the last couple of weeks, having previously been not working or intermittently working over the last six months.
This is breaking our ability to do cool things continuous-integration-wise and making it hard for me to keep my boss from insisting that we use someone else.
Apr 05, 2011
Justen Stepka
Thank you for reporting this. We've created an issue to track this and will sort this out during our upcoming iteration:
Apr 28, 2011
Owen Jacobson
Is there any support for HTTP Basic authentication? I'd like to permit Bitbucket to trigger Jenkins builds, but I don't want to permit random internet people to do the same thing. Firewall rules are a poor alternative.
Apr 29, 2011
Justen Stepka
Have you tried http(s)://user:pass@host/ ?
Dec 19, 2011
Jeffrey Fisher
I just tried
and it tells me the repository url is incorrect or the service is not responding.
Oops, I posted this in the wrong place, but it still doesn't work.
Jun 21, 2011
Anonymous
I am looking for a possibility to parameterize the post-string with the highest branch number available in the bitbucket repository, something like http://localhost:8080/job/abc/build?branch=$
.
Whereby the vaule of $
is automatically calculated.
Any suggestions?
Maybe I could write my own custom Bitbucket POST service as a plugin, but how can I develop and deploy it?
Jun 21, 2011
Anonymous
I am looking for a possibility to parameterize the post-string with the highest branch number available in the bitbucket repository, something like http://localhost:8080/job/abc/build?branch=$\[highest-available-branch-number\].
Whereby the vaule of $[highest-available-branch-number] is automatically calculated.
Any suggestions?
Maybe I could write my own custom Bitbucket POST service as a plugin, but how can I develop and deploy it?
Jul 29, 2011
Anonymous
Is this broken again? It's not working for me, I know the URL works because I can test it manually and my CI machine builds, however after committing to bitbucket my build is not kicked off.
Aug 01, 2011
Justen Stepka
Verified that this is working as of this morning.
https://bitbucket.org/site/master/issue/2900/post-service
Aug 17, 2011
Anonymous
Is there any specific address range we can limit our firewall rules to for this service?
Mar 27, 2012
Alisson Sales
I think this page is outdated. I have tested the POST service and my server received a POST request with the parameters below.
{"payload"=>"{"repository": {"website": "", "fork": false, "name": "MyRepoName", "scm": "git", "absolute_url": "MyRepoUrl", "owner": "Owner", "slug": "MyRepoSlug", "is_private": true}, "commits": [{"node": "d1403d93e9fb", "files": [{"type": "added", "file": "test_hook"}], "branch": "master", "utctimestamp": "2012-03-27 15:12:59+00:00", "author": "alissonsales", "timestamp": "2012-03-27 17:12:59", "raw_node": "d1403d93e9fb4d5e2f59db154b55d2609b628f28", "parents": ["c23fcd11dcae"], "raw_author": "Alisson Sales <email@domain.com>", "message": "Test bitbucket hook\\n", "size": -1, "revision": null}], "canon_url": "https://bitbucket.org", "user": "alissonsales"}", "token"=>"MyRepoToken"}
The request comes with only 2 parameters, payload, which appears to be a JSON, and the repository token.
Mar 27, 2012
Mary Anthony [Atlassian]
Alisson,
You are correct the page is outdated. I'm about to embark on a rewrite of all our REST APIs.
Mary
May 02, 2012
Andrew Elster
Are there any plans to enable merged pull requests to trigger a POST?
May 03, 2012
Anonymous
Can you add tags info to the POST payload?
May 04, 2012
Mary Anthony [Atlassian]
This is an enhancement request you are making. The documentation is not a good place for those. Please go to: https://bitbucket.org/site/master/issues/new for making enhancement requests.
Add Comment