This version of GitHub Enterprise Server was discontinued on 2024-12-19. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise Server. For help with the upgrade, contact GitHub Enterprise support.
REST API endpoints for pre-receive environments
Use the REST API to create, list, update and delete environments for pre-receive hooks.
About pre-receive environments
These endpoints are only available to authenticated site administrators. Normal users will receive a 404 response.
Note
These endpoints only support authentication using a personal access token (classic). For more information, see Managing your personal access tokens.
Object attributes
Pre-receive Environment
| Name | Type | Description |
|---|---|---|
name | string | The name of the environment as displayed in the UI. |
image_url | string | URL to the tarball that will be downloaded and extracted. |
default_environment | boolean | Whether this is the default environment that ships with GitHub. |
download | object | This environment's download status. |
hooks_count | integer | The number of pre-receive hooks that use this environment. |
Pre-receive Environment Download
| Name | Type | Description |
|---|---|---|
state | string | The state of the most recent download. |
downloaded_at | string | The time when the most recent download started. |
message | string | On failure, this will have any error messages produced. |
Possible values for state are not_started, in_progress, success, failed.
List pre-receive environments
Fine-grained access tokens for "List pre-receive environments"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Parameters for "List pre-receive environments"
| Name, Type, Description |
|---|
accept string Setting to |
| Name, Type, Description |
|---|
per_page integer The number of results per page (max 100). For more information, see "Using pagination in the REST API." Default: |
page integer The page number of the results to fetch. For more information, see "Using pagination in the REST API." Default: |
direction string The direction to sort the results by. Default: Can be one of: |
sort string Default: Can be one of: |