@octokit/plugin-enterprise-rest
Version:
Octokit plugin for GitHub Enterprise REST APIs
1,370 lines • 1.92 MB
JSON
[
{
"name": "List global hooks",
"scope": "enterpriseAdmin",
"id": "listGlobalHooks",
"method": "GET",
"url": "/admin/hooks",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#list-global-hooks",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "per_page",
"description": "Results per page (max 100)",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "page",
"description": "Page number of the results to fetch.",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "[{\"type\":\"Global\",\"id\":1,\"name\":\"web\",\"active\":true,\"events\":[\"organization\",\"user\"],\"config\":{\"url\":\"https://example.com\",\"content_type\":\"json\",\"insecure_ssl\":\"0\",\"secret\":\"********\"},\"updated_at\":\"2017-12-07T00:14:59Z\",\"created_at\":\"2017-12-07T00:14:59Z\",\"url\":\"https://api.github.com/admin/hooks/1\",\"ping_url\":\"https://api.github.com/admin/hooks/1/pings\"}]"
}
]
}
],
"renamed": null
},
{
"name": "Create a global hook",
"scope": "enterpriseAdmin",
"id": "createGlobalHook",
"method": "POST",
"url": "/admin/hooks",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#create-a-global-hook",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "name",
"description": "Must be passed as \"web\".",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config",
"description": "Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#create-hook-config-params).",
"in": "BODY",
"type": "object",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.url",
"description": "The URL to which the payloads will be delivered.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.content_type",
"description": "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.secret",
"description": "If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://developer.github.com/enterprise/2.16/webhooks/#delivery-headers) header.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.insecure_ssl",
"description": "Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "events",
"description": "The [events](https://developer.github.com/enterprise/2.16/v3/activity/events/types/) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.",
"in": "BODY",
"type": "string[]",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "active",
"description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.",
"in": "BODY",
"type": "boolean",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [
{
"data": "{\"type\":\"Global\",\"id\":1,\"name\":\"web\",\"active\":true,\"events\":[\"organization\",\"user\"],\"config\":{\"url\":\"https://example.com\",\"content_type\":\"json\",\"insecure_ssl\":\"0\",\"secret\":\"********\"},\"updated_at\":\"2017-12-07T00:14:59Z\",\"created_at\":\"2017-12-07T00:14:59Z\",\"url\":\"https://api.github.com/admin/hooks/1\",\"ping_url\":\"https://api.github.com/admin/hooks/1/pings\"}"
}
]
}
],
"renamed": null
},
{
"name": "Get single global hook",
"scope": "enterpriseAdmin",
"id": "getGlobalHook",
"method": "GET",
"url": "/admin/hooks/{hook_id}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#get-single-global-hook",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "hook_id",
"description": "hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"type\":\"Global\",\"id\":1,\"name\":\"web\",\"active\":true,\"events\":[\"organization\",\"user\"],\"config\":{\"url\":\"https://example.com\",\"content_type\":\"json\",\"insecure_ssl\":\"0\",\"secret\":\"********\"},\"updated_at\":\"2017-12-07T00:14:59Z\",\"created_at\":\"2017-12-07T00:14:59Z\",\"url\":\"https://api.github.com/admin/hooks/1\",\"ping_url\":\"https://api.github.com/admin/hooks/1/pings\"}"
}
]
}
],
"renamed": null
},
{
"name": "Edit a global hook",
"scope": "enterpriseAdmin",
"id": "updateGlobalHook",
"method": "PATCH",
"url": "/admin/hooks/{hook_id}",
"isDeprecated": false,
"description": "Parameters that are not provided will be overwritten with the default value or removed if no default exists.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#edit-a-global-hook",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "hook_id",
"description": "hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config",
"description": "Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#update-hook-config-params).",
"in": "BODY",
"type": "object",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.url",
"description": "The URL to which the payloads will be delivered.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.content_type",
"description": "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.secret",
"description": "If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://developer.github.com/enterprise/2.16/webhooks/#delivery-headers) header.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "config.insecure_ssl",
"description": "Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "events",
"description": "The [events](https://developer.github.com/enterprise/2.16/v3/activity/events/types/) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.",
"in": "BODY",
"type": "string[]",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "active",
"description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.",
"in": "BODY",
"type": "boolean",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"type\":\"Global\",\"id\":1,\"name\":\"web\",\"active\":true,\"events\":[\"organization\"],\"config\":{\"url\":\"https://example.com\",\"content_type\":\"form\",\"insecure_ssl\":\"0\"},\"updated_at\":\"2017-12-07T00:14:59Z\",\"created_at\":\"2017-12-07T00:14:59Z\",\"url\":\"https://api.github.com/admin/hooks/1\",\"ping_url\":\"https://api.github.com/admin/hooks/1/pings\"}"
}
]
}
],
"renamed": null
},
{
"name": "Delete a global hook",
"scope": "enterpriseAdmin",
"id": "deleteGlobalHook",
"method": "DELETE",
"url": "/admin/hooks/{hook_id}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#delete-a-global-hook",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "hook_id",
"description": "hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [],
"renamed": null
},
{
"name": "Ping a global hook",
"scope": "enterpriseAdmin",
"id": "pingGlobalHook",
"method": "POST",
"url": "/admin/hooks/{hook_id}/pings",
"isDeprecated": false,
"description": "This will trigger a [ping event](https://developer.github.com/enterprise/2.16/webhooks/#ping-event) to be sent to the hook.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/global_webhooks/#ping-a-global-hook",
"previews": [{ "name": "superpro" }],
"headers": [
{
"name": "accept",
"value": "application/vnd.github.superpro-preview+json"
}
],
"parameters": [
{
"name": "hook_id",
"description": "hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [],
"renamed": null
},
{
"name": "Delete a public key",
"scope": "enterpriseAdmin",
"id": "deletePublicKey",
"method": "DELETE",
"url": "/admin/keys/{key_ids}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/users/#delete-a-public-key",
"previews": [],
"headers": [],
"parameters": [
{
"name": "key_ids",
"description": "key_ids parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [],
"renamed": null
},
{
"name": "Update LDAP mapping for a team",
"scope": "enterpriseAdmin",
"id": "updateLdapMappingForTeam",
"method": "PATCH",
"url": "/admin/ldap/teams/{team_id}/mapping",
"isDeprecated": false,
"description": "Updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://help.github.com/enterprise/admin/guides/user-management/using-ldap/#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create team](https://developer.github.com/enterprise/2.16/v3/teams/#create-team) endpoint to create a team with LDAP mapping.\n\nIf you pass the `hellcat-preview` media type, you can also update the LDAP mapping of a child team.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/ldap/#update-ldap-mapping-for-a-team",
"previews": [],
"headers": [],
"parameters": [
{
"name": "team_id",
"description": "team_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "ldap_dn",
"description": "The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"ldap_dn\":\"cn=Enterprise Ops,ou=teams,dc=github,dc=com\",\"id\":1,\"node_id\":\"MDQ6VGVhbTE=\",\"url\":\"https://api.github.com/teams/1\",\"html_url\":\"https://api.github.com/teams/justice-league\",\"name\":\"Justice League\",\"slug\":\"justice-league\",\"description\":\"A great team.\",\"privacy\":\"closed\",\"permission\":\"admin\",\"members_url\":\"https://api.github.com/teams/1/members{/member}\",\"repositories_url\":\"https://api.github.com/teams/1/repos\",\"parent\":null}"
}
]
}
],
"renamed": null
},
{
"name": "Sync LDAP mapping for a team",
"scope": "enterpriseAdmin",
"id": "syncLdapMappingForTeam",
"method": "POST",
"url": "/admin/ldap/teams/{team_id}/sync",
"isDeprecated": false,
"description": "Note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/ldap/#sync-ldap-mapping-for-a-team",
"previews": [],
"headers": [],
"parameters": [
{
"name": "team_id",
"description": "team_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [{ "data": "{\"status\":\"queued\"}" }]
}
],
"renamed": null
},
{
"name": "Update LDAP mapping for a user",
"scope": "enterpriseAdmin",
"id": "updateLdapMappingForUser",
"method": "PATCH",
"url": "/admin/ldap/users/{username}/mapping",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/ldap/#update-ldap-mapping-for-a-user",
"previews": [],
"headers": [],
"parameters": [
{
"name": "username",
"description": "username parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "ldap_dn",
"description": "The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"ldap_dn\":\"uid=asdf,ou=users,dc=github,dc=com\",\"login\":\"octocat\",\"id\":1,\"node_id\":\"MDQ6VXNlcjE=\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/octocat\",\"html_url\":\"https://github.com/octocat\",\"followers_url\":\"https://api.github.com/users/octocat/followers\",\"following_url\":\"https://api.github.com/users/octocat/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/octocat/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/octocat/subscriptions\",\"organizations_url\":\"https://api.github.com/users/octocat/orgs\",\"repos_url\":\"https://api.github.com/users/octocat/repos\",\"events_url\":\"https://api.github.com/users/octocat/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/octocat/received_events\",\"type\":\"User\",\"site_admin\":false}"
}
]
}
],
"renamed": null
},
{
"name": "Sync LDAP mapping for a user",
"scope": "enterpriseAdmin",
"id": "syncLdapMappingForUser",
"method": "POST",
"url": "/admin/ldap/users/{username}/sync",
"isDeprecated": false,
"description": "Note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/ldap/#sync-ldap-mapping-for-a-user",
"previews": [],
"headers": [],
"parameters": [
{
"name": "username",
"description": "username parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [{ "data": "{\"status\":\"queued\"}" }]
}
],
"renamed": null
},
{
"name": "Create an organization",
"scope": "enterpriseAdmin",
"id": "createOrg",
"method": "POST",
"url": "/admin/organizations",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/orgs/#create-an-organization",
"previews": [],
"headers": [],
"parameters": [
{
"name": "login",
"description": "The organization's username.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "admin",
"description": "The login of the user who will manage this organization.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "profile_name",
"description": "The organization's display name.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [
{
"data": "{\"login\":\"github\",\"id\":1,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjE=\",\"url\":\"https://api.github.com/orgs/github\",\"repos_url\":\"https://api.github.com/orgs/github/repos\",\"events_url\":\"https://api.github.com/orgs/github/events\",\"hooks_url\":\"https://api.github.com/orgs/github/hooks\",\"issues_url\":\"https://api.github.com/orgs/github/issues\",\"members_url\":\"https://api.github.com/orgs/github/members{/member}\",\"public_members_url\":\"https://api.github.com/orgs/github/public_members{/member}\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"description\":\"A great organization\"}"
}
]
}
],
"renamed": null
},
{
"name": "Rename an organization",
"scope": "enterpriseAdmin",
"id": "renameOrg",
"method": "PATCH",
"url": "/admin/organizations/{org}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/orgs/#rename-an-organization",
"previews": [],
"headers": [],
"parameters": [
{
"name": "org",
"description": "org parameter",
"in": "PATH",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "login",
"description": "The organization's new name.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 202,
"description": "response",
"examples": [
{
"data": "{\"message\":\"Job queued to rename organization. It may take a few minutes to complete.\",\"url\":\"https://<hostname>/api/v3/organizations/1\"}"
}
]
}
],
"renamed": null
},
{
"name": "List pre-receive environments",
"scope": "enterpriseAdmin",
"id": "listPreReceiveEnvironments",
"method": "GET",
"url": "/admin/pre-receive-environments",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#list-pre-receive-environments",
"previews": [],
"headers": [],
"parameters": [
{
"name": "per_page",
"description": "Results per page (max 100)",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "page",
"description": "Page number of the results to fetch.",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "[{\"id\":1,\"name\":\"Default\",\"image_url\":\"githubenterprise://internal\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/1\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/1\",\"default_environment\":true,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":14,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/1/downloads/latest\",\"state\":\"not_started\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}},{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}}]"
}
]
}
],
"renamed": null
},
{
"name": "Create a pre-receive environment",
"scope": "enterpriseAdmin",
"id": "createPreReceiveEnvironment",
"method": "POST",
"url": "/admin/pre-receive-environments",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#create-a-pre-receive-environment",
"previews": [],
"headers": [],
"parameters": [
{
"name": "name",
"description": "The new pre-receive environment's name.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "image_url",
"description": "URL from which to download a tarball of this environment.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [
{
"data": "{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"not_started\",\"downloaded_at\":null,\"message\":null}}"
}
]
}
],
"renamed": null
},
{
"name": "Get a single pre-receive environment",
"scope": "enterpriseAdmin",
"id": "getPreReceiveEnvironment",
"method": "GET",
"url": "/admin/pre-receive-environments/{pre_receive_environment_id}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#get-a-single-pre-receive-environment",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_environment_id",
"description": "pre_receive_environment_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}}"
}
]
}
],
"renamed": null
},
{
"name": "Edit a pre-receive environment",
"scope": "enterpriseAdmin",
"id": "updatePreReceiveEnvironment",
"method": "PATCH",
"url": "/admin/pre-receive-environments/{pre_receive_environment_id}",
"isDeprecated": false,
"description": "If you attempt to modify the default environment, you will get a response like this:",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#edit-a-pre-receive-environment",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_environment_id",
"description": "pre_receive_environment_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "name",
"description": "This pre-receive environment's new name.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "image_url",
"description": "URL from which to download a tarball of this environment.",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}}"
}
]
},
{
"code": 422,
"description": "Client Errors",
"examples": [
{
"data": "{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PreReceiveEnvironment\",\"code\":\"custom\",\"message\":\"Cannot modify or delete the default environment\"}]}"
}
]
}
],
"renamed": null
},
{
"name": "Delete a pre-receive environment",
"scope": "enterpriseAdmin",
"id": "deletePreReceiveEnvironment",
"method": "DELETE",
"url": "/admin/pre-receive-environments/{pre_receive_environment_id}",
"isDeprecated": false,
"description": "If you attempt to delete an environment that cannot be deleted, you will get a response like this:\n\nThe possible error messages are:\n\n* _Cannot modify or delete the default environment_\n* _Cannot delete environment that has hooks_\n* _Cannot delete environment when download is in progress_",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#delete-a-pre-receive-environment",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_environment_id",
"description": "pre_receive_environment_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 422,
"description": "Client Errors",
"examples": [
{
"data": "{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PreReceiveEnvironment\",\"code\":\"custom\",\"message\":\"Cannot modify or delete the default environment\"}]}"
}
]
}
],
"renamed": null
},
{
"name": "Trigger a pre-receive environment download",
"scope": "enterpriseAdmin",
"id": "triggerPreReceiveEnvironmentDownload",
"method": "POST",
"url": "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads",
"isDeprecated": false,
"description": "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.\n\nIf a download cannot be triggered, you will get a reponse like this:\n\nThe possible error messages are:\n\n* _Cannot modify or delete the default environment_\n* _Can not start a new download when a download is in progress_",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#trigger-a-pre-receive-environment-download",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_environment_id",
"description": "pre_receive_environment_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 202,
"description": "response",
"examples": [
{
"data": "{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\",\"state\":\"not_started\",\"downloaded_at\":null,\"message\":null}"
}
]
},
{
"code": 422,
"description": "Client Errors",
"examples": [
{
"data": "{\"message\":\"Validation Failed\",\"errors\":[{\"resource\":\"PreReceiveEnvironment\",\"code\":\"custom\",\"message\":\"Can not start a new download when a download is in progress\"}]}"
}
]
}
],
"renamed": null
},
{
"name": "Get a pre-receive environment's download status",
"scope": "enterpriseAdmin",
"id": "getPreReceiveEnvironmentDownloadStatus",
"method": "GET",
"url": "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest",
"isDeprecated": false,
"description": "In addition to seeing the download status at the `/admin/pre-receive-environments/:pre_receive_environment_id`, there is also a separate endpoint for just the status.\n\nPossible values for `state` are `not_started`, `in_progress`, `success`, `failed`.",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_environments/#get-a-pre-receive-environments-download-status",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_environment_id",
"description": "pre_receive_environment_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "state",
"description": "The state of the most recent download.",
"in": "QUERY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "downloaded_at",
"description": "The time when the most recent download started.",
"in": "QUERY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "message",
"description": "On failure, this will have any error messages produced.",
"in": "QUERY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/3/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}"
}
]
}
],
"renamed": null
},
{
"name": "List pre-receive hooks",
"scope": "enterpriseAdmin",
"id": "listPreReceiveHooks",
"method": "GET",
"url": "/admin/pre-receive-hooks",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_hooks/#list-pre-receive-hooks",
"previews": [],
"headers": [],
"parameters": [
{
"name": "per_page",
"description": "Results per page (max 100)",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "page",
"description": "Page number of the results to fetch.",
"in": "QUERY",
"type": "integer",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "[{\"id\":1,\"name\":\"Check Commits\",\"enforcement\":\"disabled\",\"script\":\"scripts/commmit_check.sh\",\"script_repository\":{\"id\":595,\"full_name\":\"DevIT/hooks\",\"url\":\"https://github.example.com/api/v3/repos/DevIT/hooks\",\"html_url\":\"https://github.example.com/DevIT/hooks\"},\"environment\":{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}},\"allow_downstream_configuration\":false}]"
}
]
}
],
"renamed": null
},
{
"name": "Create a pre-receive hook",
"scope": "enterpriseAdmin",
"id": "createPreReceiveHook",
"method": "POST",
"url": "/admin/pre-receive-hooks",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_hooks/#create-a-pre-receive-hook",
"previews": [],
"headers": [],
"parameters": [
{
"name": "name",
"description": "The name of the hook.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "script",
"description": "The script that the hook runs.",
"in": "BODY",
"type": "string",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "script_repository",
"description": "The GitHub repository where the script is kept.",
"in": "BODY",
"type": "object",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "environment",
"description": "The pre-receive environment where the script is executed.",
"in": "BODY",
"type": "object",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "enforcement",
"description": "The state of enforcement for this hook. default: `disabled`",
"in": "BODY",
"type": "string",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
},
{
"name": "allow_downstream_configuration",
"description": "Whether enforcement can be overridden at the org or repo level. default: `false`",
"in": "BODY",
"type": "boolean",
"required": false,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 201,
"description": "response",
"examples": [
{
"data": "{\"id\":1,\"name\":\"Check Commits\",\"enforcement\":\"disabled\",\"script\":\"scripts/commmit_check.sh\",\"script_repository\":{\"id\":595,\"full_name\":\"DevIT/hooks\",\"url\":\"https://github.example.com/api/v3/repos/DevIT/hooks\",\"html_url\":\"https://github.example.com/DevIT/hooks\"},\"environment\":{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}},\"allow_downstream_configuration\":false}"
}
]
}
],
"renamed": null
},
{
"name": "Get a single pre-receive hook",
"scope": "enterpriseAdmin",
"id": "getPreReceiveHook",
"method": "GET",
"url": "/admin/pre-receive-hooks/{pre_receive_hook_id}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_hooks/#get-a-single-pre-receive-hook",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_hook_id",
"description": "pre_receive_hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"id\":1,\"name\":\"Check Commits\",\"enforcement\":\"disabled\",\"script\":\"scripts/commmit_check.sh\",\"script_repository\":{\"id\":595,\"full_name\":\"DevIT/hooks\",\"url\":\"https://github.example.com/api/v3/repos/DevIT/hooks\",\"html_url\":\"https://github.example.com/DevIT/hooks\"},\"environment\":{\"id\":2,\"name\":\"DevTools Hook Env\",\"image_url\":\"https://my_file_server/path/to/devtools_env.tar.gz\",\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2\",\"html_url\":\"https://github.example.com/admin/pre-receive-environments/2\",\"default_environment\":false,\"created_at\":\"2016-05-20T11:35:45-05:00\",\"hooks_count\":1,\"download\":{\"url\":\"https://github.example.com/api/v3/admin/pre-receive-environments/2/downloads/latest\",\"state\":\"success\",\"downloaded_at\":\"2016-05-26T07:42:53-05:00\",\"message\":null}},\"allow_downstream_configuration\":false}"
}
]
}
],
"renamed": null
},
{
"name": "Edit a pre-receive hook",
"scope": "enterpriseAdmin",
"id": "updatePreReceiveHook",
"method": "PATCH",
"url": "/admin/pre_receive_hooks/{pre_receive_hook_id}",
"isDeprecated": false,
"description": "",
"documentationUrl": "https://developer.github.com/enterprise/2.16/v3/enterprise-admin/pre_receive_hooks/#edit-a-pre-receive-hook",
"previews": [],
"headers": [],
"parameters": [
{
"name": "pre_receive_hook_id",
"description": "pre_receive_hook_id parameter",
"in": "PATH",
"type": "integer",
"required": true,
"enum": null,
"allowNull": false,
"mapToData": null,
"validation": null,
"alias": null,
"deprecated": null
}
],
"responses": [
{
"code": 200,
"description": "response",
"examples": [
{
"data": "{\"id\":1,\"name\":\"Check Commits\",\"enforcement\":\"disabled\",\"script\":\"scripts/commmit_check.sh\",\"script_repository\":{\"id\":595,\"full_name\":\"DevIT/hooks\",\"url\":\"https://github.example.com/api/v3/repos/DevIT/hooks\",\"html_url\":\"https://github.example.com/DevIT/hooks\"},\"environment\":{\"id\":1,\"name\":\"Default\",\"image_url\":\"githubenterprise://