GitHub v3 REST API

Get a pre-receive hook for a repository

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}

Path Parameters

ownerstringrequired
repostringrequired
pre_receive_hook_idintegerrequired

pre_receive_hook_id parameter

Response

200 application/json

Response

repository-pre-receive-hook

idinteger
namestring
enforcementstring
configuration_urlstring
get/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}
 
200 application/json

Update pre-receive hook enforcement for a repository

For pre-receive hooks which are allowed to be configured at the repo level, you can set enforcement

patch
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}

Path Parameters

ownerstringrequired
repostringrequired
pre_receive_hook_idintegerrequired

pre_receive_hook_id parameter

Body

application/json
enforcementstring

The state of enforcement for the hook on this repository.

Allowed values:enableddisabledtesting

Response

200 application/json

Response

repository-pre-receive-hook

idinteger
namestring
enforcementstring
configuration_urlstring
patch/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}

Body

{ "enforcement": "enabled" }
 
200 application/json

Remove pre-receive hook enforcement for a repository

Deletes any overridden enforcement on this repository for the specified hook.

Responds with effective values inherited from owner and/or global level.

delete
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}

Path Parameters

ownerstringrequired
repostringrequired
pre_receive_hook_idintegerrequired

pre_receive_hook_id parameter

Response

200 application/json

Responds with effective values inherited from owner and/or global level.

repository-pre-receive-hook

idinteger
namestring
enforcementstring
configuration_urlstring
delete/repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}
 
200 application/json

Get the configuration status

This endpoint allows you to check the status of the most recent configuration process:

Note that you may need to wait several seconds after you start a process before you can check its status.

The different statuses are:

Status Description
PENDING The job has not started yet
CONFIGURING The job is running
DONE The job has finished correctly
FAILED The job has finished unexpectedly
get
{protocol}://{hostname}/api/v3/setup/api/configcheck

Response

200 application/json

Response

configuration-status

statusstring
progressarray[object]
Show Child Parameters
get/setup/api/configcheck
 
200 application/json

Start a configuration process

This endpoint allows you to start a configuration process at any time for your updated settings to take effect:

post
{protocol}://{hostname}/api/v3/setup/api/configure

Response

202

Response

post/setup/api/configure
 
202