Skip to main content

webhooks

Overview

Namewebhooks
TypeResource
Idgithub.repos.webhooks

Fields

NameDatatypeDescription
idintegerUnique identifier of the webhook.
namestringThe name of a valid service, use 'web' for a webhook.
activebooleanDetermines whether the hook is actually triggered on pushes.
configobject
created_atstring
deliveries_urlstring
eventsarrayDetermines what events the hook is triggered for. Default: ['push'].
last_responseobject
ping_urlstring
test_urlstring
typestring
updated_atstring
urlstring

Methods

NameAccessible byRequired ParamsDescription
get_webhookSELECThook_id, owner, repoReturns a webhook configured in a repository. To get only the webhook config properties, see "Get a webhook configuration for a repository."
list_webhooksSELECTowner, repoLists webhooks for a repository. last response may return null if there have not been any deliveries within 30 days.
create_webhookINSERTowner, repoRepositories 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.
delete_webhookDELETEhook_id, owner, repo
ping_webhookEXEChook_id, owner, repoThis will trigger a ping event to be sent to the hook.
test_push_webhookEXEChook_id, owner, repoThis will trigger the hook with the latest push to the current repository if the hook is subscribed to push events. If the hook is not subscribed to push events, the server will respond with 204 but no test POST will be generated.

Note: Previously /repos/:owner/:repo/hooks/:hook_id/test
update_webhookEXEChook_id, owner, repoUpdates a webhook configured in a repository. If you previously had a secret set, you must provide the same secret or set a new secret or the secret will be removed. If you are only updating individual webhook config properties, use "Update a webhook configuration for a repository."