Table of Contents

, , ,

Github webhooks via api calls

Get all webhooks

curl -H "Authorization: token TOKEN" --request GET https://api.github.com/repos/USERNAME/scripts_and_progs/hooks

Get specific webhook

curl -H "Authorization: token TOKEN" --request GET https://api.github.com/repos/USERNAME/scripts_and_progs/hooks/158835392

Create new webhook

curl -H "Authorization: token TOKEN" -H "Content-Type: application/json" --request POST \
--data '{"name": "web", "active": true, "events": ["pull_request"], "config": {"url": "https://bamboo.example.com/rest/triggers/latest/remote/changeDetection?planKey=TEST-TEST1", "content_type": "json", "insecure_ssl": "0"} }' \
https://api.github.com/repos/USERNAME/scripts_and_progs/hooks

Delete webhook

curl -H "Authorization: token TOKEN" --request DELETE https://api.github.com/repos/USERNAME/scripts_and_progs/hooks/158835392

Tested on

See also

References