GitHub v3 REST API

List organization webhooks

get
http://HOSTNAME/api/v3/orgs/{org}/hooks

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

orgstringrequired

Response

application/json

Response

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

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

ping_urlstring(uri)required

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

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

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

created_atstring(date-time)required

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

typestringrequired
get/orgs/{org}/hooks
 
application/json

Create an organization webhook

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

post
http://HOSTNAME/api/v3/orgs/{org}/hooks

Path Parameters

orgstringrequired

Body

application/json
namestringrequired

Must be passed as “web”.

configobjectrequired

Key/value pairs to provide settings for this webhook. These are defined below.

Show Child Parameters
eventsarray[string]

Determines what events the hook is triggered for.

Default:push

activeboolean

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

Default:true

Response

application/json

Response

Org Hook

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

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

ping_urlstring(uri)required

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

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

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

created_atstring(date-time)required

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

typestringrequired
post/orgs/{org}/hooks

Body

{ "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com/webhook", "content_type": "json" } }
 
application/json

Get an organization webhook

Returns a webhook configured in an organization. To get only the webhook config properties, see “Get a webhook configuration for an organization.”

get
http://HOSTNAME/api/v3/orgs/{org}/hooks/{hook_id}

Path Parameters

orgstringrequired
hook_idintegerrequired

Response

application/json

Response

Org Hook

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

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

ping_urlstring(uri)required

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

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

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

created_atstring(date-time)required

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

typestringrequired
get/orgs/{org}/hooks/{hook_id}
 
application/json

Update an organization webhook

Updates a webhook configured in an organization. When you update a webhook, the secret will be overwritten. 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 an organization.”

patch
http://HOSTNAME/api/v3/orgs/{org}/hooks/{hook_id}

Path Parameters

orgstringrequired
hook_idintegerrequired

Body

application/json
configobject

Key/value pairs to provide settings for this webhook. These are defined below.

Show Child Parameters
eventsarray[string]

Determines what events the hook is triggered for.

Default:push

activeboolean

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

Default:true

namestring

Example:"web"

Response

application/json

Response

Org Hook

Org Hook

idintegerrequired

Example:1

urlstring(uri)required

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

ping_urlstring(uri)required

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

namestringrequired

Example:web

eventsarray[string]required

Example:["push","pull_request"]

activebooleanrequired

Example:true

configobjectrequired
Show Child Parameters
updated_atstring(date-time)required

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

created_atstring(date-time)required

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

typestringrequired
patch/orgs/{org}/hooks/{hook_id}

Body

{ "active": true, "events": [ "pull_request" ] }
 
application/json

Delete an organization webhook

delete
http://HOSTNAME/api/v3/orgs/{org}/hooks/{hook_id}

Path Parameters

orgstringrequired
hook_idintegerrequired

Response

Response

delete/orgs/{org}/hooks/{hook_id}