Skip to main content

Create an organization webhook

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

POST/orgs/{org}/hooks
Source
github-v3-rest.json
Revision
f5f067c1e6f6
Active snapshot
85e53e3d0d65

Request

Path Parameters
org string
required
Body Params
required
application/jsonobject
active boolean
optional

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

config object
required

Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/[email protected]/rest/reference/orgs#create-hook-config-params).

content_type webhook-config-content-type string
optional

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

Example: "json"

insecure_ssl webhook-config-insecure-ssl
optional
password string
optional

Example: "password"

secret webhook-config-secret string
optional

If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/[email protected]/webhooks/event-payloads/#delivery-headers).

Example: "********"

url webhook-config-url string<uri>
required

The URL to which the payloads will be delivered.

Example: https://example.com/webhook

username string
optional

Example: "kdaigle"

events array[string]
optional

Determines what [events](https://docs.github.com/[email protected]/webhooks/event-payloads) the hook is triggered for.

name string
required

Must be passed as "web".

Responses

application/json Org Hook object

Response

Headers
Location string

Example: https://api.github.com/orgs/octocat/hooks/1

active boolean
required

Example: true

config object
required
content_type string
optional

Example: "form"

insecure_ssl string
optional

Example: "0"

secret string
optional

Example: "********"

url string
optional

Example: "http://example.com/2"

created_at string<date-time>
required

Example: 2011-09-06T17:26:27Z

events array[string]
required
Example:
[
  "push",
  "pull_request"
]
id integer
required

Example: 1

name string
required

Example: web

ping_url string<uri>
required

Example: https://api.github.com/orgs/octocat/hooks/1/pings

type string
required
updated_at string<date-time>
required

Example: 2011-09-06T20:39:23Z

url string<uri>
required

Example: https://api.github.com/orgs/octocat/hooks/1

application/json Basic Error object

Resource not found

documentation_url string
optional
message string
optional
status string
optional
url string
optional
application/json Validation Error object

Validation failed

documentation_url string
required
errors array[object]
optional
items object
code string
required
field string
optional
index integer
optional
message string
optional
resource string
optional
value
optional
message string
required