It's kinda shoddy that we failed to document that properly. Anyway, here's how you add a POST service that posts to google.com:
$ curl -X POST https://username:passwd@bitbucket.org/api/1.0/repositories/evzijst/interruptingcow/services \
-d type=POST -d URL=http://google.com
{
"id": 507781,
"service": {
"fields": [
{
"name": "URL",
"value": "http://google.com"
}
],
"type": "POST"
}
}
The way this endpoint works is that you always specify the "type" parameter which must contain the name of the service (as presented in the dropdown menu) and then configure it by passing additional post parameters.
Each service has its own configuration parameters. You can find out by simply adding the service on a repo and looking at the fields. Your parameters must match the available fields:
Individual parameters can be modified by doing a PUT.