Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 1.94 KB

createWebhook.md

File metadata and controls

85 lines (60 loc) · 1.94 KB
name example route scope type
Create an organization webhook
octokit.rest.orgs.createWebhook({ org, name, config, config.url })
POST /orgs/{org}/hooks
orgs
API method

Create an organization webhook

Here's how you can create a hook that posts payloads in JSON format:

octokit.rest.orgs.createWebhook({
        org,
name,
config,
config.url
      })

Parameters

name required description
orgyes

The organization name. The name is not case sensitive.

nameyes

Must be passed as "web".

configyes

Key/value pairs to provide settings for this webhook.

config.urlyes

The URL to which the payloads will be delivered.

config.content_typeno

The media type used to serialize the payloads. Supported values include json and form. The default is form.

config.secretno

If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

config.insecure_sslno
config.usernameno
config.passwordno
eventsno

Determines what events the hook is triggered for. Set to ["*"] to receive all possible events.

activeno

Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.

See also: GitHub Developer Guide documentation.