@github/openapi
Version:
OpenAPI schema for GitHub's REST API
1,397 lines (1,396 loc) • 3.06 MB
JSON
{
"openapi": "3.0.2",
"info": {
"version": "ghe-2.21",
"title": "GitHub Enterprise REST API v2.21",
"description": "This describes the resources that make up the official GitHub Enterprise Server REST API v3. If you have any problems or requests, please contact [GitHub Enterprise Support](https://enterprise.github.com/support).",
"license": {
"name": "GitHub Enterprise License Agreement",
"url": "https://enterprise.github.com/license"
},
"termsOfService": "https://docs.github.com/en/articles/github-terms-of-service"
},
"servers": [
{
"url": "http://{hostname}",
"variables": {
"hostname": {
"description": "Self-hosted Enterprise Server or Enterprise Cloud hostname",
"default": "HOSTNAME"
}
}
}
],
"externalDocs": {
"description": "GitHub Enterprise Developer Docs",
"url": "https://developer.github.com/enterprise/2.21/v3/"
},
"paths": {
"/admin/hooks": {
"get": {
"summary": "List global webhooks",
"description": "",
"operationId": "enterprise-admin/list-global-webhooks",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#list-global-webhooks"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
},
{
"$ref": "#/components/parameters/per_page"
},
{
"$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/global-hook"
}
},
"examples": {
"default": {
"$ref": "#/components/examples/global-hook-items"
}
}
}
},
"headers": {
"Link": {
"$ref": "#/components/headers/Link"
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/list-global-hooks\" operation ID is now \"enterprise-admin/list-global-webhooks\"",
"before": {
"operationId": "enterprise-admin/list-global-hooks"
},
"after": {
"operationId": "enterprise-admin/list-global-webhooks"
}
}
]
},
"post": {
"summary": "Create a global webhook",
"description": "",
"operationId": "enterprise-admin/create-global-webhook",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#create-a-global-webhook"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
}
],
"responses": {
"201": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/global-hook"
},
"examples": {
"default": {
"$ref": "#/components/examples/global-hook"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Must be passed as \"web\"."
},
"config": {
"type": "object",
"description": "Key/value pairs to provide settings for this webhook.",
"properties": {
"url": {
"type": "string",
"description": "The URL to which the payloads will be delivered."
},
"content_type": {
"type": "string",
"description": "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`."
},
"secret": {
"type": "string",
"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.21/webhooks/event-payloads/#delivery-headers) header."
},
"insecure_ssl": {
"type": "string",
"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.**"
}
},
"required": [
"url"
]
},
"events": {
"type": "array",
"description": "The [events](https://developer.github.com/enterprise/2.21/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.",
"items": {
"type": "string"
}
},
"active": {
"type": "boolean",
"description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.",
"default": true
}
},
"required": [
"name",
"config"
]
},
"example": {
"name": "web",
"events": [
"organization",
"user"
],
"config": {
"url": "https://example.com/webhook",
"content_type": "json",
"secret": "secret"
}
}
}
}
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/create-global-hooks\" operation ID is now \"enterprise-admin/create-global-webhooks\"",
"before": {
"operationId": "enterprise-admin/create-global-hooks"
},
"after": {
"operationId": "enterprise-admin/create-global-webhooks"
}
}
]
}
},
"/admin/hooks/{hook_id}": {
"get": {
"summary": "Get a global webhook",
"description": "",
"operationId": "enterprise-admin/get-global-webhook",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#get-a-global-webhook"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
},
{
"$ref": "#/components/parameters/hook_id"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/global-hook"
},
"examples": {
"default": {
"$ref": "#/components/examples/global-hook"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/get-global-hook\" operation ID is now \"enterprise-admin/get-global-webhook\"",
"before": {
"operationId": "enterprise-admin/get-global-hook"
},
"after": {
"operationId": "enterprise-admin/get-global-webhook"
}
}
]
},
"patch": {
"summary": "Update a global webhook",
"description": "Parameters that are not provided will be overwritten with the default value or removed if no default exists.",
"operationId": "enterprise-admin/update-global-webhook",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#update-a-global-webhook"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
},
{
"$ref": "#/components/parameters/hook_id"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/global-hook-2"
},
"examples": {
"default": {
"$ref": "#/components/examples/global-hook-2"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"config": {
"type": "object",
"description": "Key/value pairs to provide settings for this webhook.",
"properties": {
"url": {
"type": "string",
"description": "The URL to which the payloads will be delivered."
},
"content_type": {
"type": "string",
"description": "The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`."
},
"secret": {
"type": "string",
"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.21/webhooks/event-payloads/#delivery-headers) header."
},
"insecure_ssl": {
"type": "string",
"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.**"
}
},
"required": [
"url"
]
},
"events": {
"type": "array",
"description": "The [events](https://developer.github.com/enterprise/2.21/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`.",
"items": {
"type": "string"
}
},
"active": {
"type": "boolean",
"description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.",
"default": true
}
}
},
"example": {
"events": [
"organization"
],
"config": {
"url": "https://example.com/webhook"
}
}
}
}
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/update-global-hook\" operation ID is now \"enterprise-admin/update-global-webhook\"",
"before": {
"operationId": "enterprise-admin/update-global-hook"
},
"after": {
"operationId": "enterprise-admin/update-global-webhook"
}
}
]
},
"delete": {
"summary": "Delete a global webhook",
"description": "",
"operationId": "enterprise-admin/delete-global-webhook",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#delete-a-global-webhook"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
},
{
"$ref": "#/components/parameters/hook_id"
}
],
"responses": {
"204": {
"description": "Empty response"
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/delete-global-hook\" operation ID is now \"enterprise-admin/delete-global-webhook\"",
"before": {
"operationId": "enterprise-admin/delete-global-hook"
},
"after": {
"operationId": "enterprise-admin/delete-global-webhook"
}
}
]
}
},
"/admin/hooks/{hook_id}/pings": {
"post": {
"summary": "Ping a global webhook",
"description": "This will trigger a [ping event](https://developer.github.com/enterprise/2.21/webhooks/#ping-event) to be sent to the webhook.",
"operationId": "enterprise-admin/ping-global-webhook",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/#ping-a-global-webhook"
},
"parameters": [
{
"name": "accept",
"description": "This API is under preview and subject to change.",
"in": "header",
"schema": {
"type": "string",
"default": "application/vnd.github.superpro-preview+json"
},
"required": true
},
{
"$ref": "#/components/parameters/hook_id"
}
],
"responses": {
"204": {
"description": "Empty response"
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "superpro",
"note": "The [Global Webhooks API](https://developer.github.com/enterprise/2.21/v3/enterprise-admin/global_webhooks/) is currently available for developers to preview. To access the API during the preview period, you must provide a custom [media type](https://developer.github.com/enterprise/2.21/v3/media) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```"
}
],
"category": "enterprise-admin",
"subcategory": "global-webhooks"
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/ping-global-hook\" operation ID is now \"enterprise-admin/ping-global-webhook\"",
"before": {
"operationId": "enterprise-admin/ping-global-hook"
},
"after": {
"operationId": "enterprise-admin/ping-global-webhook"
}
}
]
}
},
"/admin/keys": {
"get": {
"summary": "List public keys",
"description": "",
"operationId": "enterprise-admin/list-public-keys",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/users/#list-public-keys"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/per_page"
},
{
"$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/enterprise-public-key"
}
},
"examples": {
"default": {
"$ref": "#/components/examples/enterprise-public-key-items"
}
}
}
},
"headers": {
"Link": {
"$ref": "#/components/headers/Link"
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "users"
}
}
},
"/admin/keys/{key_ids}": {
"delete": {
"summary": "Delete a public key",
"description": "",
"operationId": "enterprise-admin/delete-public-key",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/users/#delete-a-public-key"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/key_ids"
}
],
"responses": {
"204": {
"description": "Empty response"
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "users"
}
}
},
"/admin/ldap/teams/{team_id}/mapping": {
"patch": {
"summary": "Update LDAP mapping for a team",
"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://docs.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 a team](https://developer.github.com/enterprise/2.21/v3/teams/#create-a-team) endpoint to create a team with LDAP mapping.\n\nYou can also update the LDAP mapping of a child team.",
"operationId": "enterprise-admin/update-ldap-mapping-for-team",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/ldap/#update-ldap-mapping-for-a-team"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/team_id"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ldap-mapping-team"
},
"examples": {
"default": {
"$ref": "#/components/examples/ldap-mapping-team"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "ldap"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ldap_dn": {
"type": "string",
"description": "The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team."
}
}
},
"example": {
"ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com"
}
}
}
}
}
},
"/admin/ldap/teams/{team_id}/sync": {
"post": {
"summary": "Sync LDAP mapping for a team",
"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.",
"operationId": "enterprise-admin/sync-ldap-mapping-for-team",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/ldap/#sync-ldap-mapping-for-a-team"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/team_id"
}
],
"responses": {
"201": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
}
}
},
"example": {
"status": "queued"
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "ldap"
}
}
},
"/admin/ldap/users/{username}/mapping": {
"patch": {
"summary": "Update LDAP mapping for a user",
"description": "",
"operationId": "enterprise-admin/update-ldap-mapping-for-user",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/ldap/#update-ldap-mapping-for-a-user"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/username"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ldap-mapping-user"
},
"examples": {
"default": {
"$ref": "#/components/examples/ldap-mapping-user"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "ldap"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ldap_dn": {
"type": "string",
"description": "The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team."
}
}
},
"example": {
"ldap_dn": "uid=asdf,ou=users,dc=github,dc=com"
}
}
}
}
}
},
"/admin/ldap/users/{username}/sync": {
"post": {
"summary": "Sync LDAP mapping for a user",
"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.",
"operationId": "enterprise-admin/sync-ldap-mapping-for-user",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/ldap/#sync-ldap-mapping-for-a-user"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/username"
}
],
"responses": {
"201": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
}
}
},
"example": {
"status": "queued"
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "ldap"
}
}
},
"/admin/organizations": {
"post": {
"summary": "Create an organization",
"description": "",
"operationId": "enterprise-admin/create-org",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/orgs/#create-an-organization"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
}
],
"responses": {
"201": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/organization-simple"
},
"examples": {
"default": {
"$ref": "#/components/examples/organization-simple"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "orgs"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"login": {
"type": "string",
"description": "The organization's username."
},
"admin": {
"type": "string",
"description": "The login of the user who will manage this organization."
},
"profile_name": {
"type": "string",
"description": "The organization's display name."
}
},
"required": [
"login",
"admin"
]
},
"example": {
"login": "github",
"profile_name": "GitHub, Inc.",
"admin": "monalisaoctocat"
}
}
}
}
}
},
"/admin/organizations/{org}": {
"patch": {
"summary": "Update an organization name",
"description": "",
"operationId": "enterprise-admin/update-org-name",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/orgs/#update-an-organization-name"
},
"parameters": [
{
"$ref": "#/components/parameters/accept"
},
{
"$ref": "#/components/parameters/org"
}
],
"responses": {
"202": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"example": {
"message": "Job queued to rename organization. It may take a few minutes to complete.",
"url": "https://<hostname>/api/v3/organizations/1"
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [],
"category": "enterprise-admin",
"subcategory": "orgs"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"login": {
"type": "string",
"description": "The organization's new name."
}
},
"required": [
"login"
]
},
"example": {
"login": "the-new-octocats"
}
}
}
},
"x-githubBreakingChanges": [
{
"type": "operation",
"date": "2020-06-05",
"note": "\"enterprise-admin/rename-org\" operation ID is now \"enterprise-admin/update-org-name\"",
"before": {
"operationId": "enterprise-admin/rename-org"
},
"after": {
"operationId": "enterprise-admin/update-org-name"
}
}
]
}
},
"/admin/pre-receive-environments": {
"get": {
"summary": "List pre-receive environments",
"description": "",
"operationId": "enterprise-admin/list-pre-receive-environments",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/pre_receive_environments/#list-pre-receive-environments"
},
"parameters": [
{
"$ref": "#/components/parameters/accept-eye-scream"
},
{
"$ref": "#/components/parameters/per_page"
},
{
"$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/pre-receive-environment"
}
},
"examples": {
"default": {
"$ref": "#/components/examples/pre-receive-environment-items"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "eye-scream",
"note": "APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\nTo access the API you must provide a custom [media type](/v3/media) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```"
}
],
"category": "enterprise-admin",
"subcategory": "pre-receive-environments"
}
},
"post": {
"summary": "Create a pre-receive environment",
"description": "",
"operationId": "enterprise-admin/create-pre-receive-environment",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/pre_receive_environments/#create-a-pre-receive-environment"
},
"parameters": [
{
"$ref": "#/components/parameters/accept-eye-scream"
}
],
"responses": {
"201": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pre-receive-environment"
},
"examples": {
"default": {
"$ref": "#/components/examples/pre-receive-environment"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "eye-scream",
"note": "APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\nTo access the API you must provide a custom [media type](/v3/media) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```"
}
],
"category": "enterprise-admin",
"subcategory": "pre-receive-environments"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The new pre-receive environment's name."
},
"image_url": {
"type": "string",
"description": "URL from which to download a tarball of this environment."
}
},
"required": [
"name",
"image_url"
]
},
"example": {
"name": "DevTools Hook Env",
"image_url": "https://my_file_server/path/to/devtools_env.tar.gz"
}
}
}
}
}
},
"/admin/pre-receive-environments/{pre_receive_environment_id}": {
"get": {
"summary": "Get a pre-receive environment",
"description": "",
"operationId": "enterprise-admin/get-pre-receive-environment",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/pre_receive_environments/#get-a-pre-receive-environment"
},
"parameters": [
{
"$ref": "#/components/parameters/accept-eye-scream"
},
{
"$ref": "#/components/parameters/pre_receive_environment_id"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pre-receive-environment"
},
"examples": {
"default": {
"$ref": "#/components/examples/pre-receive-environment-2"
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "eye-scream",
"note": "APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\nTo access the API you must provide a custom [media type](/v3/media) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```"
}
],
"category": "enterprise-admin",
"subcategory": "pre-receive-environments"
}
},
"patch": {
"summary": "Update a pre-receive environment",
"description": "You cannot modify the default environment. If you attempt to modify the default environment, you will receive a `422 Unprocessable Entity` response.",
"operationId": "enterprise-admin/update-pre-receive-environment",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/pre_receive_environments/#update-a-pre-receive-environment"
},
"parameters": [
{
"$ref": "#/components/parameters/accept-eye-scream"
},
{
"$ref": "#/components/parameters/pre_receive_environment_id"
}
],
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pre-receive-environment"
},
"examples": {
"default-response": {
"$ref": "#/components/examples/pre-receive-environment-default-response"
}
}
}
}
},
"422": {
"description": "Client Errors",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"resource": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
},
"examples": {
"client-errors": {
"value": {
"message": "Validation Failed",
"errors": [
{
"resource": "PreReceiveEnvironment",
"code": "custom",
"message": "Cannot modify or delete the default environment"
}
]
}
}
}
}
}
}
},
"x-github": {
"enabledForApps": false,
"githubCloudOnly": false,
"previews": [
{
"required": true,
"name": "eye-scream",
"note": "APIs for managing pre-receive hooks are currently available for developers to preview. During the preview period, the APIs may change without advance notice.\n\nTo access the API you must provide a custom [media type](/v3/media) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```"
}
],
"category": "enterprise-admin",
"subcategory": "pre-receive-environments"
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "This pre-receive environment's new name."
},
"image_url": {
"type": "string",
"description": "URL from which to download a tarball of this environment."
}
}
}
}
}
}
},
"delete": {
"summary": "Delete a pre-receive environment",
"description": "If you attempt to delete an environment that cannot be deleted, you will receive a `422 Unprocessable Entity` response.\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_",
"operationId": "enterprise-admin/delete-pre-receive-environment",
"tags": [
"enterprise-admin"
],
"externalDocs": {
"description": "API method documentation",
"url": "https://developer.github.com/enterprise/2.21/v3/enterprise-admin/pre_receive_environments/#delete-a-pre-receive-environment"
},
"parameters": [
{
"$ref": "#/components/parameters/accept-eye-scream"
},
{
"$ref": "#/components/parameters/pre_receive_environment_id"
}
],
"responses": {
"204": {
"description": "Empty response"
},
"422": {
"description": "Client Errors",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"resource": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
},
"examples": {
"client-errors": {
"value": {
"message": "Validation Failed",
"errors": [