User Tools

Site Tools


wiki:github_webhooks_via_api_calls

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

wiki/github_webhooks_via_api_calls.txt · Last modified: 2024/05/15 15:33 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki