Create a repository webhook
POST {{baseUrl}}/repos/:owner/:repo/hooks
Repositories can have multiple webhooks installed. Each webhook should have a unique config
. Multiple webhooks can
share the same config
as long as those webhooks do not have any events
that overlap.
Request Body
{"config"=>{"url"=>"<string>", "content_type"=>"<string>", "secret"=>"<string>", "insecure_ssl"=>"<string>", "token"=>"<string>", "digest"=>"<string>"}, "name"=>"<string>", "events"=>["push"], "active"=>true}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: Created
{"type":"Repository","id":12345678,"name":"web","active":true,"events":["push","pull_request"],"config":{"content_type":"json","insecure_ssl":"0","url":"https://example.com/webhook"},"updated_at":"2019-06-03T00:57:16Z","created_at":"2019-06-03T00:57:16Z","url":"https://api.github.com/repos/octocat/Hello-World/hooks/12345678","test_url":"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test","ping_url":"https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings","last_response":{"code":null,"status":"unused","message":null}}