Github API

Getting access, Developing, Testing

Back to Github

Create an organization webhook

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

Input

type: object properties: parameters: type: object properties: org: type: string description: The organization name. The name is not case sensitive. required: - org title: Parameters data: type: object properties: name: type: string description: Must be passed as "web". config: type: object properties: url: type: string description: The URL to which the payloads will be delivered. example: https://example.com/webhook format: uri content_type: type: string description: >- The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. example: '"json"' secret: type: string description: >- 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/webhooks/event-payloads/#delivery-headers). example: '"********"' insecure_ssl: oneOf: - type: string description: >- Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** example: '"0"' - type: number username: type: string example: '"kdaigle"' password: type: string example: '"password"' events: type: array description: >- Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. default: - push items: type: string active: type: boolean description: >- Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. default: true title: Data

Output

type: object title: Org Hook properties: id: type: integer example: 1 url: type: string format: uri example: https://api.github.com/orgs/octocat/hooks/1 ping_url: type: string format: uri example: https://api.github.com/orgs/octocat/hooks/1/pings deliveries_url: type: string format: uri example: https://api.github.com/orgs/octocat/hooks/1/deliveries name: type: string example: web events: type: array items: type: string active: type: boolean example: true config: type: object properties: url: type: string example: '"http://example.com/2"' insecure_ssl: type: string example: '"0"' content_type: type: string example: '"form"' secret: type: string example: '"********"' updated_at: type: string format: date-time example: '2011-09-06T20:39:23.000Z' created_at: type: string format: date-time example: '2011-09-06T17:26:27.000Z' type: type: string