GitHub v3 REST API

List global webhooks

get
{protocol}://{hostname}/api/v3/admin/hooks

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Headers

acceptstringrequired

This API is under preview and subject to change.

Default:application/vnd.github.superpro-preview+json

Response

200 application/json

Response

typestring
idinteger
namestring
activeboolean
eventsarray[string]
configobject
Show Child Parameters
updated_atstring
created_atstring
urlstring
ping_urlstring
get/admin/hooks
 
200 application/json

Create a global webhook

post
{protocol}://{hostname}/api/v3/admin/hooks

Headers

acceptstringrequired

This API is under preview and subject to change.

Default:application/vnd.github.superpro-preview+json

Body

application/json
namestringrequired

Must be passed as “web”.

configobjectrequired

Key/value pairs to provide settings for this webhook.

Show Child Parameters
eventsarray[string]

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

activeboolean

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

Default:true

Response

201 application/json

Response

global-hook

typestring
idinteger
namestring
activeboolean
eventsarray[string]
configobject
Show Child Parameters
updated_atstring
created_atstring
urlstring
ping_urlstring
post/admin/hooks

Body

{ "name": "web", "events": [ "organization", "user" ], "config": { "url": "https://example.com/webhook", "content_type": "json", "secret": "secret" } }
 
201 application/json

Get a global webhook

get
{protocol}://{hostname}/api/v3/admin/hooks/{hook_id}

Path Parameters

hook_idintegerrequired

Headers

acceptstringrequired

This API is under preview and subject to change.

Default:application/vnd.github.superpro-preview+json

Response

200 application/json

Response

global-hook

typestring
idinteger
namestring
activeboolean
eventsarray[string]
configobject
Show Child Parameters
updated_atstring
created_atstring
urlstring
ping_urlstring
get/admin/hooks/{hook_id}
 
200 application/json

Update a global webhook

Parameters that are not provided will be overwritten with the default value or removed if no default exists.

patch
{protocol}://{hostname}/api/v3/admin/hooks/{hook_id}

Path Parameters

hook_idintegerrequired

Headers

acceptstringrequired

This API is under preview and subject to change.

Default:application/vnd.github.superpro-preview+json

Body

application/json
configobject

Key/value pairs to provide settings for this webhook.

Show Child Parameters
eventsarray[string]

The events that trigger this webhook. A global webhook can be triggered by user and organization events. Default: user and organization.

activeboolean

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

Default:true

Response

200 application/json

Response

global-hook-2

typestring
idinteger
namestring
activeboolean
eventsarray[string]
configobject
Show Child Parameters
updated_atstring
created_atstring
urlstring
ping_urlstring
patch/admin/hooks/{hook_id}

Body

{ "events": [ "organization" ], "config": { "url": "https://example.com/webhook" } }
 
200 application/json

Delete a global webhook

delete
{protocol}://{hostname}/api/v3/admin/hooks/{hook_id}

Path Parameters

hook_idintegerrequired

Headers

acceptstringrequired

This API is under preview and subject to change.

Default:application/vnd.github.superpro-preview+json

Response

204

Response

delete/admin/hooks/{hook_id}
 
204