GitHub v3 REST API

Create a pre-receive environment

post
{protocol}://{hostname}/api/v3/admin/pre-receive-environments

Body

application/json
namestringrequired

The new pre-receive environment’s name.

image_urlstringrequired

URL from which to download a tarball of this environment.

Response

201 application/json

Response

pre-receive-environment

idinteger
namestring
image_urlstring
urlstring
html_urlstring
default_environmentboolean
created_atstring
hooks_countinteger
downloadobject
Show Child Parameters
post/admin/pre-receive-environments

Body

{ "name": "DevTools Hook Env", "image_url": "https://my_file_server/path/to/devtools_env.tar.gz" }
 
201 application/json

Get a pre-receive environment

get
{protocol}://{hostname}/api/v3/admin/pre-receive-environments/{pre_receive_environment_id}

Path Parameters

pre_receive_environment_idintegerrequired

Response

200 application/json

Response

pre-receive-environment

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

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
{protocol}://{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
{protocol}://{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
{protocol}://{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