GitHub v3 REST API

Update a pre-receive environment

You cannot modify the default environment. If you attempt to modify the default environment, you will receive a 422 Unprocessable Entity response.

patch
http://HOSTNAME/api/v3/admin/pre-receive-environments/{pre_receive_environment_id}

Path Parameters

pre_receive_environment_idintegerrequired

Body

application/json
namestring

This pre-receive environment’s new name.

image_urlstring

URL from which to download a tarball of this environment.

Response

application/json

Response

pre-receive-environment

idinteger
namestring
image_urlstring
urlstring
html_urlstring
default_environmentboolean
created_atstring
hooks_countinteger
downloadobject
Show Child Parameters
patch/admin/pre-receive-environments/{pre_receive_environment_id}

Body

{}
 
application/json

Delete a pre-receive environment

If you attempt to delete an environment that cannot be deleted, you will receive a 422 Unprocessable Entity response.

The possible error messages are:

  • Cannot modify or delete the default environment
  • Cannot delete environment that has hooks
  • Cannot delete environment when download is in progress
delete
http://HOSTNAME/api/v3/admin/pre-receive-environments/{pre_receive_environment_id}

Path Parameters

pre_receive_environment_idintegerrequired

Response

Response

delete/admin/pre-receive-environments/{pre_receive_environment_id}
 

Start a pre-receive environment download

Triggers a new download of the environment tarball from the environment’s image_url. When the download is finished, the newly downloaded tarball will overwrite the existing environment.

If a download cannot be triggered, you will receive a 422 Unprocessable Entity response.

The possible error messages are:

  • Cannot modify or delete the default environment
  • Can not start a new download when a download is in progress
post
http://HOSTNAME/api/v3/admin/pre-receive-environments/{pre_receive_environment_id}/downloads

Path Parameters

pre_receive_environment_idintegerrequired

Response

application/json

Response

pre-receive-environment-download-status

urlstring
statestring
downloaded_atstring | null
messagestring | null
post/admin/pre-receive-environments/{pre_receive_environment_id}/downloads
 
application/json

Get the download status for a pre-receive environment

In addition to seeing the download status at the “Get a pre-receive environment” endpoint, there is also this separate endpoint for just the download status.

get
http://HOSTNAME/api/v3/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest

Path Parameters

pre_receive_environment_idintegerrequired

Response

200 application/json

Response

pre-receive-environment-download-status

urlstring
statestring
downloaded_atstring | null
messagestring | null
get/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest
 
200 application/json

List pre-receive hooks

get
http://HOSTNAME/api/v3/admin/pre-receive-hooks

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

directionstring

One of asc (ascending) or desc (descending).

Allowed values:ascdesc

Default:desc

sortstring

One of created (when the repository was starred) or updated (when it was last pushed to) or name.

Allowed values:createdupdatedname

Default:created

Response

200 application/json

Response

idinteger
namestring
enforcementstring
scriptstring
script_repositoryobject
Show Child Parameters
environmentobject
Show Child Parameters
allow_downstream_configurationboolean
get/admin/pre-receive-hooks
 
200 application/json