Create a pre-receive hook
POST
/admin/pre-receive-hooks- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Body Params
requiredapplication/jsonobject
allow_downstream_configuration boolean
optionalWhether enforcement can be overridden at the org or repo level. default: `false`
enforcement string
optionalThe state of enforcement for this hook. default: `disabled`
environment object
requiredThe pre-receive environment where the script is executed.
name string
requiredThe name of the hook.
script string
requiredThe script that the hook runs.
script_repository object
requiredThe GitHub repository where the script is kept.
Responses
application/json pre-receive-hook object
Response
allow_downstream_configuration boolean
optionalenforcement string
optional environment objectoptional
environment object
optionalcreated_at string
optionaldefault_environment boolean
optional download objectoptional
download object
optionaldownloaded_at string
optionalnullable message string
optionalnullable state string
optionalurl string
optionalhooks_count integer
optionalhtml_url string
optionalid integer
optionalimage_url string
optionalname string
optionalurl string
optionalid integer
optionalname string
optionalscript string
optional script_repository objectoptional
script_repository object
optionalfull_name string
optionalhtml_url string
optionalid integer
optionalurl string
optional