{ "openapi": "3.0.3", "info": { "version": "1.1.4", "title": "GitHub v3 REST API", "description": "GitHub's v3 REST API.", "license": { "name": "MIT", "url": "https://spdx.org/licenses/MIT" }, "termsOfService": "https://docs.github.com/articles/github-terms-of-service", "contact": { "name": "Support", "url": "https://support.github.com/contact?tags=dotcom-rest-api" } }, "tags": [ { "name": "actions", "description": "Endpoints to manage GitHub Actions using the REST API." }, { "name": "activity", "description": "Activity APIs provide access to notifications, subscriptions, and timelines." }, { "name": "apps", "description": "Information for integrations and installations." }, { "name": "billing", "description": "Monitor charges and usage from Actions and Packages." }, { "name": "checks", "description": "Rich interactions with checks run by your integrations." }, { "name": "code-scanning", "description": "Retrieve code scanning alerts from a repository." }, { "name": "codes-of-conduct", "description": "Insight into codes of conduct for your communities." }, { "name": "codespaces", "description": "Endpoints to manage Codespaces using the REST API." }, { "name": "emojis", "description": "List emojis available to use on GitHub." }, { "name": "enterprise-admin", "description": "Administer a GitHub enterprise." }, { "name": "dependabot", "description": "Endpoints to manage Dependabot." }, { "name": "dependency-graph", "description": "Endpoints to access Dependency Graph features." }, { "name": "gists", "description": "View, modify your gists." }, { "name": "git", "description": "Raw Git functionality." }, { "name": "gitignore", "description": "View gitignore templates" }, { "name": "interactions", "description": "Owner or admin management of users interactions." }, { "name": "issues", "description": "Interact with GitHub Issues." }, { "name": "licenses", "description": "View various OSS licenses." }, { "name": "markdown", "description": "Render GitHub flavored markdown" }, { "name": "meta", "description": "Endpoints that give information about the API." }, { "name": "migrations", "description": "Move projects to or from GitHub." }, { "name": "oauth-authorizations", "description": "Manage access of OAuth applications" }, { "name": "oidc", "description": "Endpoints to manage GitHub OIDC configuration using the REST API." }, { "name": "orgs", "description": "Interact with GitHub Orgs." }, { "name": "packages", "description": "Manage packages for authenticated users and organizations." }, { "name": "projects", "description": "Interact with GitHub Projects." }, { "name": "pulls", "description": "Interact with GitHub Pull Requests." }, { "name": "rate-limit", "description": "Check your current rate limit status" }, { "name": "reactions", "description": "Interact with reactions to various GitHub entities." }, { "name": "repos", "description": "Interact with GitHub Repos." }, { "name": "scim", "description": "Provisioning of GitHub organization membership for SCIM-enabled providers." }, { "name": "search", "description": "Look for stuff on GitHub." }, { "name": "secret-scanning", "description": "Retrieve secret scanning alerts from a repository." }, { "name": "server-statistics", "description": "GHES statistics" }, { "name": "teams", "description": "Interact with GitHub Teams." }, { "name": "users", "description": "Interact with and view information about users and also current user." } ], "servers": [ { "url": "{protocol}://{hostname}/api/v3", "variables": { "hostname": { "description": "Self-hosted Enterprise Server or Enterprise Cloud hostname", "default": "HOSTNAME" }, "protocol": { "description": "Self-hosted Enterprise Server or Enterprise Cloud protocol", "default": "http" } } } ], "externalDocs": { "description": "GitHub Enterprise Developer Docs", "url": "https://docs.github.com/enterprise-server@3.1/rest/" }, "paths": { "/": { "get": { "summary": "GitHub API Root", "description": "Get Hypermedia links to resources accessible in GitHub's REST API", "tags": [ "meta" ], "operationId": "meta/root", "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/root" }, "examples": { "default": { "$ref": "#/components/examples/root" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "meta" }, "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#root-endpoint" } } }, "/admin/hooks": { "get": { "summary": "List global webhooks", "description": "", "operationId": "enterprise-admin/list-global-webhooks", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-global-webhooks" }, "parameters": [ { "$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": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] } }, "post": { "summary": "Create a global webhook", "description": "", "operationId": "enterprise-admin/create-global-webhook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-a-global-webhook" }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/global-hook" }, "examples": { "default": { "$ref": "#/components/examples/global-hook" } } } } } }, "requestBody": { "required": true, "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://docs.github.com/enterprise-server@3.1/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://docs.github.com/enterprise-server@3.1/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" ] }, "examples": { "default": { "value": { "name": "web", "events": [ "organization", "user" ], "config": { "url": "https://example.com/webhook", "content_type": "json", "secret": "secret" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] }, "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 } ] } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#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": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] } }, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#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" } } } } } }, "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://docs.github.com/enterprise-server@3.1/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://docs.github.com/enterprise-server@3.1/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 } } }, "examples": { "default": { "value": { "events": [ "organization" ], "config": { "url": "https://example.com/webhook" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] } }, "delete": { "summary": "Delete a global webhook", "description": "", "operationId": "enterprise-admin/delete-global-webhook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-global-webhook" }, "parameters": [ { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] } } }, "/admin/hooks/{hook_id}/pings": { "post": { "summary": "Ping a global webhook", "description": "This will trigger a [ping event](https://docs.github.com/enterprise-server@3.1/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#ping-a-global-webhook" }, "parameters": [ { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "global-webhooks", "previews": [ { "required": true, "name": "superpro", "note": "The [Global Webhooks API](https://docs.github.com/enterprise-server@3.1/rest/reference/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://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.superpro-preview+json\n```" } ] } } }, "/admin/keys": { "get": { "summary": "List public keys", "description": "", "operationId": "enterprise-admin/list-public-keys", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-public-keys" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/direction" }, { "name": "sort", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "accessed" ], "default": "created" } }, { "name": "since", "description": "Only show public keys accessed after the given time.", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/public-key-full" } }, "examples": { "default": { "$ref": "#/components/examples/enterprise-public-key-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-public-key" }, "parameters": [ { "$ref": "#/components/parameters/key-ids" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "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-server@3.1/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.1/rest/reference/teams/#create-a-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.", "operationId": "enterprise-admin/update-ldap-mapping-for-team", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team" }, "parameters": [ { "$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" } } } } } }, "requestBody": { "required": true, "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." } }, "required": [ "ldap_dn" ] }, "examples": { "default": { "value": { "ldap_dn": "cn=Enterprise Ops,ou=teams,dc=github,dc=com" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "ldap", "previews": [ { "required": false, "name": "hellcat", "note": "The Nested Teams API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2017-08-30-preview-nested-teams) for full details. To access the API, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.hellcat-preview+json\n```" } ] } } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-team" }, "parameters": [ { "$ref": "#/components/parameters/team-id" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" } } }, "examples": { "default": { "value": { "status": "queued" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user" }, "parameters": [ { "$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" } } } } } }, "requestBody": { "required": true, "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." } }, "required": [ "ldap_dn" ] }, "examples": { "default": { "value": { "ldap_dn": "uid=asdf,ou=users,dc=github,dc=com" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "ldap" } } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#sync-ldap-mapping-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/username" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" } } }, "examples": { "default": { "value": { "status": "queued" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-an-organization" }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/organization-simple" }, "examples": { "default": { "$ref": "#/components/examples/organization-simple" } } } } } }, "requestBody": { "required": true, "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" ] }, "examples": { "default": { "value": { "login": "github", "profile_name": "GitHub, Inc.", "admin": "monalisaoctocat" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "orgs" } } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-an-organization-name" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "url": { "type": "string" } } }, "examples": { "default": { "value": { "message": "Job queued to rename organization. It may take a few minutes to complete.", "url": "https:///api/v3/organizations/1" } } } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "login": { "type": "string", "description": "The organization's new name." } }, "required": [ "login" ] }, "examples": { "default": { "value": { "login": "the-new-octocats" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "orgs" } } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-pre-receive-environments" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/direction" }, { "name": "sort", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "name" ], "default": "created" } } ], "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": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-a-pre-receive-environment" }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-environment" }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-environment" } } } } } }, "requestBody": { "required": true, "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" ] }, "examples": { "default": { "value": { "name": "DevTools Hook Env", "image_url": "https://my_file_server/path/to/devtools_env.tar.gz" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-a-pre-receive-environment" }, "parameters": [ { "$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" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-a-pre-receive-environment" }, "parameters": [ { "$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" } ] } } } } } } }, "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." } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "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://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-pre-receive-environment" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-environment-id" } ], "responses": { "204": { "description": "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": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads": { "post": { "summary": "Start a pre-receive environment download", "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 receive a `422 Unprocessable Entity` response.\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_", "operationId": "enterprise-admin/start-pre-receive-environment-download", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#start-a-pre-receive-environment-download" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-environment-id" } ], "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-environment-download-status" }, "examples": { "default-response": { "$ref": "#/components/examples/pre-receive-environment-download-status-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": "Can not start a new download when a download is in progress" } ] } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest": { "get": { "summary": "Get the download status for a pre-receive environment", "description": "In addition to seeing the download status at the \"[Get a pre-receive environment](#get-a-pre-receive-environment)\" endpoint, there is also this separate endpoint for just the download status.", "operationId": "enterprise-admin/get-download-status-for-pre-receive-environment", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-the-download-status-for-a-pre-receive-environment" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-environment-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-environment-download-status" }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-environment-download-status" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-environments", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/admin/pre-receive-hooks": { "get": { "summary": "List pre-receive hooks", "description": "", "operationId": "enterprise-admin/list-pre-receive-hooks", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-pre-receive-hooks" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/direction" }, { "name": "sort", "description": "The property to sort the results by.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "name" ], "default": "created" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/pre-receive-hook" } }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-hook-items" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "post": { "summary": "Create a pre-receive hook", "description": "", "operationId": "enterprise-admin/create-pre-receive-hook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-a-pre-receive-hook" }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-hook" } } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the hook." }, "script": { "type": "string", "description": "The script that the hook runs." }, "script_repository": { "type": "object", "description": "The GitHub repository where the script is kept.", "properties": { }, "additionalProperties": true }, "environment": { "type": "object", "description": "The pre-receive environment where the script is executed.", "properties": { }, "additionalProperties": true }, "enforcement": { "type": "string", "description": "The state of enforcement for this hook. default: `disabled`" }, "allow_downstream_configuration": { "type": "boolean", "description": "Whether enforcement can be overridden at the org or repo level. default: `false`" } }, "required": [ "name", "script", "script_repository", "environment" ] }, "examples": { "default": { "value": { "name": "Check Commits", "script": "scripts/commit_check.sh", "enforcement": "disabled", "allow_downstream_configuration": false, "script_repository": { "full_name": "DevIT/hooks" }, "environment": { "id": 2 } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/admin/pre-receive-hooks/{pre_receive_hook_id}": { "get": { "summary": "Get a pre-receive hook", "description": "", "operationId": "enterprise-admin/get-pre-receive-hook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-a-pre-receive-hook" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-hook" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "patch": { "summary": "Update a pre-receive hook", "description": "", "operationId": "enterprise-admin/update-pre-receive-hook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-a-pre-receive-hook" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/pre-receive-hook-2" } } } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the hook." }, "script": { "type": "string", "description": "The script that the hook runs." }, "script_repository": { "type": "object", "description": "The GitHub repository where the script is kept.", "properties": { }, "additionalProperties": true }, "environment": { "type": "object", "description": "The pre-receive environment where the script is executed.", "properties": { }, "additionalProperties": true }, "enforcement": { "type": "string", "description": "The state of enforcement for this hook." }, "allow_downstream_configuration": { "type": "boolean", "description": "Whether enforcement can be overridden at the org or repo level." } } }, "examples": { "default": { "value": { "name": "Check Commits", "environment": { "id": 1 }, "allow_downstream_configuration": true } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "delete": { "summary": "Delete a pre-receive hook", "description": "", "operationId": "enterprise-admin/delete-pre-receive-hook", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-pre-receive-hook" }, "parameters": [ { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/admin/tokens": { "get": { "summary": "List personal access tokens", "description": "Lists personal access tokens for all users, including admin users.", "operationId": "enterprise-admin/list-personal-access-tokens", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-personal-access-tokens" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/authorization" } }, "examples": { "default": { "$ref": "#/components/examples/authorization-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } } }, "/admin/tokens/{token_id}": { "delete": { "summary": "Delete a personal access token", "description": "Deletes a personal access token. Returns a `403 - Forbidden` status when a personal access token is in use. For example, if you access this endpoint with the same personal access token that you are trying to delete, you will receive this error.", "operationId": "enterprise-admin/delete-personal-access-token", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-personal-access-token" }, "parameters": [ { "$ref": "#/components/parameters/token-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } } }, "/admin/users": { "post": { "summary": "Create a user", "description": "If an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-ldap-mapping-for-a-user) for the user.\n\nThe login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `\"octo_cat\"` as the login, a user named `\"octo-cat\"` will be created.\n\nIf the login name or email address is already associated with an account, the server will return a `422` response.", "operationId": "enterprise-admin/create-user", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-a-user" }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/simple-user" }, "examples": { "default": { "$ref": "#/components/examples/simple-user" } } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "login": { "type": "string", "description": "The user's username." }, "email": { "type": "string", "description": "**Required for built-in authentication.** The user's email\naddress. This parameter can be omitted when using CAS, LDAP, or SAML.\nFor more information, see \"[About authentication for your enterprise](https://docs.github.com/enterprise-server@3.1/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise).\"" } }, "required": [ "login" ] }, "examples": { "default": { "value": { "login": "monalisa", "email": "octocat@github.com" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } } }, "/admin/users/{username}": { "patch": { "summary": "Update the username for a user", "description": "", "operationId": "enterprise-admin/update-username-for-user", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-the-username-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/username" } ], "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "url": { "type": "string" } } }, "examples": { "default": { "value": { "message": "Job queued to rename user. It may take a few minutes to complete.", "url": "https://api.github.com/user/1" } } } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "login": { "type": "string", "description": "The user's new username." } }, "required": [ "login" ] }, "examples": { "default": { "value": { "login": "thenewmonalisa" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } }, "delete": { "summary": "Delete a user", "description": "Deleting a user will delete all their repositories, gists, applications, and personal settings. [Suspending a user](https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#suspend-a-user) is often a better option.\n\nYou can delete any user account except your own.", "operationId": "enterprise-admin/delete-user", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-a-user" }, "parameters": [ { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } } }, "/admin/users/{username}/authorizations": { "post": { "summary": "Create an impersonation OAuth token", "description": "", "operationId": "enterprise-admin/create-impersonation-o-auth-token", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#create-an-impersonation-oauth-token" }, "parameters": [ { "$ref": "#/components/parameters/username" } ], "responses": { "201": { "description": "Response when creating a new impersonation OAuth token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization" } } } } }, "200": { "description": "Response when getting an existing impersonation OAuth token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization" } } } } } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "scopes": { "type": "array", "description": "A list of [scopes](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).", "items": { "type": "string" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } }, "delete": { "summary": "Delete an impersonation OAuth token", "description": "", "operationId": "enterprise-admin/delete-impersonation-o-auth-token", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#delete-an-impersonation-oauth-token" }, "parameters": [ { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "users" } } }, "/app": { "get": { "summary": "Get the authenticated app", "description": "Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the \"[List installations for the authenticated app](https://docs.github.com/enterprise-server@3.1/rest/reference/apps#list-installations-for-the-authenticated-app)\" endpoint.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/get-authenticated", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#get-the-authenticated-app" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/integration" }, "examples": { "default": { "$ref": "#/components/examples/integration" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": null } } }, "/app-manifests/{code}/conversions": { "post": { "summary": "Create a GitHub App from a manifest", "description": "Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.", "tags": [ "apps" ], "operationId": "apps/create-from-manifest", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-github-app-from-a-manifest" }, "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/integration" }, { "type": "object", "properties": { "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "webhook_secret": { "type": "string", "nullable": true }, "pem": { "type": "string" } }, "required": [ "client_id", "client_secret", "webhook_secret", "pem" ], "additionalProperties": true } ] }, "examples": { "default": { "$ref": "#/components/examples/integration-from-manifest" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": null } } }, "/app/hook/config": { "get": { "summary": "Get a webhook configuration for an app", "description": "Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/get-webhook-config-for-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#get-a-webhook-configuration-for-an-app" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } }, "patch": { "summary": "Update a webhook configuration for an app", "description": "Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/update-webhook-config-for-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#update-a-webhook-configuration-for-an-app" }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "$ref": "#/components/schemas/webhook-config-url" }, "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" } } }, "examples": { "default": { "value": { "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } } }, "/app/installations": { "get": { "summary": "List installations for the authenticated app", "description": "You must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.\n\nThe permissions the installation has are included under the `permissions` key.", "tags": [ "apps" ], "operationId": "apps/list-installations", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#list-installations-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/since" }, { "name": "outdated", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The permissions the installation has are included under the `permissions` key.", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/installation" } }, "examples": { "default": { "$ref": "#/components/examples/base-installation-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": null } } }, "/app/installations/{installation_id}": { "get": { "summary": "Get an installation for the authenticated app", "description": "Enables an authenticated GitHub App to find an installation's information using the installation id.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/get-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#get-an-installation-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/installation" }, "examples": { "default": { "$ref": "#/components/examples/base-installation" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": null } }, "delete": { "summary": "Delete an installation for the authenticated app", "description": "Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the \"[Suspend an app installation](https://docs.github.com/enterprise-server@3.1/rest/reference/apps/#suspend-an-app-installation)\" endpoint.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/delete-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#delete-an-installation-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": null } } }, "/app/installations/{installation_id}/access_tokens": { "post": { "summary": "Create an installation access token for an app", "description": "Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/create-installation-access-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps/#create-an-installation-access-token-for-an-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "repositories": { "description": "List of repository names that the token should have access to", "type": "array", "items": { "type": "string", "example": "rails" } }, "repository_ids": { "description": "List of repository IDs that the token should have access to", "example": [ 1 ], "type": "array", "items": { "type": "integer" } }, "permissions": { "$ref": "#/components/schemas/app-permissions" } } }, "examples": { "default": { "value": { "respoitory": "Hello-World", "permissions": { "issues": "write", "contents": "read" } } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/installation-token" }, "examples": { "default": { "$ref": "#/components/examples/installation-token" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": null } } }, "/app/installations/{installation_id}/suspended": { "put": { "summary": "Suspend an app installation", "description": "Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub Enterprise Server API or webhook events is blocked for that account.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/suspend-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#suspend-an-app-installation" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": null } }, "delete": { "summary": "Unsuspend an app installation", "description": "Removes a GitHub App installation suspension.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/unsuspend-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#unsuspend-an-app-installation" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": null } } }, "/applications/grants": { "get": { "summary": "List your grants", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\nYou can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `[\"repo\", \"user\"]`.", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/list-grants", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#list-your-grants" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "name": "client_id", "in": "query", "required": false, "description": "The client ID of your GitHub app.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/application-grant" } }, "examples": { "default": { "$ref": "#/components/examples/application-grant-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/applications/grants/{grant_id}": { "get": { "summary": "Get a single grant", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/get-grant", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#get-a-single-grant" }, "parameters": [ { "$ref": "#/components/parameters/grant-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application-grant" }, "examples": { "default": { "$ref": "#/components/examples/application-grant" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true }, "delete": { "summary": "Delete a grant", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/delete-grant", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#delete-a-grant" }, "parameters": [ { "$ref": "#/components/parameters/grant-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/applications/{client_id}/grant": { "delete": { "summary": "Delete an app authorization", "description": "OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).", "operationId": "apps/delete-authorization", "tags": [ "apps" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#delete-an-app-authorization" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string", "description": "The OAuth access token used to authenticate to the GitHub API." } }, "required": [ "access_token" ] }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } } }, "/applications/{client_id}/grants/{access_token}": { "delete": { "summary": "Revoke a grant for an application", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted.\n\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under \"Authorized OAuth Apps\" on GitHub Enterprise Server](https://github.com/settings/applications#authorized).", "tags": [ "apps" ], "operationId": "apps/revoke-grant-for-application", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#revoke-a-grant-for-an-application" }, "parameters": [ { "$ref": "#/components/parameters/client-id" }, { "$ref": "#/components/parameters/access-token" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2021-05-05", "deprecationDate": "2020-02-14", "category": "apps", "subcategory": "oauth-applications" }, "deprecated": true } }, "/applications/{client_id}/token": { "post": { "summary": "Check a token", "description": "OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/check-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#check-a-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } }, "patch": { "summary": "Reset a token", "description": "OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/reset-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#reset-a-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } }, "delete": { "summary": "Delete an app token", "description": "OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.", "tags": [ "apps" ], "operationId": "apps/delete-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#delete-an-app-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string", "description": "The OAuth access token used to authenticate to the GitHub API." } }, "required": [ "access_token" ] }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } } }, "/applications/{client_id}/token/scoped": { "post": { "summary": "Create a scoped access token", "description": "Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/scope-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-scoped-access-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string", "description": "The OAuth access token used to authenticate to the GitHub API.", "example": "e72e16c7e42f292c6912e7710c838347ae178b4a" }, "target": { "description": "The name of the user or organization to scope the user-to-server access token to. **Required** unless `target_id` is specified.", "type": "string", "example": "octocat" }, "target_id": { "description": "The ID of the user or organization to scope the user-to-server access token to. **Required** unless `target` is specified.", "example": 1, "type": "integer" }, "repositories": { "description": "The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified.", "type": "array", "items": { "type": "string", "example": "rails" } }, "repository_ids": { "description": "The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified.", "example": [ 1 ], "type": "array", "items": { "type": "integer" } }, "permissions": { "$ref": "#/components/schemas/app-permissions" } }, "required": [ "access_token" ] }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a", "target": "octocat", "permissions": { "metadata": "read", "issues": "write", "contents": "read" } } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/scope-token" } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } } }, "/applications/{client_id}/tokens/{access_token}": { "get": { "summary": "Check an authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/check-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#check-an-authorization" }, "parameters": [ { "$ref": "#/components/parameters/client-id" }, { "$ref": "#/components/parameters/access-token" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/nullable-authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2021-05-05", "deprecationDate": "2020-02-14", "category": "apps", "subcategory": "oauth-applications" }, "deprecated": true }, "post": { "summary": "Reset an authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/reset-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#reset-an-authorization" }, "parameters": [ { "$ref": "#/components/parameters/client-id" }, { "$ref": "#/components/parameters/access-token" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2021-05-05", "deprecationDate": "2020-02-14", "category": "apps", "subcategory": "oauth-applications" }, "deprecated": true }, "delete": { "summary": "Revoke an authorization for an application", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/).\n\nOAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password.", "tags": [ "apps" ], "operationId": "apps/revoke-authorization-for-application", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#revoke-an-authorization-for-an-application" }, "parameters": [ { "$ref": "#/components/parameters/client-id" }, { "$ref": "#/components/parameters/access-token" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2021-05-05", "deprecationDate": "2020-02-14", "category": "apps", "subcategory": "oauth-applications" }, "deprecated": true } }, "/apps/{app_slug}": { "get": { "summary": "Get an app", "description": "**Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).\n\nIf the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/get-by-slug", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps/#get-an-app" }, "parameters": [ { "$ref": "#/components/parameters/app-slug" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/integration" }, "examples": { "default": { "$ref": "#/components/examples/integration" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": null } } }, "/authorizations": { "get": { "summary": "List your authorizations", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/list-authorizations", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#list-your-authorizations" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "name": "client_id", "in": "query", "required": false, "description": "The client ID of your GitHub app.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/authorization" } }, "examples": { "default": { "$ref": "#/components/examples/authorization-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true }, "post": { "summary": "Create a new authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\nCreates OAuth tokens using [Basic Authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\nTo create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them.\n\nYou can also create tokens on GitHub Enterprise Server from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://docs.github.com/articles/creating-an-access-token-for-command-line-use).\n\nOrganizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://docs.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/create-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#create-a-new-authorization" }, "parameters": [ ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "scopes": { "description": "A list of scopes that this authorization is in.", "type": "array", "items": { "type": "string" }, "example": [ "public_repo", "user" ], "nullable": true }, "note": { "description": "A note to remind you what the OAuth token is for.", "type": "string", "example": "Update all gems" }, "note_url": { "description": "A URL to remind you what app the OAuth token is for.", "type": "string" }, "client_id": { "description": "The OAuth app client key for which to create the token.", "maxLength": 20, "type": "string" }, "client_secret": { "description": "The OAuth app client secret for which to create the token.", "maxLength": 40, "type": "string" }, "fingerprint": { "description": "A unique string to distinguish an authorization from others created for the same client ID and user.", "type": "string" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization" } } } }, "headers": { "Location": { "example": "https://api.github.com/authorizations/1", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "410": { "$ref": "#/components/responses/gone" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/authorizations/clients/{client_id}": { "put": { "summary": "Get-or-create an authorization for a specific app", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\nCreates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\n\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\n**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/get-or-create-authorization-for-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "client_secret": { "description": "The OAuth app client secret for which to create the token.", "maxLength": 40, "type": "string" }, "scopes": { "description": "A list of scopes that this authorization is in.", "type": "array", "items": { "type": "string" }, "example": [ "public_repo", "user" ], "nullable": true }, "note": { "description": "A note to remind you what the OAuth token is for.", "type": "string", "example": "Update all gems" }, "note_url": { "description": "A URL to remind you what app the OAuth token is for.", "type": "string" }, "fingerprint": { "description": "A unique string to distinguish an authorization from others created for the same client ID and user.", "type": "string" } }, "required": [ "client_secret" ], "type": "object" } } } }, "responses": { "200": { "description": "if returning an existing token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "response-if-returning-an-existing-token": { "$ref": "#/components/examples/authorization-response-if-returning-an-existing-token-2" } } } }, "headers": { "Location": { "example": "https://api.github.com/authorizations/1", "schema": { "type": "string" } } } }, "201": { "description": "**Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization" } } } }, "headers": { "Location": { "example": "https://api.github.com/authorizations/1", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/authorizations/clients/{client_id}/{fingerprint}": { "put": { "summary": "Get-or-create an authorization for a specific app and fingerprint", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\n**Warning:** Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).\n\nThis method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.\n\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint" }, "parameters": [ { "$ref": "#/components/parameters/client-id" }, { "name": "fingerprint", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "client_secret": { "description": "The OAuth app client secret for which to create the token.", "maxLength": 40, "type": "string" }, "scopes": { "description": "A list of scopes that this authorization is in.", "type": "array", "items": { "type": "string" }, "example": [ "public_repo", "user" ], "nullable": true }, "note": { "description": "A note to remind you what the OAuth token is for.", "type": "string", "example": "Update all gems" }, "note_url": { "description": "A URL to remind you what app the OAuth token is for.", "type": "string" } }, "required": [ "client_secret" ], "type": "object" } } } }, "responses": { "200": { "description": "if returning an existing token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "response-if-returning-an-existing-token": { "$ref": "#/components/examples/authorization-response-if-returning-an-existing-token" } } } }, "headers": { "Location": { "example": "https://api.github.com/authorizations/1", "schema": { "type": "string" } } } }, "201": { "description": "Response if returning a new token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-3" } } } }, "headers": { "Location": { "example": "https://api.github.com/authorizations/1", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/authorizations/{authorization_id}": { "get": { "summary": "Get a single authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/get-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#get-a-single-authorization" }, "parameters": [ { "$ref": "#/components/parameters/authorization-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-2" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true }, "patch": { "summary": "Update an existing authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).\n\nIf you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see \"[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#working-with-two-factor-authentication).\"\n\nYou can only send one of these scope keys at a time.", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/update-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#update-an-existing-authorization" }, "parameters": [ { "$ref": "#/components/parameters/authorization-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "scopes": { "description": "A list of scopes that this authorization is in.", "type": "array", "items": { "type": "string" }, "example": [ "public_repo", "user" ], "nullable": true }, "add_scopes": { "description": "A list of scopes to add to this authorization.", "type": "array", "items": { "type": "string" } }, "remove_scopes": { "description": "A list of scopes to remove from this authorization.", "type": "array", "items": { "type": "string" } }, "note": { "description": "A note to remind you what the OAuth token is for.", "type": "string", "example": "Update all gems" }, "note_url": { "description": "A URL to remind you what app the OAuth token is for.", "type": "string" }, "fingerprint": { "description": "A unique string to distinguish an authorization from others created for the same client ID and user.", "type": "string" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-2" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true }, "delete": { "summary": "Delete an authorization", "description": "**Deprecation Notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).", "tags": [ "oauth-authorizations" ], "operationId": "oauth-authorizations/delete-authorization", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/oauth-authorizations#delete-an-authorization" }, "parameters": [ { "$ref": "#/components/parameters/authorization-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "removalDate": "2020-11-13", "deprecationDate": "2020-02-14", "category": "oauth-authorizations", "subcategory": null }, "deprecated": true } }, "/codes_of_conduct": { "get": { "summary": "Get all codes of conduct", "description": "", "tags": [ "codes-of-conduct" ], "operationId": "codes-of-conduct/get-all-codes-of-conduct", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/codes-of-conduct#get-all-codes-of-conduct" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/code-of-conduct" } }, "examples": { "default": { "$ref": "#/components/examples/code-of-conduct-simple-items" } } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "codes-of-conduct", "subcategory": null } } }, "/codes_of_conduct/{key}": { "get": { "summary": "Get a code of conduct", "description": "", "tags": [ "codes-of-conduct" ], "operationId": "codes-of-conduct/get-conduct-code", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/codes-of-conduct#get-a-code-of-conduct" }, "parameters": [ { "name": "key", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-of-conduct" }, "examples": { "default": { "$ref": "#/components/examples/code-of-conduct" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "codes-of-conduct", "subcategory": null } } }, "/emojis": { "get": { "summary": "Get emojis", "description": "Lists all the emojis available to use on GitHub Enterprise Server.", "operationId": "emojis/get", "tags": [ "emojis" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/emojis#get-emojis" }, "parameters": [ ], "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": { "type": "string" } }, "examples": { "default": { "$ref": "#/components/examples/emojis-get" } } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "emojis", "subcategory": null } } }, "/enterprise/announcement": { "get": { "summary": "Get the global announcement banner", "description": "Gets the current message and expiration date of the global announcement banner in your enterprise.", "tags": [ "enterprise-admin" ], "operationId": "enterprise-admin/get-announcement", "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/announcement" }, "examples": { "default": { "$ref": "#/components/examples/announcement" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "announcement" } }, "patch": { "summary": "Set the global announcement banner", "description": "Sets the message and expiration time for the global announcement banner in your enterprise.", "tags": [ "enterprise-admin" ], "operationId": "enterprise-admin/set-announcement", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/announcement" } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/announcement" }, "examples": { "default": { "$ref": "#/components/examples/announcement" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "announcement" } }, "delete": { "summary": "Remove the global announcement banner", "description": "Removes the global announcement banner in your enterprise.", "tags": [ "enterprise-admin" ], "operationId": "enterprise-admin/remove-announcement", "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "announcement" } } }, "/enterprise/settings/license": { "get": { "summary": "Get license information", "description": "", "operationId": "enterprise-admin/get-license-information", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-license-information" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/license-info" }, "examples": { "default": { "$ref": "#/components/examples/license-info" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "license" } } }, "/enterprise/stats/all": { "get": { "summary": "Get all statistics", "description": "", "operationId": "enterprise-admin/get-all-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-overview" }, "examples": { "default": { "$ref": "#/components/examples/enterprise-overview" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/comments": { "get": { "summary": "Get comment statistics", "description": "", "operationId": "enterprise-admin/get-comment-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-comment-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-comment-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/gists": { "get": { "summary": "Get gist statistics", "description": "", "operationId": "enterprise-admin/get-gist-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-gist-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-gist-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/hooks": { "get": { "summary": "Get hooks statistics", "operationId": "enterprise-admin/get-hooks-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-hooks-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-hook-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/issues": { "get": { "summary": "Get issue statistics", "description": "", "operationId": "enterprise-admin/get-issue-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-issues-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-issue-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/milestones": { "get": { "summary": "Get milestone statistics", "description": "", "operationId": "enterprise-admin/get-milestone-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-milestone-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-milestone-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/orgs": { "get": { "summary": "Get organization statistics", "description": "", "operationId": "enterprise-admin/get-org-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-organization-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-organization-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/pages": { "get": { "summary": "Get pages statistics", "description": "", "operationId": "enterprise-admin/get-pages-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-pages-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-page-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/pulls": { "get": { "summary": "Get pull request statistics", "description": "", "operationId": "enterprise-admin/get-pull-request-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-pull-requests-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-pull-request-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/repos": { "get": { "summary": "Get repository statistics", "operationId": "enterprise-admin/get-repo-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-repository-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-repository-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprise/stats/users": { "get": { "summary": "Get users statistics", "description": "", "operationId": "enterprise-admin/get-user-stats", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-users-statistics" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/enterprise-user-overview" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "enterprise-admin", "subcategory": "admin-stats" } } }, "/enterprises/{enterprise}/actions/permissions": { "get": { "summary": "Get GitHub Actions permissions for an enterprise", "description": "Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/get-github-actions-permissions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-github-actions-permissions-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-enterprise-permissions" }, "examples": { "default": { "$ref": "#/components/examples/actions-enterprise-permissions" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set GitHub Actions permissions for an enterprise", "description": "Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/set-github-actions-permissions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-github-actions-permissions-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled_organizations": { "$ref": "#/components/schemas/enabled-organizations" }, "allowed_actions": { "$ref": "#/components/schemas/allowed-actions" } }, "required": [ "enabled_organizations" ] }, "examples": { "default": { "value": { "enabled_organizations": "all", "allowed_actions": "selected" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/enterprises/{enterprise}/actions/permissions/organizations": { "get": { "summary": "List selected organizations enabled for GitHub Actions in an enterprise", "description": "Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-selected-organizations-enabled-github-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "number" }, "organizations": { "type": "array", "items": { "$ref": "#/components/schemas/organization-simple" } } }, "required": [ "total_count", "organizations" ] }, "examples": { "default": { "$ref": "#/components/examples/organization-targets" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set selected organizations enabled for GitHub Actions in an enterprise", "description": "Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/set-selected-organizations-enabled-github-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "selected_organization_ids": { "description": "List of organization IDs to enable for GitHub Actions.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the organization." } } }, "required": [ "selected_organization_ids" ] }, "examples": { "default": { "value": { "selected_organization_ids": [ 32, 91 ] } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/enterprises/{enterprise}/actions/permissions/organizations/{org_id}": { "put": { "summary": "Enable a selected organization for GitHub Actions in an enterprise", "description": "Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/enable-selected-organization-github-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#enable-a-selected-organization-for-github-actions-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/org-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "delete": { "summary": "Disable a selected organization for GitHub Actions in an enterprise", "description": "Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/disable-selected-organization-github-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#disable-a-selected-organization-for-github-actions-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/org-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/enterprises/{enterprise}/actions/permissions/selected-actions": { "get": { "summary": "Get allowed actions for an enterprise", "description": "Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/get-allowed-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-allowed-actions-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "default": { "$ref": "#/components/examples/selected-actions" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set allowed actions for an enterprise", "description": "Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/set-allowed-actions-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-allowed-actions-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "selected_actions": { "$ref": "#/components/examples/selected-actions" } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/enterprises/{enterprise}/actions/runner-groups": { "get": { "summary": "List self-hosted runner groups for an enterprise", "description": "Lists all self-hosted runner groups for an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-self-hosted-runner-groups-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runner-groups-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "number" }, "runner_groups": { "type": "array", "items": { "$ref": "#/components/schemas/runner-groups-enterprise" } } }, "required": [ "total_count", "runner_groups" ] }, "examples": { "default": { "$ref": "#/components/examples/runner-groups-enterprise" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "post": { "summary": "Create a self-hosted runner group for an enterprise", "description": "Creates a new self-hosted runner group for an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/create-self-hosted-runner-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-self-hosted-runner-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "description": "Name of the runner group.", "type": "string" }, "visibility": { "description": "Visibility of a runner group. You can select all organizations or select individual organization.", "type": "string", "enum": [ "selected", "all" ] }, "selected_organization_ids": { "description": "List of organization IDs that can access the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the organization." } }, "runners": { "description": "List of runner IDs to add to the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the runner." } }, "allows_public_repositories": { "description": "Whether the runner group can be used by `public` repositories.", "type": "boolean", "default": false } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Expensive hardware runners", "visibility": "selected", "selected_organization_ids": [ 32, 91 ], "runners": [ 9, 2 ] } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-enterprise" }, "examples": { "default": { "$ref": "#/components/examples/runner-group-enterprise" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": { "get": { "summary": "Get a self-hosted runner group for an enterprise", "description": "Gets a specific self-hosted runner group for an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/get-self-hosted-runner-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-self-hosted-runner-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-enterprise" }, "examples": { "default": { "$ref": "#/components/examples/runner-group-enterprise" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "patch": { "summary": "Update a self-hosted runner group for an enterprise", "description": "Updates the `name` and `visibility` of a self-hosted runner group in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/update-self-hosted-runner-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#update-a-self-hosted-runner-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "description": "Name of the runner group.", "type": "string" }, "visibility": { "description": "Visibility of a runner group. You can select all organizations or select individual organizations.", "type": "string", "enum": [ "selected", "all" ], "default": "all" }, "allows_public_repositories": { "description": "Whether the runner group can be used by `public` repositories.", "type": "boolean", "default": false } } }, "examples": { "default": { "value": { "name": "Expensive hardware runners", "visibility": "selected" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-enterprise" }, "examples": { "default": { "$ref": "#/components/examples/runner-group-update-enterprise" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Delete a self-hosted runner group from an enterprise", "description": "Deletes a self-hosted runner group for an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/delete-self-hosted-runner-group-from-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations": { "get": { "summary": "List organization access to a self-hosted runner group in an enterprise", "description": "Lists the organizations with access to a self-hosted runner group.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-org-access-to-self-hosted-runner-group-in-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "number" }, "organizations": { "type": "array", "items": { "$ref": "#/components/schemas/organization-simple" } } }, "required": [ "total_count", "organizations" ] }, "examples": { "default": { "$ref": "#/components/examples/organization-targets" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "put": { "summary": "Set organization access for a self-hosted runner group in an enterprise", "description": "Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/set-org-access-to-self-hosted-runner-group-in-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-organization-access-to-a-self-hosted-runner-group-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "selected_organization_ids": { "description": "List of organization IDs that can access the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the organization." } } }, "required": [ "selected_organization_ids" ] }, "examples": { "default": { "value": { "selected_organization_ids": [ 32, 91 ] } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}": { "put": { "summary": "Add organization access to a self-hosted runner group in an enterprise", "description": "Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/add-org-access-to-self-hosted-runner-group-in-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/org-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Remove organization access to a self-hosted runner group in an enterprise", "description": "Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise).\"\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/remove-org-access-to-self-hosted-runner-group-in-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/org-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners": { "get": { "summary": "List self-hosted runners in a group for an enterprise", "description": "Lists the self-hosted runners that are in a specific enterprise group.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-self-hosted-runners-in-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "number" }, "runners": { "type": "array", "items": { "$ref": "#/components/schemas/runner" } } }, "required": [ "total_count", "runners" ] }, "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "put": { "summary": "Set self-hosted runners in a group for an enterprise", "description": "Replaces the list of self-hosted runners that are part of an enterprise runner group.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/set-self-hosted-runners-in-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "runners": { "description": "List of runner IDs to add to the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the runner." } } }, "required": [ "runners" ] }, "examples": { "default": { "value": { "runners": [ 9, 2 ] } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": { "put": { "summary": "Add a self-hosted runner to a group for an enterprise", "description": "Adds a self-hosted runner to a runner group configured in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise`\nscope to use this endpoint.", "operationId": "enterprise-admin/add-self-hosted-runner-to-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Remove a self-hosted runner from a group for an enterprise", "description": "Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/remove-self-hosted-runner-from-group-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/enterprises/{enterprise}/actions/runners": { "get": { "summary": "List self-hosted runners for an enterprise", "description": "Lists all self-hosted runners configured for an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-self-hosted-runners-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runners-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "total_count": { "type": "number" }, "runners": { "type": "array", "items": { "$ref": "#/components/schemas/runner" } } } }, "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/enterprises/{enterprise}/actions/runners/downloads": { "get": { "summary": "List runner applications for an enterprise", "description": "Lists binaries for the runner application that you can download and run.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/list-runner-applications-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-runner-applications-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/runner-application" } }, "examples": { "default": { "$ref": "#/components/examples/runner-application-items" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/enterprises/{enterprise}/actions/runners/registration-token": { "post": { "summary": "Create a registration token for an enterprise", "description": "Returns a token that you can pass to the `config` script. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n#### Example using registration token\n\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN\n```", "operationId": "enterprise-admin/create-registration-token-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-registration-token-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/enterprises/{enterprise}/actions/runners/remove-token": { "post": { "summary": "Create a remove token for an enterprise", "description": "Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.\n\n#### Example using remove token\n\nTo remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this\nendpoint.\n\n```\n./config.sh remove --token TOKEN\n```", "operationId": "enterprise-admin/create-remove-token-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-remove-token-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token-2" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/enterprises/{enterprise}/actions/runners/{runner_id}": { "get": { "summary": "Get a self-hosted runner for an enterprise", "description": "Gets a specific self-hosted runner configured in an enterprise.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/get-self-hosted-runner-for-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-self-hosted-runner-for-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner" }, "examples": { "default": { "$ref": "#/components/examples/runner" } } } } } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } }, "delete": { "summary": "Delete a self-hosted runner from an enterprise", "description": "Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\nYou must authenticate using an access token with the `admin:enterprise` scope to use this endpoint.", "operationId": "enterprise-admin/delete-self-hosted-runner-from-enterprise", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-self-hosted-runner-from-an-enterprise" }, "parameters": [ { "$ref": "#/components/parameters/enterprise" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": false, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/events": { "get": { "summary": "List public events", "description": "We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.", "tags": [ "activity" ], "operationId": "activity/list-public-events", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#list-public-events" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/event" } }, "examples": { "default": { "$ref": "#/components/examples/public-events-items" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "activity", "subcategory": "events" } } }, "/feeds": { "get": { "summary": "Get feeds", "description": "GitHub Enterprise Server provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user:\n\n* **Timeline**: The GitHub Enterprise Server global public timeline\n* **User**: The public timeline for any user, using [URI template](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#hypermedia)\n* **Current user public**: The public timeline for the authenticated user\n* **Current user**: The private timeline for the authenticated user\n* **Current user actor**: The private timeline for activity created by the authenticated user\n* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.\n* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.\n\n**Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/enterprise-server@3.1/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens.", "tags": [ "activity" ], "operationId": "activity/get-feeds", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#get-feeds" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/feed" }, "examples": { "default": { "$ref": "#/components/examples/feed" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "activity", "subcategory": "feeds" } } }, "/gists": { "get": { "summary": "List gists for the authenticated user", "description": "Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:", "tags": [ "gists" ], "operationId": "gists/list", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-gists-for-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/base-gist" } }, "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "post": { "summary": "Create a gist", "description": "Allows you to add a new gist with one or more files.\n\n**Note:** Don't name your files \"gistfile\" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.", "operationId": "gists/create", "tags": [ "gists" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#create-a-gist" }, "parameters": [ ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "description": { "description": "Description of the gist", "example": "Example Ruby script", "type": "string" }, "files": { "description": "Names and content for the files that make up the gist", "example": { "hello.rb": { "content": "puts \"Hello, World!\"" } }, "type": "object", "additionalProperties": { "type": "object", "properties": { "content": { "description": "Content of the file", "readOnly": false, "type": "string" } }, "required": [ "content" ] } }, "public": { "oneOf": [ { "description": "Flag indicating whether the gist is public", "example": true, "type": "boolean", "default": false }, { "type": "string", "example": "true", "default": "false", "enum": [ "true", "false" ] } ] } }, "required": [ "files" ], "type": "object" }, "examples": { "default": { "summary": "Creating a gist", "value": { "description": "Example of a gist", "public": false, "files": { "README.md": { "content": "Hello World" } } } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-simple" }, "examples": { "default": { "$ref": "#/components/examples/gist" } } } }, "headers": { "Location": { "example": "https://api.github.com/gists/aa5a315d61ae9438b18d", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/public": { "get": { "summary": "List public gists", "description": "List public gists sorted by most recently updated to least recently updated.\n\nNote: With [pagination](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.", "tags": [ "gists" ], "operationId": "gists/list-public", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-public-gists" }, "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/base-gist" } }, "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/starred": { "get": { "summary": "List starred gists", "description": "List the authenticated user's starred gists:", "tags": [ "gists" ], "operationId": "gists/list-starred", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-starred-gists" }, "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/base-gist" } }, "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/{gist_id}": { "get": { "summary": "Get a gist", "description": "", "tags": [ "gists" ], "operationId": "gists/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#get-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-simple" }, "examples": { "default": { "$ref": "#/components/examples/gist" } } } } }, "403": { "$ref": "#/components/responses/forbidden_gist" }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "patch": { "summary": "Update a gist", "description": "Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged.", "tags": [ "gists" ], "operationId": "gists/update", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists/#update-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "description": { "description": "Description of the gist", "example": "Example Ruby script", "type": "string" }, "files": { "description": "Names of files to be updated", "example": { "hello.rb": { "content": "blah", "filename": "goodbye.rb" } }, "type": "object", "additionalProperties": { "type": "object", "nullable": true, "properties": { "content": { "description": "The new content of the file", "type": "string" }, "filename": { "description": "The new filename for the file", "type": "string", "nullable": true } }, "anyOf": [ { "required": [ "content" ] }, { "required": [ "filename" ] }, { "type": "object", "maxProperties": 0 } ] } } }, "anyOf": [ { "required": [ "description" ] }, { "required": [ "files" ] } ], "type": "object", "nullable": true }, "examples": { "default": { "summary": "Updating a gist", "value": { "description": "An update to a gist", "files": { "README.md": { "content": "Hello World from GitHub" } } } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-simple" }, "examples": { "default": { "$ref": "#/components/examples/gist" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "delete": { "summary": "Delete a gist", "description": "", "tags": [ "gists" ], "operationId": "gists/delete", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#delete-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/{gist_id}/comments": { "get": { "summary": "List gist comments", "description": "", "tags": [ "gists" ], "operationId": "gists/list-comments", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-gist-comments" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/gist-comment" } }, "examples": { "default": { "$ref": "#/components/examples/gist-comment-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": "comments" } }, "post": { "summary": "Create a gist comment", "description": "", "tags": [ "gists" ], "operationId": "gists/create-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#create-a-gist-comment" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "body": { "description": "The comment text.", "type": "string", "maxLength": 65535, "example": "Body of the attachment" } }, "type": "object", "required": [ "body" ] }, "examples": { "default": { "summary": "Creating a comment in a gist", "value": { "body": "This is a comment to a gist" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-comment" }, "examples": { "default": { "$ref": "#/components/examples/gist-comment" } } } }, "headers": { "Location": { "example": "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": "comments" } } }, "/gists/{gist_id}/comments/{comment_id}": { "get": { "summary": "Get a gist comment", "description": "", "tags": [ "gists" ], "operationId": "gists/get-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#get-a-gist-comment" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-comment" }, "examples": { "default": { "$ref": "#/components/examples/gist-comment" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden_gist" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": "comments" } }, "patch": { "summary": "Update a gist comment", "description": "", "tags": [ "gists" ], "operationId": "gists/update-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#update-a-gist-comment" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "body": { "description": "The comment text.", "type": "string", "maxLength": 65535, "example": "Body of the attachment" } }, "type": "object", "required": [ "body" ] }, "examples": { "default": { "summary": "Updating a comment in a gist", "value": { "body": "This is an update to a comment in a gist" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-comment" }, "examples": { "default": { "$ref": "#/components/examples/gist-comment" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": "comments" } }, "delete": { "summary": "Delete a gist comment", "description": "", "tags": [ "gists" ], "operationId": "gists/delete-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#delete-a-gist-comment" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": "comments" } } }, "/gists/{gist_id}/commits": { "get": { "summary": "List gist commits", "description": "", "tags": [ "gists" ], "operationId": "gists/list-commits", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-gist-commits" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/gist-commit" } }, "examples": { "default": { "$ref": "#/components/examples/gist-commit-items" } } } }, "headers": { "Link": { "example": "; rel=\"next\"", "schema": { "type": "string" } } } }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/{gist_id}/forks": { "get": { "summary": "List gist forks", "description": "", "tags": [ "gists" ], "operationId": "gists/list-forks", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#list-gist-forks" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/gist-simple" } }, "examples": { "default": { "$ref": "#/components/examples/gist-fork-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "post": { "summary": "Fork a gist", "description": "**Note**: This was previously `/gists/:gist_id/fork`.", "tags": [ "gists" ], "operationId": "gists/fork", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#fork-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/base-gist" }, "examples": { "default": { "$ref": "#/components/examples/base-gist" } } } }, "headers": { "Location": { "example": "https://api.github.com/gists/aa5a315d61ae9438b18d", "schema": { "type": "string" } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/{gist_id}/star": { "get": { "summary": "Check if a gist is starred", "description": "", "tags": [ "gists" ], "operationId": "gists/check-is-starred", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#check-if-a-gist-is-starred" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response if gist is starred" }, "404": { "description": "Not Found if gist is not starred", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "put": { "summary": "Star a gist", "description": "Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#http-verbs).\"", "tags": [ "gists" ], "operationId": "gists/star", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#star-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } }, "delete": { "summary": "Unstar a gist", "description": "", "tags": [ "gists" ], "operationId": "gists/unstar", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#unstar-a-gist" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gists/{gist_id}/{sha}": { "get": { "summary": "Get a gist revision", "description": "", "tags": [ "gists" ], "operationId": "gists/get-revision", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gists#get-a-gist-revision" }, "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "name": "sha", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gist-simple" }, "examples": { "default": { "$ref": "#/components/examples/gist" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "gists", "subcategory": null } } }, "/gitignore/templates": { "get": { "summary": "Get all gitignore templates", "description": "List all templates available to pass as an option when [creating a repository](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-a-repository-for-the-authenticated-user).", "operationId": "gitignore/get-all-templates", "tags": [ "gitignore" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gitignore#get-all-gitignore-templates" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } }, "examples": { "default": { "value": [ "Actionscript", "Android", "AppceleratorTitanium", "Autotools", "Bancha", "C", "C++" ] } } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "gitignore", "subcategory": null } } }, "/gitignore/templates/{name}": { "get": { "summary": "Get a gitignore template", "description": "The API also allows fetching the source of a single template.\nUse the raw [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/) to get the raw contents.", "operationId": "gitignore/get-template", "tags": [ "gitignore" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/gitignore#get-a-gitignore-template" }, "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/gitignore-template" }, "examples": { "default": { "$ref": "#/components/examples/gitignore-template" } } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "gitignore", "subcategory": null } } }, "/installation/repositories": { "get": { "summary": "List repositories accessible to the app installation", "description": "List repositories that an app installation can access.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/list-repos-accessible-to-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#list-repositories-accessible-to-the-app-installation" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "repositories" ], "properties": { "total_count": { "type": "integer" }, "repositories": { "type": "array", "items": { "$ref": "#/components/schemas/repository" } }, "repository_selection": { "type": "string", "example": "selected" } } }, "examples": { "default": { "$ref": "#/components/examples/repository-paginated-2" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "403": { "$ref": "#/components/responses/forbidden" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "installations", "previews": [ { "required": false, "name": "mercy", "note": "The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.mercy-preview+json\n```" } ] } } }, "/installation/token": { "delete": { "summary": "Revoke an installation access token", "description": "Revokes the installation token you're using to authenticate as an installation and access this endpoint.\n\nOnce an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \"[Create an installation access token for an app](https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-an-installation-access-token-for-an-app)\" endpoint.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/revoke-installation-access-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#revoke-an-installation-access-token" }, "parameters": [ ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "installations" } } }, "/issues": { "get": { "summary": "List issues assigned to the authenticated user", "description": "List issues assigned to the authenticated user across all visible repositories including owned repositories, member\nrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not\nnecessarily assigned to you.\n\n\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\nreason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\nrequest id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.1/rest/reference/pulls#list-pull-requests)\" endpoint.", "tags": [ "issues" ], "operationId": "issues/list", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/issues#list-issues-assigned-to-the-authenticated-user" }, "parameters": [ { "name": "filter", "description": "Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "assigned", "created", "mentioned", "subscribed", "repos", "all" ], "default": "assigned" } }, { "name": "state", "description": "Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "open", "closed", "all" ], "default": "open" } }, { "$ref": "#/components/parameters/labels" }, { "name": "sort", "description": "What to sort results by. Can be either `created`, `updated`, `comments`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "comments" ], "default": "created" } }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/since" }, { "name": "collab", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "name": "orgs", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "name": "owned", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "name": "pulls", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/issue" } }, "examples": { "default": { "$ref": "#/components/examples/issue-with-repo-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "issues", "previews": [ { "required": false, "name": "machine-man", "note": "If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\tinformation about the GitHub App. For more information, see the [related blog\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.machine-man-preview\n```" }, { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/licenses": { "get": { "summary": "Get all commonly used licenses", "description": "", "tags": [ "licenses" ], "operationId": "licenses/get-all-commonly-used", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/licenses#get-all-commonly-used-licenses" }, "parameters": [ { "name": "featured", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/license-simple" } }, "examples": { "default": { "$ref": "#/components/examples/license-simple-items" } } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "licenses", "subcategory": null } } }, "/licenses/{license}": { "get": { "summary": "Get a license", "description": "", "tags": [ "licenses" ], "operationId": "licenses/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/licenses#get-a-license" }, "parameters": [ { "name": "license", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/license" }, "examples": { "default": { "$ref": "#/components/examples/license" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "licenses", "subcategory": null } } }, "/markdown": { "post": { "summary": "Render a Markdown document", "description": "", "operationId": "markdown/render", "tags": [ "markdown" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/markdown#render-a-markdown-document" }, "parameters": [ ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "text": { "description": "The Markdown text to render in HTML.", "type": "string" }, "mode": { "description": "The rendering mode. Can be either `markdown` or `gfm`.", "enum": [ "markdown", "gfm" ], "default": "markdown", "example": "markdown", "type": "string" }, "context": { "description": "The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository.", "type": "string" } }, "required": [ "text" ], "type": "object" } } } }, "responses": { "200": { "description": "Response", "headers": { "Content-Type": { "$ref": "#/components/headers/content-type" }, "Content-Length": { "example": "279", "schema": { "type": "string" } }, "X-CommonMarker-Version": { "$ref": "#/components/headers/x-common-marker-version" } }, "content": { "text/html": { "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "markdown", "subcategory": null } } }, "/markdown/raw": { "post": { "summary": "Render a Markdown document in raw mode", "description": "You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.", "operationId": "markdown/render-raw", "tags": [ "markdown" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/markdown#render-a-markdown-document-in-raw-mode" }, "parameters": [ ], "requestBody": { "required": false, "content": { "text/plain": { "schema": { "type": "string" } }, "text/x-markdown": { "schema": { "type": "string" } } } }, "responses": { "200": { "description": "Response", "headers": { "X-CommonMarker-Version": { "$ref": "#/components/headers/x-common-marker-version" } }, "content": { "text/html": { "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "markdown", "subcategory": null } } }, "/meta": { "get": { "summary": "Get GitHub Enterprise Server meta information", "description": "", "tags": [ "meta" ], "operationId": "meta/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/meta#get-github-meta-information" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/api-overview" }, "examples": { "default": { "$ref": "#/components/examples/api-overview" } } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "meta", "subcategory": null } } }, "/networks/{owner}/{repo}/events": { "get": { "summary": "List public events for a network of repositories", "description": "", "tags": [ "activity" ], "operationId": "activity/list-public-events-for-repo-network", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#list-public-events-for-a-network-of-repositories" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/event" } }, "examples": { "default": { "$ref": "#/components/examples/public-repo-events-items" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" }, "304": { "$ref": "#/components/responses/not_modified" }, "301": { "$ref": "#/components/responses/moved_permanently" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "activity", "subcategory": "events" } } }, "/notifications": { "get": { "summary": "List notifications for the authenticated user", "description": "List all notifications for the current user, sorted by most recently updated.", "tags": [ "activity" ], "operationId": "activity/list-notifications-for-authenticated-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#list-notifications-for-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/all" }, { "$ref": "#/components/parameters/participating" }, { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/before" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/thread" } }, "examples": { "default": { "$ref": "#/components/examples/thread-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } }, "put": { "summary": "Mark notifications as read", "description": "Marks all notifications as \"read\" removes it from the [default view on GitHub Enterprise Server](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as \"read.\" To check whether any \"unread\" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/enterprise-server@3.1/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.", "tags": [ "activity" ], "operationId": "activity/mark-notifications-as-read", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#mark-notifications-as-read" }, "parameters": [ ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "last_read_at": { "description": "Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp.", "type": "string", "format": "date-time" }, "read": { "description": "Whether the notification has been read.", "type": "boolean" } } }, "examples": { "default": { "value": { "last_read_at": "2022-06-10T00:00:00Z", "read": true } } } } } }, "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } } }, "examples": { "default": { "$ref": "#/components/examples/notifications-mark-read" } } } } }, "205": { "description": "Reset Content" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } } }, "/notifications/threads/{thread_id}": { "get": { "summary": "Get a thread", "description": "", "tags": [ "activity" ], "operationId": "activity/get-thread", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#get-a-thread" }, "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/thread" }, "examples": { "default": { "$ref": "#/components/examples/thread" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } }, "patch": { "summary": "Mark a thread as read", "description": "", "tags": [ "activity" ], "operationId": "activity/mark-thread-as-read", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#mark-a-thread-as-read" }, "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "205": { "description": "Reset Content" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } } }, "/notifications/threads/{thread_id}/subscription": { "get": { "summary": "Get a thread subscription for the authenticated user", "description": "This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.1/rest/reference/activity#get-a-repository-subscription).\n\nNote that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.", "tags": [ "activity" ], "operationId": "activity/get-thread-subscription-for-authenticated-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#get-a-thread-subscription-for-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/thread-subscription" }, "examples": { "default": { "$ref": "#/components/examples/thread-subscription" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } }, "put": { "summary": "Set a thread subscription", "description": "If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.\n\nYou can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.\n\nUnsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.1/rest/reference/activity#delete-a-thread-subscription) endpoint.", "tags": [ "activity" ], "operationId": "activity/set-thread-subscription", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#set-a-thread-subscription" }, "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "properties": { "ignored": { "description": "Whether to block all notifications from a thread.", "default": false, "type": "boolean" } }, "type": "object" }, "examples": { "default": { "value": { "ignored": false } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/thread-subscription" }, "examples": { "default": { "$ref": "#/components/examples/thread-subscription" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } }, "delete": { "summary": "Delete a thread subscription", "description": "Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.1/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`.", "tags": [ "activity" ], "operationId": "activity/delete-thread-subscription", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#delete-a-thread-subscription" }, "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "activity", "subcategory": "notifications" } } }, "/octocat": { "get": { "summary": "Get Octocat", "description": "Get the octocat as ASCII art", "tags": [ "meta" ], "operationId": "meta/get-octocat", "parameters": [ { "name": "s", "in": "query", "description": "The words to show in Octocat's speech bubble", "schema": { "type": "string" }, "required": false } ], "responses": { "200": { "description": "Response", "content": { "application/octocat-stream": { "schema": { "type": "string" }, "examples": { "default": { "$ref": "#/components/examples/octocat" } } } } } }, "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/meta#get-octocat" }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "meta" } } }, "/organizations": { "get": { "summary": "List organizations", "description": "Lists all organizations, in the order that they were created on GitHub Enterprise Server.\n\n**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations.", "tags": [ "orgs" ], "operationId": "orgs/list", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-organizations" }, "parameters": [ { "$ref": "#/components/parameters/since-org" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/organization-simple" } }, "examples": { "default": { "$ref": "#/components/examples/organization-simple-items" } } } }, "headers": { "Link": { "example": "; rel=\"next\"", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": null } } }, "/orgs/{org}": { "get": { "summary": "Get an organization", "description": "To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).\n\nGitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub Enterprise Server plan. See \"[Authenticating with GitHub Apps](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/)\" for details. For an example response, see 'Response with GitHub Enterprise Server plan information' below.\"", "tags": [ "orgs" ], "operationId": "orgs/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#get-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/organization-full" }, "examples": { "default-response": { "$ref": "#/components/examples/organization-full-default-response" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "previews": [ { "required": false, "name": "surtur", "note": "New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\n\nTo access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.surtur-preview+json\n```" } ] } }, "patch": { "summary": "Update an organization", "description": "**Parameter Deprecation Notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).\n\nEnables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges.", "tags": [ "orgs" ], "operationId": "orgs/update", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs/#update-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "billing_email": { "type": "string", "description": "Billing email address. This address is not publicized." }, "company": { "type": "string", "description": "The company name." }, "email": { "type": "string", "description": "The publicly visible email address." }, "twitter_username": { "type": "string", "description": "The Twitter username of the company." }, "location": { "type": "string", "description": "The location." }, "name": { "type": "string", "description": "The shorthand name of the company." }, "description": { "type": "string", "description": "The description of the company." }, "has_organization_projects": { "type": "boolean", "description": "Whether an organization can use organization projects." }, "has_repository_projects": { "type": "boolean", "description": "Whether repositories that belong to the organization can use repository projects." }, "default_repository_permission": { "type": "string", "description": "Default permission level members have for organization repositories.", "enum": [ "read", "write", "admin", "none" ], "default": "read" }, "members_can_create_repositories": { "type": "boolean", "description": "Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details.", "default": true }, "members_can_create_internal_repositories": { "type": "boolean", "description": "Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see \"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\" in the GitHub Help documentation." }, "members_can_create_private_repositories": { "type": "boolean", "description": "Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see \"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\" in the GitHub Help documentation." }, "members_can_create_public_repositories": { "type": "boolean", "description": "Whether organization members can create public repositories, which are visible to anyone. For more information, see \"[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)\" in the GitHub Help documentation." }, "members_allowed_repository_creation_type": { "type": "string", "description": "Specifies which types of repositories non-admin organization members can create. \n**Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details.", "enum": [ "all", "private", "none" ] }, "members_can_create_pages": { "type": "boolean", "description": "Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted.", "default": true }, "blog": { "type": "string", "example": "\"http://github.blog\"" } } }, "examples": { "default": { "value": { "billing_email": "mona@github.com", "company": "GitHub", "email": "mona@github.com", "twitter_username": "github", "location": "San Francisco", "name": "github", "description": "GitHub, the company.", "default_repository_permission": "read", "members_can_create_repositories": true, "members_allowed_repository_creation_type": "all" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/organization-full" }, "examples": { "default": { "$ref": "#/components/examples/organization-full" } } } } }, "422": { "description": "Validation failed", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/validation-error" }, { "$ref": "#/components/schemas/validation-error-simple" } ] } } } }, "409": { "$ref": "#/components/responses/conflict" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "previews": [ { "required": false, "name": "surtur", "note": "New repository creation permissions are available to preview. You can now use `members_can_create_public_repositories`, `members_can_create_private_repositories`, and `members_can_create_internal_repositories`. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. These parameters provide more granular permissions to configure the type of repositories organization members can create.\n\nTo access these new parameters during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.surtur-preview+json\n```" } ] } } }, "/orgs/{org}/actions/permissions": { "get": { "summary": "Get GitHub Actions permissions for an organization", "description": "Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/get-github-actions-permissions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-github-actions-permissions-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-organization-permissions" }, "examples": { "default": { "$ref": "#/components/examples/actions-organization-permissions" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set GitHub Actions permissions for an organization", "description": "Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n\nIf the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/set-github-actions-permissions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-github-actions-permissions-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled_repositories": { "$ref": "#/components/schemas/enabled-repositories" }, "allowed_actions": { "$ref": "#/components/schemas/allowed-actions" } }, "required": [ "enabled_repositories" ] }, "examples": { "default": { "value": { "enabled_repositories": "all", "allowed_actions": "selected" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/repositories": { "get": { "summary": "List selected repositories enabled for GitHub Actions in an organization", "description": "Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/list-selected-repositories-enabled-github-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "repositories" ], "properties": { "total_count": { "type": "number" }, "repositories": { "type": "array", "items": { "$ref": "#/components/schemas/repository" } } } }, "examples": { "default": { "$ref": "#/components/examples/repository-paginated" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set selected repositories enabled for GitHub Actions in an organization", "description": "Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/set-selected-repositories-enabled-github-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "selected_repository_ids": { "description": "List of repository IDs to enable for GitHub Actions.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the repository." } } }, "required": [ "selected_repository_ids" ] }, "examples": { "default": { "value": { "selected_repository_ids": [ 32, 42 ] } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/repositories/{repository_id}": { "put": { "summary": "Enable a selected repository for GitHub Actions in an organization", "description": "Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/enable-selected-repository-github-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "delete": { "summary": "Disable a selected repository for GitHub Actions in an organization", "description": "Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/disable-selected-repository-github-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/selected-actions": { "get": { "summary": "Get allowed actions for an organization", "description": "Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/get-allowed-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-allowed-actions-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "default": { "$ref": "#/components/examples/selected-actions" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set allowed actions for an organization", "description": "Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nIf the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.\n\nTo use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "operationId": "actions/set-allowed-actions-organization", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-allowed-actions-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "selected_actions": { "$ref": "#/components/examples/selected-actions" } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/orgs/{org}/actions/runner-groups": { "get": { "summary": "List self-hosted runner groups for an organization", "description": "Lists all self-hosted runner groups configured in an organization and inherited from an enterprise.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/list-self-hosted-runner-groups-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "runner_groups" ], "properties": { "total_count": { "type": "number" }, "runner_groups": { "type": "array", "items": { "$ref": "#/components/schemas/runner-groups-org" } } } }, "examples": { "default": { "$ref": "#/components/examples/runner-groups-org" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "post": { "summary": "Create a self-hosted runner group for an organization", "description": "The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\"\n\nCreates a new self-hosted runner group for an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/create-self-hosted-runner-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "description": "Name of the runner group.", "type": "string" }, "visibility": { "description": "Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories.", "type": "string", "enum": [ "selected", "all", "private" ], "default": "all" }, "selected_repository_ids": { "description": "List of repository IDs that can access the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the repository." } }, "runners": { "description": "List of runner IDs to add to the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the runner." } }, "allows_public_repositories": { "description": "Whether the runner group can be used by `public` repositories.", "type": "boolean", "default": false } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Expensive hardware runners", "visibility": "selected", "selected_repository_ids": [ 32, 91 ], "runners": [ 9, 2 ] } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-org" }, "examples": { "default": { "$ref": "#/components/examples/runner-group" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runner-groups/{runner_group_id}": { "get": { "summary": "Get a self-hosted runner group for an organization", "description": "Gets a specific self-hosted runner group for an organization.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/get-self-hosted-runner-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-org" }, "examples": { "default": { "$ref": "#/components/examples/runner-group-item" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "patch": { "summary": "Update a self-hosted runner group for an organization", "description": "Updates the `name` and `visibility` of a self-hosted runner group in an organization.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/update-self-hosted-runner-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "description": "Name of the runner group.", "type": "string" }, "visibility": { "description": "Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories.", "type": "string", "enum": [ "selected", "all", "private" ] }, "allows_public_repositories": { "description": "Whether the runner group can be used by `public` repositories.", "type": "boolean", "default": false } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Expensive hardware runners", "visibility": "selected" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner-groups-org" }, "examples": { "default": { "$ref": "#/components/examples/runner-group" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Delete a self-hosted runner group from an organization", "description": "Deletes a self-hosted runner group for an organization.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/delete-self-hosted-runner-group-from-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": { "get": { "summary": "List repository access to a self-hosted runner group in an organization", "description": "The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see \"[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products).\"\n\nLists the repositories with access to a self-hosted runner group configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/list-repo-access-to-self-hosted-runner-group-in-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "repositories" ], "properties": { "total_count": { "type": "number" }, "repositories": { "type": "array", "items": { "$ref": "#/components/schemas/minimal-repository" } } } }, "examples": { "default": { "$ref": "#/components/examples/minimal-repository-paginated" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "put": { "summary": "Set repository access for a self-hosted runner group in an organization", "description": "Replaces the list of repositories that have access to a self-hosted runner group configured in an organization.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/set-repo-access-to-self-hosted-runner-group-in-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-repository-access-to-a-self-hosted-runner-group-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "selected_repository_ids": { "description": "List of repository IDs that can access the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the repository." } } }, "required": [ "selected_repository_ids" ] }, "examples": { "default": { "value": { "selected_repository_ids": [ 32, 91 ] } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}": { "put": { "summary": "Add repository access to a self-hosted runner group in an organization", "description": "Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\"\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/add-repo-access-to-self-hosted-runner-group-in-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#add-repository-acess-to-a-self-hosted-runner-group-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": true, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Remove repository access to a self-hosted runner group in an organization", "description": "Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see \"[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization).\"\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/remove-repo-access-to-self-hosted-runner-group-in-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runner-groups/{runner_group_id}/runners": { "get": { "summary": "List self-hosted runners in a group for an organization", "description": "Lists self-hosted runners that are in a specific organization group.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/list-self-hosted-runners-in-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "runners" ], "properties": { "total_count": { "type": "number" }, "runners": { "type": "array", "items": { "$ref": "#/components/schemas/runner" } } } }, "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "put": { "summary": "Set self-hosted runners in a group for an organization", "description": "Replaces the list of self-hosted runners that are part of an organization runner group.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/set-self-hosted-runners-in-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "runners": { "description": "List of runner IDs to add to the runner group.", "type": "array", "items": { "type": "integer", "description": "Unique identifier of the runner." } } }, "required": [ "runners" ] }, "examples": { "default": { "value": { "runners": [ 9, 2 ] } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": { "put": { "summary": "Add a self-hosted runner to a group for an organization", "description": "Adds a self-hosted runner to a runner group configured in an organization.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/add-self-hosted-runner-to-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } }, "delete": { "summary": "Remove a self-hosted runner from a group for an organization", "description": "Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "operationId": "actions/remove-self-hosted-runner-from-group-for-org", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-group-id" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "self-hosted-runner-groups" } } }, "/orgs/{org}/actions/runners": { "get": { "summary": "List self-hosted runners for an organization", "description": "Lists all self-hosted runners configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-self-hosted-runners-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runners-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "runners" ], "properties": { "total_count": { "type": "integer" }, "runners": { "type": "array", "items": { "$ref": "#/components/schemas/runner" } } } }, "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/downloads": { "get": { "summary": "List runner applications for an organization", "description": "Lists binaries for the runner application that you can download and run.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-runner-applications-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-runner-applications-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/runner-application" } }, "examples": { "default": { "$ref": "#/components/examples/runner-application-items" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/registration-token": { "post": { "summary": "Create a registration token for an organization", "description": "Returns a token that you can pass to the `config` script. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n#### Example using registration token\n\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/octo-org --token TOKEN\n```", "tags": [ "actions" ], "operationId": "actions/create-registration-token-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-registration-token-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/remove-token": { "post": { "summary": "Create a remove token for an organization", "description": "Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n#### Example using remove token\n\nTo remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this\nendpoint.\n\n```\n./config.sh remove --token TOKEN\n```", "tags": [ "actions" ], "operationId": "actions/create-remove-token-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-remove-token-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/{runner_id}": { "get": { "summary": "Get a self-hosted runner for an organization", "description": "Gets a specific self-hosted runner configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-self-hosted-runner-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-self-hosted-runner-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner" }, "examples": { "default": { "$ref": "#/components/examples/runner" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } }, "delete": { "summary": "Delete a self-hosted runner from an organization", "description": "Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-self-hosted-runner-from-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/secrets": { "get": { "summary": "List organization secrets", "description": "Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-org-secrets", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-organization-secrets" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "secrets" ], "properties": { "total_count": { "type": "integer" }, "secrets": { "type": "array", "items": { "$ref": "#/components/schemas/organization-actions-secret" } } } }, "examples": { "default": { "$ref": "#/components/examples/organization-actions-secret-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/public-key": { "get": { "summary": "Get an organization public key", "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-org-public-key", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-an-organization-public-key" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-public-key" }, "examples": { "default": { "$ref": "#/components/examples/actions-public-key" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}": { "get": { "summary": "Get an organization secret", "description": "Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/organization-actions-secret" }, "examples": { "default": { "$ref": "#/components/examples/organization-actions-secret" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "put": { "summary": "Create or update an organization secret", "description": "Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to\nuse this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n```\nconst sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n```\n\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "tags": [ "actions" ], "operationId": "actions/create-or-update-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-or-update-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "encrypted_value": { "type": "string", "description": "Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-an-organization-public-key) endpoint.", "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$" }, "key_id": { "type": "string", "description": "ID of the key you used to encrypt the secret." }, "visibility": { "type": "string", "description": "Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret.", "enum": [ "all", "private", "selected" ] }, "selected_repository_ids": { "type": "array", "description": "An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" } } }, "required": [ "visibility" ] }, "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678", "visibility": "selected", "selected_repository_ids": [ 1296269, 1296280 ] } } } } } }, "responses": { "201": { "description": "Response when creating a secret", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/empty-object" }, "examples": { "default": { "value": null } } } } }, "204": { "description": "Response when updating a secret" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "delete": { "summary": "Delete an organization secret", "description": "Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}/repositories": { "get": { "summary": "List selected repositories for an organization secret", "description": "Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-selected-repos-for-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-selected-repositories-for-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "repositories" ], "properties": { "total_count": { "type": "integer" }, "repositories": { "type": "array", "items": { "$ref": "#/components/schemas/minimal-repository" } } } }, "examples": { "default": { "$ref": "#/components/examples/public-repository-paginated" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "put": { "summary": "Set selected repositories for an organization secret", "description": "Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/set-selected-repos-for-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-selected-repositories-for-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "selected_repository_ids": { "type": "array", "description": "An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" } } }, "required": [ "selected_repository_ids" ] }, "examples": { "default": { "value": { "selected_repository_ids": [ 64780797 ] } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}": { "put": { "summary": "Add selected repository to an organization secret", "description": "Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/add-selected-repo-to-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#add-selected-repository-to-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "name": "repository_id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "No Content when repository was added to the selected list" }, "409": { "description": "Conflict when visibility type is not set to selected" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "delete": { "summary": "Remove selected repository from an organization secret", "description": "Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/remove-selected-repo-from-org-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#remove-selected-repository-from-an-organization-secret" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "name": "repository_id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Response when repository was removed from the selected list" }, "409": { "description": "Conflict when visibility type not set to selected" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/orgs/{org}/events": { "get": { "summary": "List public organization events", "description": "", "tags": [ "activity" ], "operationId": "activity/list-public-org-events", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/activity#list-public-organization-events" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/event" } }, "examples": { "200-response": { "$ref": "#/components/examples/public-org-events-items" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "activity", "subcategory": "events" } } }, "/orgs/{org}/hooks": { "get": { "summary": "List organization webhooks", "description": "", "tags": [ "orgs" ], "operationId": "orgs/list-webhooks", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-organization-webhooks" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/org-hook" } }, "examples": { "default": { "$ref": "#/components/examples/org-hook-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } }, "post": { "summary": "Create an organization webhook", "description": "Here's how you can create a hook that posts payloads in JSON format:", "tags": [ "orgs" ], "operationId": "orgs/create-webhook", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#create-an-organization-webhook" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": true, "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. [These are defined below](https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#create-hook-config-params).", "properties": { "url": { "$ref": "#/components/schemas/webhook-config-url" }, "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" }, "username": { "type": "string", "example": "\"kdaigle\"" }, "password": { "type": "string", "example": "\"password\"" } }, "required": [ "url" ] }, "events": { "type": "array", "description": "Determines what [events](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads) the hook is triggered for.", "default": [ "push" ], "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" ] }, "examples": { "default": { "value": { "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com/webhook", "content_type": "json" } } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-hook" } } } }, "headers": { "Location": { "example": "https://api.github.com/orgs/octocat/hooks/1", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}": { "get": { "summary": "Get an organization webhook", "description": "Returns a webhook configured in an organization. To get only the webhook `config` properties, see \"[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization).\"", "tags": [ "orgs" ], "operationId": "orgs/get-webhook", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#get-an-organization-webhook" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-hook" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } }, "patch": { "summary": "Update an organization webhook", "description": "Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use \"[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization).\"", "tags": [ "orgs" ], "operationId": "orgs/update-webhook", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#update-an-organization-webhook" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "config": { "type": "object", "description": "Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#update-hook-config-params).", "properties": { "url": { "$ref": "#/components/schemas/webhook-config-url" }, "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" } }, "required": [ "url" ] }, "events": { "type": "array", "description": "Determines what [events](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads) the hook is triggered for.", "default": [ "push" ], "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 }, "name": { "type": "string", "example": "\"web\"" } } }, "examples": { "default": { "value": { "active": true, "events": [ "pull_request" ] } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-hook-2" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } }, "delete": { "summary": "Delete an organization webhook", "description": "", "tags": [ "orgs" ], "operationId": "orgs/delete-webhook", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#delete-an-organization-webhook" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/config": { "get": { "summary": "Get a webhook configuration for an organization", "description": "Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use \"[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook).\"\n\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission.", "tags": [ "orgs" ], "operationId": "orgs/get-webhook-config-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#get-a-webhook-configuration-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } }, "patch": { "summary": "Update a webhook configuration for an organization", "description": "Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use \"[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook).\"\n\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission.", "tags": [ "orgs" ], "operationId": "orgs/update-webhook-config-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#update-a-webhook-configuration-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "$ref": "#/components/schemas/webhook-config-url" }, "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" } } }, "examples": { "default": { "summary": "Update an existing webhook", "value": { "url": "http://example.com/webhook", "content_type": "json", "insecure_ssl": "0", "secret": "********" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/pings": { "post": { "summary": "Ping an organization webhook", "description": "This will trigger a [ping event](https://docs.github.com/enterprise-server@3.1/webhooks/#ping-event) to be sent to the hook.", "tags": [ "orgs" ], "operationId": "orgs/ping-webhook", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#ping-an-organization-webhook" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "webhooks" } } }, "/orgs/{org}/installation": { "get": { "summary": "Get an organization installation for the authenticated app", "description": "Enables an authenticated GitHub App to find the organization's installation information.\n\nYou must use a [JWT](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/get-org-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/installation" }, "examples": { "default": { "$ref": "#/components/examples/installation" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": null } } }, "/orgs/{org}/installations": { "get": { "summary": "List app installations for an organization", "description": "Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint.", "tags": [ "orgs" ], "operationId": "orgs/list-app-installations", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-app-installations-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "installations" ], "properties": { "total_count": { "type": "integer" }, "installations": { "type": "array", "items": { "$ref": "#/components/schemas/installation" } } } }, "examples": { "default": { "$ref": "#/components/examples/installation-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": null } } }, "/orgs/{org}/issues": { "get": { "summary": "List organization issues assigned to the authenticated user", "description": "List issues in an organization assigned to the authenticated user.\n\n**Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this\nreason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\nrequest id, use the \"[List pull requests](https://docs.github.com/enterprise-server@3.1/rest/reference/pulls#list-pull-requests)\" endpoint.", "tags": [ "issues" ], "operationId": "issues/list-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "name": "filter", "description": "Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "assigned", "created", "mentioned", "subscribed", "repos", "all" ], "default": "assigned" } }, { "name": "state", "description": "Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "open", "closed", "all" ], "default": "open" } }, { "$ref": "#/components/parameters/labels" }, { "name": "sort", "description": "What to sort results by. Can be either `created`, `updated`, `comments`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "comments" ], "default": "created" } }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/issue" } }, "examples": { "default": { "$ref": "#/components/examples/issue-with-repo-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "issues", "previews": [ { "required": false, "name": "machine-man", "note": "If an issue event is created via a GitHub App, the response will include the `performed_via_github_app` object with\tinformation about the GitHub App. For more information, see the [related blog\tpost](https://developer.github.com/changes/2016-09-14-Integrations-Early-Access).\nTo receive the `performed_via_github_app` object in the response, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.machine-man-preview\n```" }, { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/members": { "get": { "summary": "List organization members", "description": "List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.", "tags": [ "orgs" ], "operationId": "orgs/list-members", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-organization-members" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "name": "filter", "description": "Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "2fa_disabled", "all" ], "default": "all" } }, { "name": "role", "description": "Filter members returned by their role.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "all", "admin", "member" ], "default": "all" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "302": { "description": "Response if requester is not an organization member", "headers": { "Location": { "example": "https://api.github.com/orgs/github/public_members", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } } }, "/orgs/{org}/members/{username}": { "get": { "summary": "Check organization membership for a user", "description": "Check if a user is, publicly or privately, a member of the organization.", "tags": [ "orgs" ], "operationId": "orgs/check-membership-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#check-organization-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response if requester is an organization member and user is a member" }, "302": { "description": "Response if requester is not an organization member", "headers": { "Location": { "example": "https://api.github.com/orgs/github/public_members/pezra", "schema": { "type": "string" } } } }, "404": { "description": "Not Found if requester is an organization member and user is not a member" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } }, "delete": { "summary": "Remove an organization member", "description": "Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.", "tags": [ "orgs" ], "operationId": "orgs/remove-member", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#remove-an-organization-member" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } } }, "/orgs/{org}/memberships/{username}": { "get": { "summary": "Get organization membership for a user", "description": "In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.", "tags": [ "orgs" ], "operationId": "orgs/get-membership-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#get-organization-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-membership" }, "examples": { "response-if-user-has-an-active-admin-membership-with-organization": { "$ref": "#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } }, "put": { "summary": "Set organization membership for a user", "description": "Only authenticated organization owners can add a member to the organization or update the member's role.\n\n* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.\n \n* Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.\n\n**Rate limits**\n\nTo prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.", "tags": [ "orgs" ], "operationId": "orgs/set-membership-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#set-organization-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "type": "string", "description": "The role to give the user in the organization. Can be one of: \n\\* `admin` - The user will become an owner of the organization. \n\\* `member` - The user will become a non-owner member of the organization.", "enum": [ "admin", "member" ], "default": "member" } } }, "examples": { "default": { "summary": "Set an organization membership role for a user", "value": { "role": "member" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-membership" }, "examples": { "response-if-user-already-had-membership-with-organization": { "$ref": "#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } }, "delete": { "summary": "Remove organization membership for a user", "description": "In order to remove a user's membership with an organization, the authenticated user must be an organization owner.\n\nIf the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.", "tags": [ "orgs" ], "operationId": "orgs/remove-membership-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#remove-organization-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } } }, "/orgs/{org}/outside_collaborators": { "get": { "summary": "List outside collaborators for an organization", "description": "List all users who are outside collaborators of an organization.", "tags": [ "orgs" ], "operationId": "orgs/list-outside-collaborators", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-outside-collaborators-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "name": "filter", "description": "Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "2fa_disabled", "all" ], "default": "all" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "outside-collaborators" } } }, "/orgs/{org}/outside_collaborators/{username}": { "put": { "summary": "Convert an organization member to outside collaborator", "description": "When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see \"[Converting an organization member to an outside collaborator](https://docs.github.com/enterprise-server@3.1/articles/converting-an-organization-member-to-an-outside-collaborator/)\".", "tags": [ "orgs" ], "operationId": "orgs/convert-member-to-outside-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "async": { "type": "boolean", "description": "When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued.", "default": false } } }, "examples": { "202": { "summary": "Status code 202, asynchronous request", "value": { "async": true } }, "204": { "summary": "Status code 204, synchronous request", "value": null } } } } }, "responses": { "202": { "description": "User is getting converted asynchronously", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false }, "examples": { "202": { "value": null } } } } }, "204": { "description": "User was converted" }, "403": { "description": "Forbidden if user is the last owner of the organization or not a member of the organization." }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "outside-collaborators" } }, "delete": { "summary": "Remove outside collaborator from an organization", "description": "Removing a user from this list will remove them from all the organization's repositories.", "tags": [ "orgs" ], "operationId": "orgs/remove-outside-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#remove-outside-collaborator-from-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "422": { "description": "Unprocessable Entity if user is a member of the organization", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" } } }, "examples": { "response-if-user-is-a-member-of-the-organization": { "value": { "message": "You cannot specify an organization member to remove as an outside collaborator.", "documentation_url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#remove-outside-collaborator" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "outside-collaborators" } } }, "/orgs/{org}/pre-receive-hooks": { "get": { "summary": "List pre-receive hooks for an organization", "description": "List all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed.", "operationId": "enterprise-admin/list-pre-receive-hooks-for-org", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#list-pre-receive-hooks-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/direction" }, { "name": "sort", "description": "The sort order for the response collection.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "name" ], "default": "created" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/org-pre-receive-hook" } }, "examples": { "default": { "$ref": "#/components/examples/org-pre-receive-hook-items" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "enterprise-admin", "subcategory": "org-pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}": { "get": { "summary": "Get a pre-receive hook for an organization", "description": "", "operationId": "enterprise-admin/get-pre-receive-hook-for-org", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#get-a-pre-receive-hook-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-pre-receive-hook" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "enterprise-admin", "subcategory": "org-pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "patch": { "summary": "Update pre-receive hook enforcement for an organization", "description": "For pre-receive hooks which are allowed to be configured at the org level, you can set `enforcement` and `allow_downstream_configuration`", "operationId": "enterprise-admin/update-pre-receive-hook-enforcement-for-org", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-pre-receive-hook-enforcement-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-pre-receive-hook-2" } } } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "enforcement": { "description": "The state of enforcement for the hook on this repository.", "type": "string" }, "allow_downstream_configuration": { "description": "Whether repositories can override enforcement.", "type": "boolean" } } }, "examples": { "default": { "value": { "enforcement": "enabled", "allow_downstream_configuration": false } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "enterprise-admin", "subcategory": "org-pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } }, "delete": { "summary": "Remove pre-receive hook enforcement for an organization", "description": "Removes any overrides for this hook at the org level for this org.", "operationId": "enterprise-admin/remove-pre-receive-hook-enforcement-for-org", "tags": [ "enterprise-admin" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#remove-pre-receive-hook-enforcement-for-an-organization" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/pre-receive-hook-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/org-pre-receive-hook" }, "examples": { "default": { "$ref": "#/components/examples/org-pre-receive-hook" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "enterprise-admin", "subcategory": "org-pre-receive-hooks", "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](/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.eye-scream-preview\n```" } ] } } }, "/orgs/{org}/projects": { "get": { "summary": "List organization projects", "description": "Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.", "tags": [ "projects" ], "operationId": "projects/list-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#list-organization-projects" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "name": "state", "description": "Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "open", "closed", "all" ], "default": "open" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/project" } }, "examples": { "default": { "$ref": "#/components/examples/project-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "post": { "summary": "Create an organization project", "description": "Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.", "tags": [ "projects" ], "operationId": "projects/create-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#create-an-organization-project" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the project." }, "body": { "type": "string", "description": "The description of the project." } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Organization Roadmap", "body": "High-level roadmap for the upcoming year." } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project" }, "examples": { "default": { "$ref": "#/components/examples/project-2" } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "410": { "$ref": "#/components/responses/gone" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/orgs/{org}/public_members": { "get": { "summary": "List public organization members", "description": "Members of an organization can choose to have their membership publicized or not.", "tags": [ "orgs" ], "operationId": "orgs/list-public-members", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#list-public-organization-members" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } } }, "/orgs/{org}/public_members/{username}": { "get": { "summary": "Check public organization membership for a user", "description": "", "tags": [ "orgs" ], "operationId": "orgs/check-public-membership-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#check-public-organization-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response if user is a public member" }, "404": { "description": "Not Found if user is not a public member" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "orgs", "subcategory": "members" } }, "put": { "summary": "Set public organization membership for the authenticated user", "description": "The user can publicize their own membership. (A user cannot publicize the membership for another user.)\n\nNote that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#http-verbs).\"", "tags": [ "orgs" ], "operationId": "orgs/set-public-membership-for-authenticated-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "orgs", "subcategory": "members" } }, "delete": { "summary": "Remove public organization membership for the authenticated user", "description": "", "tags": [ "orgs" ], "operationId": "orgs/remove-public-membership-for-authenticated-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "orgs", "subcategory": "members" } } }, "/orgs/{org}/repos": { "get": { "summary": "List organization repositories", "description": "Lists repositories for the specified organization.", "tags": [ "repos" ], "operationId": "repos/list-for-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-organization-repositories" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "name": "type", "description": "Specifies the types of repositories you want returned. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. However, the `internal` value is not yet supported when a GitHub App calls this API with an installation access token.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "all", "public", "private", "forks", "sources", "member", "internal" ] } }, { "name": "sort", "description": "The property to sort the results by.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "created", "updated", "pushed", "full_name" ], "default": "created" } }, { "name": "direction", "description": "The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/minimal-repository" } }, "examples": { "default": { "$ref": "#/components/examples/minimal-repository-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "previews": [ { "required": false, "name": "nebula", "note": "You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.1/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.nebula-preview+json\n```" }, { "required": false, "name": "baptiste", "note": "The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.baptiste-preview+json\n```" } ] } }, "post": { "summary": "Create an organization repository", "description": "Creates a new repository in the specified organization. The authenticated user must be a member of the organization.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository", "tags": [ "repos" ], "operationId": "repos/create-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-an-organization-repository" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the repository." }, "description": { "type": "string", "description": "A short description of the repository." }, "homepage": { "type": "string", "description": "A URL with more information about the repository." }, "private": { "type": "boolean", "description": "Whether the repository is private.", "default": false }, "visibility": { "type": "string", "description": "Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see \"[Creating an internal repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)\" in the GitHub Help documentation. \nThe `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header.", "enum": [ "public", "private", "internal" ] }, "has_issues": { "type": "boolean", "description": "Either `true` to enable issues for this repository or `false` to disable them.", "default": true }, "has_projects": { "type": "boolean", "description": "Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error.", "default": true }, "has_wiki": { "type": "boolean", "description": "Either `true` to enable the wiki for this repository or `false` to disable it.", "default": true }, "is_template": { "type": "boolean", "description": "Either `true` to make this repo available as a template repository or `false` to prevent it.", "default": false }, "team_id": { "type": "integer", "description": "The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization." }, "auto_init": { "type": "boolean", "description": "Pass `true` to create an initial commit with empty README.", "default": false }, "gitignore_template": { "type": "string", "description": "Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, \"Haskell\"." }, "license_template": { "type": "string", "description": "Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, \"mit\" or \"mpl-2.0\"." }, "allow_squash_merge": { "type": "boolean", "description": "Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.", "default": true }, "allow_merge_commit": { "type": "boolean", "description": "Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.", "default": true }, "allow_rebase_merge": { "type": "boolean", "description": "Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.", "default": true }, "delete_branch_on_merge": { "type": "boolean", "description": "Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.", "default": false }, "use_squash_pr_title_as_default": { "type": "boolean", "description": "Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message.", "default": false } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Hello-World", "description": "This is your first repository", "homepage": "https://github.com", "private": false, "has_issues": true, "has_projects": true, "has_wiki": true } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/repository" }, "examples": { "default": { "$ref": "#/components/examples/repository" } } } }, "headers": { "Location": { "example": "https://api.github.com/repos/octocat/Hello-World", "schema": { "type": "string" } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "previews": [ { "required": false, "name": "nebula", "note": "You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.1/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.nebula-preview+json\n```" }, { "required": false, "name": "baptiste", "note": "The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.baptiste-preview+json\n```" } ] } } }, "/orgs/{org}/teams": { "get": { "summary": "List teams", "description": "Lists all teams in an organization that are visible to the authenticated user.", "tags": [ "teams" ], "operationId": "teams/list", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-teams" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "default": { "$ref": "#/components/examples/team-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } }, "post": { "summary": "Create a team", "description": "To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see \"[Setting team creation permissions](https://docs.github.com/en/articles/setting-team-creation-permissions-in-your-organization).\"\n\nWhen you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see \"[About teams](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)\".", "tags": [ "teams" ], "operationId": "teams/create", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#create-a-team" }, "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the team." }, "description": { "type": "string", "description": "The description of the team." }, "maintainers": { "type": "array", "description": "List GitHub IDs for organization members who will become team maintainers.", "items": { "type": "string" } }, "repo_names": { "type": "array", "description": "The full name (e.g., \"organization-name/repository-name\") of repositories to add the team to.", "items": { "type": "string" } }, "privacy": { "type": "string", "description": "The level of privacy this team should have. The options are: \n**For a non-nested team:** \n\\* `secret` - only visible to organization owners and members of this team. \n\\* `closed` - visible to all members of this organization. \nDefault: `secret` \n**For a parent or child team:** \n\\* `closed` - visible to all members of this organization. \nDefault for child team: `closed`", "enum": [ "secret", "closed" ] }, "permission": { "type": "string", "description": "**Deprecated**. The permission that new repositories will be added to the team with when none is specified.", "enum": [ "pull", "push" ], "default": "pull" }, "parent_team_id": { "type": "integer", "description": "The ID of a team to set as the parent team." }, "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. LDAP synchronization must be enabled to map LDAP entries to a team. Use the \"[Update LDAP mapping for a team](https://docs.github.com/enterprise-server@3.1/rest/reference/enterprise-admin#update-ldap-mapping-for-a-team)\" endpoint to change the LDAP DN. For more information, see \"[Using LDAP](https://docs.github.com/enterprise-server@3.1/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync).\"" } }, "required": [ "name" ] }, "examples": { "default": { "value": { "name": "Justice League", "description": "A great team", "permission": "push", "privacy": "closed" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-full" }, "examples": { "default": { "$ref": "#/components/examples/team-full" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}": { "get": { "summary": "Get a team by name", "description": "Gets a team using the team's `slug`. GitHub Enterprise Server generates the `slug` from the team `name`.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.", "tags": [ "teams" ], "operationId": "teams/get-by-name", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#get-a-team-by-name" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-full" }, "examples": { "default": { "$ref": "#/components/examples/team-full" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } }, "patch": { "summary": "Update a team", "description": "To edit a team, the authenticated user must either be an organization owner or a team maintainer.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.", "tags": [ "teams" ], "operationId": "teams/update-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#update-a-team" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the team." }, "description": { "type": "string", "description": "The description of the team." }, "privacy": { "type": "string", "description": "The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: \n**For a non-nested team:** \n\\* `secret` - only visible to organization owners and members of this team. \n\\* `closed` - visible to all members of this organization. \n**For a parent or child team:** \n\\* `closed` - visible to all members of this organization.", "enum": [ "secret", "closed" ] }, "permission": { "type": "string", "description": "**Deprecated**. The permission that new repositories will be added to the team with when none is specified.", "enum": [ "pull", "push", "admin" ], "default": "pull" }, "parent_team_id": { "type": "integer", "description": "The ID of a team to set as the parent team.", "nullable": true } } }, "examples": { "default": { "value": { "name": "new team name", "description": "new team description", "privacy": "closed" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-full" }, "examples": { "default": { "$ref": "#/components/examples/team-full" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } }, "delete": { "summary": "Delete a team", "description": "To delete a team, the authenticated user must be an organization owner or team maintainer.\n\nIf you are an organization owner, deleting a parent team will delete all of its child teams as well.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.", "tags": [ "teams" ], "operationId": "teams/delete-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#delete-a-team" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/discussions": { "get": { "summary": "List discussions", "description": "List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.", "tags": [ "teams" ], "operationId": "teams/list-discussions-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-discussions" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "name": "pinned", "in": "query", "required": false, "description": "Pinned discussions only filter", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team-discussion" } }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussions", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create a discussion", "description": "Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.", "tags": [ "teams" ], "operationId": "teams/create-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#create-a-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "The discussion post's title." }, "body": { "type": "string", "description": "The discussion post's body text." }, "private": { "type": "boolean", "description": "Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post.", "default": false } }, "required": [ "title", "body" ] }, "examples": { "default": { "value": { "title": "Our first team post", "body": "Hi! This is an area for us to collaborate as a team." } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion" } } } } } }, "x-github": { "triggersNotification": true, "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussions", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": { "get": { "summary": "Get a discussion", "description": "Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "tags": [ "teams" ], "operationId": "teams/get-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#get-a-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussions", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "patch": { "summary": "Update a discussion", "description": "Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "tags": [ "teams" ], "operationId": "teams/update-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#update-a-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "description": "The discussion post's title." }, "body": { "type": "string", "description": "The discussion post's body text." } } }, "examples": { "default": { "value": { "title": "Welcome to our first team post" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussions", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "delete": { "summary": "Delete a discussion", "description": "Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "tags": [ "teams" ], "operationId": "teams/delete-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#delete-a-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussions" } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": { "get": { "summary": "List discussion comments", "description": "List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.", "tags": [ "teams" ], "operationId": "teams/list-discussion-comments-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-discussion-comments" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team-discussion-comment" } }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussion-comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create a discussion comment", "description": "Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.", "tags": [ "teams" ], "operationId": "teams/create-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#create-a-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "string", "description": "The discussion comment's body text." } }, "required": [ "body" ] }, "examples": { "default": { "value": { "body": "Do you like apples?" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion-comment" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment" } } } } } }, "x-github": { "triggersNotification": true, "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussion-comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": { "get": { "summary": "Get a discussion comment", "description": "Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "tags": [ "teams" ], "operationId": "teams/get-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#get-a-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion-comment" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussion-comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "patch": { "summary": "Update a discussion comment", "description": "Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "tags": [ "teams" ], "operationId": "teams/update-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#update-a-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "string", "description": "The discussion comment's body text." } }, "required": [ "body" ] }, "examples": { "default": { "value": { "body": "Do you like pineapples?" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-discussion-comment" }, "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussion-comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "delete": { "summary": "Delete a discussion comment", "description": "Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "tags": [ "teams" ], "operationId": "teams/delete-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#delete-a-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "discussion-comments" } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": { "get": { "summary": "List reactions for a team discussion comment", "description": "List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.", "tags": [ "reactions" ], "operationId": "reactions/list-for-team-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#list-reactions-for-a-team-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" }, { "name": "content", "description": "Returns a single [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/reaction" } }, "examples": { "default": { "$ref": "#/components/examples/reaction-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create reaction for a team discussion comment", "description": "Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.", "tags": [ "reactions" ], "operationId": "reactions/create-for-team-discussion-comment-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#create-reaction-for-a-team-discussion-comment" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "string", "description": "The [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types) to add to the team discussion comment.", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, "required": [ "content" ] }, "examples": { "default": { "value": { "content": "heart" } } } } } }, "responses": { "200": { "description": "Response when the reaction type has already been added to this team discussion comment", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } }, "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}": { "delete": { "summary": "Delete team discussion comment reaction", "description": "**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.\n\nDelete a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).", "tags": [ "reactions" ], "operationId": "reactions/delete-for-team-discussion-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#delete-team-discussion-comment-reaction" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" }, { "$ref": "#/components/parameters/reaction-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": { "get": { "summary": "List reactions for a team discussion", "description": "List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.", "tags": [ "reactions" ], "operationId": "reactions/list-for-team-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#list-reactions-for-a-team-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "name": "content", "description": "Returns a single [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/reaction" } }, "examples": { "default": { "$ref": "#/components/examples/reaction-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create reaction for a team discussion", "description": "Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.", "tags": [ "reactions" ], "operationId": "reactions/create-for-team-discussion-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#create-reaction-for-a-team-discussion" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "string", "description": "The [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types) to add to the team discussion.", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, "required": [ "content" ] }, "examples": { "default": { "value": { "content": "heart" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } }, "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}": { "delete": { "summary": "Delete team discussion reaction", "description": "**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.\n\nDelete a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).", "tags": [ "reactions" ], "operationId": "reactions/delete-for-team-discussion", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#delete-team-discussion-reaction" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/reaction-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/orgs/{org}/teams/{team_slug}/members": { "get": { "summary": "List team members", "description": "Team members will include the members of child teams.\n\nTo list members in a team, the team must be visible to the authenticated user.", "tags": [ "teams" ], "operationId": "teams/list-members-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-team-members" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "name": "role", "description": "Filters members returned by their role in the team.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "member", "maintainer", "all" ], "default": "all" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "members" } } }, "/orgs/{org}/teams/{team_slug}/memberships/{username}": { "get": { "summary": "Get team membership for a user", "description": "Team members will include the members of child teams.\n\nTo get a user's membership with a team, the team must be visible to the authenticated user.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.\n\n**Note:**\nThe response contains the `state` of the membership and the member's `role`.\n\nThe `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#create-a-team).", "tags": [ "teams" ], "operationId": "teams/get-membership-for-user-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#get-team-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-membership" }, "examples": { "response-if-user-is-a-team-maintainer": { "$ref": "#/components/examples/team-membership-response-if-user-is-a-team-maintainer" } } } } }, "404": { "description": "if user has no team membership" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "members" } }, "put": { "summary": "Add or update team membership for a user", "description": "Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nAdds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.\n\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\nAn organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the \"pending\" state until the person accepts the invitation, at which point the membership will transition to the \"active\" state and the user will be added as a member of the team.\n\nIf the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.", "tags": [ "teams" ], "operationId": "teams/add-or-update-membership-for-user-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#add-or-update-team-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "type": "string", "description": "The role that this user should have in the team.", "enum": [ "member", "maintainer" ], "default": "member" } } }, "examples": { "default": { "summary": "Add or update team membership for an organization member", "value": { "role": "maintainer" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-membership" }, "examples": { "response-if-users-membership-with-team-is-now-pending": { "$ref": "#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending" } } } } }, "403": { "description": "Forbidden if team synchronization is set up" }, "422": { "description": "Unprocessable Entity if you attempt to add an organization to a team" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "members" } }, "delete": { "summary": "Remove team membership for a user", "description": "Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nTo remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.\n\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/).\"\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.", "tags": [ "teams" ], "operationId": "teams/remove-membership-for-user-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#remove-team-membership-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "description": "Forbidden if team synchronization is set up" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": "members" } } }, "/orgs/{org}/teams/{team_slug}/projects": { "get": { "summary": "List team projects", "description": "Lists the organization projects for a team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`.", "tags": [ "teams" ], "operationId": "teams/list-projects-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-team-projects" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team-project" } }, "examples": { "default": { "$ref": "#/components/examples/team-project-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/orgs/{org}/teams/{team_slug}/projects/{project_id}": { "get": { "summary": "Check team permissions for a project", "description": "Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "tags": [ "teams" ], "operationId": "teams/check-permissions-for-project-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#check-team-permissions-for-a-project" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-project" }, "examples": { "default": { "$ref": "#/components/examples/team-project" } } } } }, "404": { "description": "Not Found if project is not managed by this team" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "put": { "summary": "Add or update team project permissions", "description": "Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "tags": [ "teams" ], "operationId": "teams/add-or-update-project-permissions-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#add-or-update-team-project-permissions" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "permission": { "type": "string", "description": "The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#http-verbs).\"", "enum": [ "read", "write", "admin" ] } }, "nullable": true }, "examples": { "default": { "summary": "Updates the permissions for the team to write for the project", "value": { "permission": "write" } } } } } }, "responses": { "204": { "description": "Response" }, "403": { "description": "Forbidden if the project is not owned by the organization", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" } } }, "examples": { "response-if-the-project-is-not-owned-by-the-organization": { "value": { "message": "Must have admin rights to Repository.", "documentation_url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#add-or-update-team-project-permissions" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "delete": { "summary": "Remove a project from a team", "description": "Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "tags": [ "teams" ], "operationId": "teams/remove-project-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#remove-a-project-from-a-team" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/repos": { "get": { "summary": "List team repositories", "description": "Lists a team's repositories visible to the authenticated user.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.", "tags": [ "teams" ], "operationId": "teams/list-repos-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-team-repositories" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/minimal-repository" } }, "examples": { "default": { "$ref": "#/components/examples/minimal-repository-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": { "get": { "summary": "Check team permissions for a repository", "description": "Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.\n\nYou can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header.\n\nIf a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.", "tags": [ "teams" ], "operationId": "teams/check-permissions-for-repo-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams/#check-team-permissions-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Alternative response with repository permissions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/team-repository" }, "examples": { "alternative-response-with-repository-permissions": { "$ref": "#/components/examples/team-repository-alternative-response-with-repository-permissions" } } } } }, "204": { "description": "Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header." }, "404": { "description": "Not Found if team does not have permission for the repository" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } }, "put": { "summary": "Add or update team repository permissions", "description": "To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#http-verbs).\"\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\n\nFor more information about the permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\".", "tags": [ "teams" ], "operationId": "teams/add-or-update-repo-permissions-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams/#add-or-update-team-repository-permissions" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "permission": { "type": "string", "description": "The permission to grant the team on this repository. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository.", "enum": [ "pull", "push", "admin", "maintain", "triage" ], "default": "push" } } }, "examples": { "default": { "summary": "Adding a team to an organization repository with the write role", "value": { "permission": "push" } } } } } }, "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } }, "delete": { "summary": "Remove a repository from a team", "description": "If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.", "tags": [ "teams" ], "operationId": "teams/remove-repo-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams/#remove-a-repository-from-a-team" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/teams": { "get": { "summary": "List child teams", "description": "Lists the child teams of the team specified by `{team_slug}`.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.", "tags": [ "teams" ], "operationId": "teams/list-child-in-org", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/teams#list-child-teams" }, "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "if child teams exist", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "response-if-child-teams-exist": { "$ref": "#/components/examples/team-items-response-if-child-teams-exist" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "teams", "subcategory": null } } }, "/projects/columns/cards/{card_id}": { "get": { "summary": "Get a project card", "description": "", "tags": [ "projects" ], "operationId": "projects/get-card", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#get-a-project-card" }, "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-card" }, "examples": { "default": { "$ref": "#/components/examples/project-card" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "patch": { "summary": "Update an existing project card", "description": "", "tags": [ "projects" ], "operationId": "projects/update-card", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#update-a-project-card" }, "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "note": { "description": "The project card's note", "example": "Update all gems", "type": "string", "nullable": true }, "archived": { "description": "Whether or not the card is archived", "example": false, "type": "boolean" } } }, "examples": { "default": { "summary": "Change the note on the card", "value": { "note": "Add payload for delete Project column" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-card" }, "examples": { "default": { "$ref": "#/components/examples/project-card" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "delete": { "summary": "Delete a project card", "description": "", "tags": [ "projects" ], "operationId": "projects/delete-card", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#delete-a-project-card" }, "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } } } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/columns/cards/{card_id}/moves": { "post": { "summary": "Move a project card", "description": "", "tags": [ "projects" ], "operationId": "projects/move-card", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#move-a-project-card" }, "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "position": { "description": "The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card.", "example": "bottom", "type": "string", "pattern": "^(?:top|bottom|after:\\d+)$" }, "column_id": { "description": "The unique identifier of the column the card should be moved to", "example": 42, "type": "integer" } }, "required": [ "position" ], "type": "object" }, "examples": { "default": { "summary": "Move the card to the bottom of the column", "value": { "column_id": 42, "position": "bottom" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false }, "examples": { "default": { "value": null } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "resource": { "type": "string" }, "field": { "type": "string" } } } } } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "503": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/columns/{column_id}": { "get": { "summary": "Get a project column", "description": "", "tags": [ "projects" ], "operationId": "projects/get-column", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#get-a-project-column" }, "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-column" }, "examples": { "default": { "$ref": "#/components/examples/project-column" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "patch": { "summary": "Update an existing project column", "description": "", "tags": [ "projects" ], "operationId": "projects/update-column", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#update-a-project-column" }, "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "description": "Name of the project column", "example": "Remaining tasks", "type": "string" } }, "required": [ "name" ], "type": "object" }, "examples": { "default": { "summary": "Rename the project column", "value": { "name": "To Do" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-column" }, "examples": { "default": { "$ref": "#/components/examples/project-column" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "delete": { "summary": "Delete a project column", "description": "", "tags": [ "projects" ], "operationId": "projects/delete-column", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#delete-a-project-column" }, "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/columns/{column_id}/cards": { "get": { "summary": "List project cards", "description": "", "tags": [ "projects" ], "operationId": "projects/list-cards", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#list-project-cards" }, "parameters": [ { "$ref": "#/components/parameters/column-id" }, { "name": "archived_state", "description": "Filters the project cards that are returned by the card's state.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "all", "archived", "not_archived" ], "default": "not_archived" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/project-card" } }, "examples": { "default": { "$ref": "#/components/examples/project-card-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "post": { "summary": "Create a project card", "description": "", "tags": [ "projects" ], "operationId": "projects/create-card", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#create-a-project-card" }, "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "note": { "description": "The project card's note", "example": "Update all gems", "type": "string", "nullable": true } }, "required": [ "note" ] }, { "type": "object", "properties": { "content_id": { "description": "The unique identifier of the content associated with the card", "example": 42, "type": "integer" }, "content_type": { "description": "The piece of content associated with the card", "example": "PullRequest", "type": "string" } }, "required": [ "content_id", "content_type" ] } ] }, "examples": { "default": { "summary": "Create a new card", "value": { "note": "Add payload for delete Project column" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-card" }, "examples": { "default": { "$ref": "#/components/examples/project-card" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "422": { "description": "Validation failed", "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/validation-error" }, { "$ref": "#/components/schemas/validation-error-simple" } ] } } } }, "503": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "cards", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/columns/{column_id}/moves": { "post": { "summary": "Move a project column", "description": "", "tags": [ "projects" ], "operationId": "projects/move-column", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#move-a-project-column" }, "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "position": { "description": "The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column.", "example": "last", "type": "string", "pattern": "^(?:first|last|after:\\d+)$" } }, "required": [ "position" ], "type": "object" }, "examples": { "default": { "summary": "Move the column to the end of the board", "value": { "position": "last" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false }, "examples": { "default": { "value": null } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed_simple" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/{project_id}": { "get": { "summary": "Get a project", "description": "Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.", "tags": [ "projects" ], "operationId": "projects/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#get-a-project" }, "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project" }, "examples": { "default": { "$ref": "#/components/examples/project-3" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "patch": { "summary": "Update a project", "description": "Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned.", "operationId": "projects/update", "tags": [ "projects" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#update-a-project" }, "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "properties": { "name": { "description": "Name of the project", "example": "Week One Sprint", "type": "string" }, "body": { "description": "Body of the project", "example": "This project represents the sprint of the first week in January", "type": "string", "nullable": true }, "state": { "description": "State of the project; either 'open' or 'closed'", "example": "open", "type": "string" }, "organization_permission": { "description": "The baseline permission that all organization members have on this project", "type": "string", "enum": [ "read", "write", "admin", "none" ] }, "private": { "description": "Whether or not this project can be seen by everyone.", "type": "boolean" } }, "type": "object" }, "examples": { "default": { "summary": "Change the name, state, and permissions for a project", "value": { "name": "Week One Sprint", "state": "open", "organization_permission": "write" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project" }, "examples": { "default": { "$ref": "#/components/examples/project-3" } } } } }, "404": { "description": "Not Found if the authenticated user does not have access to the project" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } } } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "410": { "$ref": "#/components/responses/gone" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "delete": { "summary": "Delete a project", "description": "Deletes a project board. Returns a `404 Not Found` status if projects are disabled.", "operationId": "projects/delete", "tags": [ "projects" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#delete-a-project" }, "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "responses": { "204": { "description": "Delete Success" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "type": "array", "items": { "type": "string" } } } } } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "410": { "$ref": "#/components/responses/gone" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/{project_id}/collaborators": { "get": { "summary": "List project collaborators", "description": "Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators.", "tags": [ "projects" ], "operationId": "projects/list-collaborators", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#list-project-collaborators" }, "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "name": "affiliation", "description": "Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "outside", "direct", "all" ], "default": "all" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "collaborators", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/{project_id}/collaborators/{username}": { "put": { "summary": "Add project collaborator", "description": "Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator.", "tags": [ "projects" ], "operationId": "projects/add-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#add-project-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "permission": { "description": "The permission to grant the collaborator.", "enum": [ "read", "write", "admin" ], "default": "write", "example": "write", "type": "string" } }, "nullable": true }, "examples": { "default": { "summary": "Applying write permissions for the new collaborator", "value": { "permission": "write" } } } } } }, "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "collaborators", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "delete": { "summary": "Remove user as a collaborator", "description": "Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator.", "tags": [ "projects" ], "operationId": "projects/remove-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#remove-project-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "collaborators", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/{project_id}/collaborators/{username}/permission": { "get": { "summary": "Get project permission for a user", "description": "Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level.", "tags": [ "projects" ], "operationId": "projects/get-permission-for-user", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#get-project-permission-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-collaborator-permission" }, "examples": { "default": { "$ref": "#/components/examples/project-collaborator-permission" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "collaborators", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/projects/{project_id}/columns": { "get": { "summary": "List project columns", "description": "", "tags": [ "projects" ], "operationId": "projects/list-columns", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#list-project-columns" }, "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/project-column" } }, "examples": { "default": { "$ref": "#/components/examples/project-column-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } }, "post": { "summary": "Create a project column", "description": "", "tags": [ "projects" ], "operationId": "projects/create-column", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/projects#create-a-project-column" }, "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "description": "Name of the project column", "example": "Remaining tasks", "type": "string" } }, "required": [ "name" ], "type": "object" }, "examples": { "default": { "value": { "name": "Remaining tasks" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/project-column" }, "examples": { "default": { "value": { "url": "https://api.github.com/projects/columns/367", "project_url": "https://api.github.com/projects/120", "cards_url": "https://api.github.com/projects/columns/367/cards", "id": 367, "node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=", "name": "To Do", "created_at": "2016-09-05T14:18:44Z", "updated_at": "2016-09-05T14:22:28Z" } } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed_simple" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "projects", "subcategory": "columns", "previews": [ { "required": true, "name": "inertia", "note": "The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-10-27-changes-to-projects-api) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.inertia-preview+json\n```" } ] } } }, "/rate_limit": { "get": { "summary": "Get rate limit status for the authenticated user", "description": "**Note:** Accessing this endpoint does not count against your REST API rate limit.\n\n**Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.", "tags": [ "rate-limit" ], "operationId": "rate-limit/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/rate-limit-overview" }, "examples": { "default": { "$ref": "#/components/examples/rate-limit-overview" } } } }, "headers": { "X-RateLimit-Limit": { "$ref": "#/components/headers/x-rate-limit-limit" }, "X-RateLimit-Remaining": { "$ref": "#/components/headers/x-rate-limit-remaining" }, "X-RateLimit-Reset": { "$ref": "#/components/headers/x-rate-limit-reset" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "rate-limit", "subcategory": null } } }, "/reactions/{reaction_id}": { "delete": { "summary": "Delete a reaction (Legacy)", "description": "**Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/).\n\nOAuth access tokens require the `write:discussion` [scope](https://docs.github.com/enterprise-server@3.1/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/enterprise-server@3.1/rest/reference/teams#discussion-comments).", "tags": [ "reactions" ], "operationId": "reactions/delete-legacy", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions/#delete-a-reaction-legacy" }, "parameters": [ { "$ref": "#/components/parameters/reaction-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "410": { "$ref": "#/components/responses/gone" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "removalDate": "2021-02-21", "deprecationDate": "2020-02-26", "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] }, "deprecated": true } }, "/repos/{owner}/{repo}": { "get": { "summary": "Get a repository", "description": "When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file.\n\nThe `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.", "tags": [ "repos" ], "operationId": "repos/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/full-repository" }, "examples": { "default-response": { "$ref": "#/components/examples/full-repository-default-response" }, "response-with-scarlet-witch-preview-media-type": { "$ref": "#/components/examples/full-repository-response-with-scarlet-witch-preview-media-type" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "301": { "$ref": "#/components/responses/moved_permanently" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "previews": [ { "required": false, "name": "nebula", "note": "You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.1/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.nebula-preview+json\n```" }, { "required": false, "name": "scarlet-witch", "note": "The Codes of Conduct API is currently available for developers to preview.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.scarlet-witch-preview+json\n```" } ] } }, "patch": { "summary": "Update a repository", "description": "**Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#replace-all-repository-topics) endpoint.", "tags": [ "repos" ], "operationId": "repos/update", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos/#update-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the repository." }, "description": { "type": "string", "description": "A short description of the repository." }, "homepage": { "type": "string", "description": "A URL with more information about the repository." }, "private": { "type": "boolean", "description": "Either `true` to make the repository private or `false` to make it public. Default: `false`. \n**Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private.", "default": false }, "visibility": { "type": "string", "description": "Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. The `visibility` parameter overrides the `private` parameter when you use both along with the `nebula-preview` preview header.", "enum": [ "public", "private", "internal" ] }, "has_issues": { "type": "boolean", "description": "Either `true` to enable issues for this repository or `false` to disable them.", "default": true }, "has_projects": { "type": "boolean", "description": "Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error.", "default": true }, "has_wiki": { "type": "boolean", "description": "Either `true` to enable the wiki for this repository or `false` to disable it.", "default": true }, "is_template": { "type": "boolean", "description": "Either `true` to make this repo available as a template repository or `false` to prevent it.", "default": false }, "default_branch": { "type": "string", "description": "Updates the default branch for this repository." }, "allow_squash_merge": { "type": "boolean", "description": "Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.", "default": true }, "allow_merge_commit": { "type": "boolean", "description": "Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.", "default": true }, "allow_rebase_merge": { "type": "boolean", "description": "Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.", "default": true }, "delete_branch_on_merge": { "type": "boolean", "description": "Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.", "default": false }, "allow_update_branch": { "type": "boolean", "description": "Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise.", "default": false }, "use_squash_pr_title_as_default": { "type": "boolean", "description": "Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message.", "default": false }, "archived": { "type": "boolean", "description": "`true` to archive this repository. **Note**: You cannot unarchive repositories through the API.", "default": false }, "allow_forking": { "type": "boolean", "description": "Either `true` to allow private forks, or `false` to prevent private forks.", "default": false } } }, "examples": { "default": { "value": { "name": "Hello-World", "description": "This is your first repository", "homepage": "https://github.com", "private": true, "has_issues": true, "has_projects": true, "has_wiki": true } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/full-repository" }, "examples": { "default": { "$ref": "#/components/examples/full-repository" } } } } }, "307": { "$ref": "#/components/responses/temporary_redirect" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "previews": [ { "required": false, "name": "nebula", "note": "You can set the visibility of a repository using the new `visibility` parameter in the [Repositories API](https://docs.github.com/enterprise-server@3.1/rest/reference/repos/), and get a repository's visibility with a new response key. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes/).\n\nTo access repository visibility during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.nebula-preview+json\n```" }, { "required": false, "name": "baptiste", "note": "The `is_template` and `template_repository` keys are currently available for developer to preview. See [Create a repository using a template](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-a-repository-using-a-template) to learn how to create template repositories. To access these new response keys during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n\n```shell\napplication/vnd.github.baptiste-preview+json\n```" } ] } }, "delete": { "summary": "Delete a repository", "description": "Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.\n\nIf an organization owner has configured the organization to prevent members from deleting organization-owned\nrepositories, you will get a `403 Forbidden` response.", "tags": [ "repos" ], "operationId": "repos/delete", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" }, "403": { "description": "If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "documentation_url": { "type": "string" } } }, "examples": { "default": { "value": { "message": "Organization members cannot delete repositories.", "documentation_url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-a-repository" } } } } } }, "307": { "$ref": "#/components/responses/temporary_redirect" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": null } } }, "/repos/{owner}/{repo}/actions/artifacts": { "get": { "summary": "List artifacts for a repository", "description": "Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-artifacts-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-artifacts-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "artifacts" ], "properties": { "total_count": { "type": "integer" }, "artifacts": { "type": "array", "items": { "$ref": "#/components/schemas/artifact" } } } }, "examples": { "default": { "$ref": "#/components/examples/artifact-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}": { "get": { "summary": "Get an artifact", "description": "Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-artifact", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-an-artifact" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/artifact" }, "examples": { "default": { "$ref": "#/components/examples/artifact" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "artifacts" } }, "delete": { "summary": "Delete an artifact", "description": "Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-artifact", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-an-artifact" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}": { "get": { "summary": "Download an artifact", "description": "Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in\nthe response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to\nthe repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\nGitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/download-artifact", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#download-an-artifact" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" }, { "name": "archive_format", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "302": { "description": "Response", "headers": { "Location": { "$ref": "#/components/headers/location" } } }, "410": { "$ref": "#/components/responses/gone" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/jobs/{job_id}": { "get": { "summary": "Get a job for a workflow run", "description": "Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-job-for-workflow-run", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-job-for-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/job-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/job" }, "examples": { "default": { "$ref": "#/components/examples/job" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": { "get": { "summary": "Download job logs for a workflow run", "description": "Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\nfor `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can\nuse this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must\nhave the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/download-job-logs-for-workflow-run", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#download-job-logs-for-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/job-id" } ], "responses": { "302": { "description": "Response", "headers": { "Location": { "example": "https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/jobs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D", "schema": { "type": "string" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/permissions": { "get": { "summary": "Get GitHub Actions permissions for a repository", "description": "Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "operationId": "actions/get-github-actions-permissions-repository", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-github-actions-permissions-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-repository-permissions" }, "examples": { "default": { "$ref": "#/components/examples/actions-repository-permissions" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set GitHub Actions permissions for a repository", "description": "Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.\n\nIf the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "operationId": "actions/set-github-actions-permissions-repository", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-github-actions-permissions-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled": { "$ref": "#/components/schemas/actions-enabled" }, "allowed_actions": { "$ref": "#/components/schemas/allowed-actions" } }, "required": [ "enabled" ] }, "examples": { "default": { "value": { "enabled": true, "allowed_actions": "selected" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/permissions/selected-actions": { "get": { "summary": "Get allowed actions for a repository", "description": "Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "operationId": "actions/get-allowed-actions-repository", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-allowed-actions-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "default": { "$ref": "#/components/examples/selected-actions" } } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } }, "put": { "summary": "Set allowed actions for a repository", "description": "Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\"\n\nIf the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.\n\nTo use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "operationId": "actions/set-allowed-actions-repository", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#set-allowed-actions-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/selected-actions" }, "examples": { "selected_actions": { "$ref": "#/components/examples/selected-actions" } } } } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "actions", "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/runners": { "get": { "summary": "List self-hosted runners for a repository", "description": "Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-self-hosted-runners-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-self-hosted-runners-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "runners" ], "properties": { "total_count": { "type": "integer" }, "runners": { "type": "array", "items": { "$ref": "#/components/schemas/runner" } } } }, "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/downloads": { "get": { "summary": "List runner applications for a repository", "description": "Lists binaries for the runner application that you can download and run.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-runner-applications-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-runner-applications-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/runner-application" } }, "examples": { "default": { "$ref": "#/components/examples/runner-application-items" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/registration-token": { "post": { "summary": "Create a registration token for a repository", "description": "Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate\nusing an access token with the `repo` scope to use this endpoint.\n\n#### Example using registration token\n \nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN\n```", "tags": [ "actions" ], "operationId": "actions/create-registration-token-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-registration-token-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/remove-token": { "post": { "summary": "Create a remove token for a repository", "description": "Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\n\n#### Example using remove token\n \nTo remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.\n\n```\n./config.sh remove --token TOKEN\n```", "tags": [ "actions" ], "operationId": "actions/create-remove-token-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-remove-token-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authentication-token" }, "examples": { "default": { "$ref": "#/components/examples/authentication-token-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/{runner_id}": { "get": { "summary": "Get a self-hosted runner for a repository", "description": "Gets a specific self-hosted runner configured in a repository.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "tags": [ "actions" ], "operationId": "actions/get-self-hosted-runner-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-self-hosted-runner-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/runner" }, "examples": { "default": { "$ref": "#/components/examples/runner" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } }, "delete": { "summary": "Delete a self-hosted runner from a repository", "description": "Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\nYou must authenticate using an access token with the `repo`\nscope to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-self-hosted-runner-from-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runs": { "get": { "summary": "List workflow runs for a repository", "description": "Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#parameters).\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-workflow-runs-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-workflow-runs-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/actor" }, { "$ref": "#/components/parameters/workflow-run-branch" }, { "$ref": "#/components/parameters/event" }, { "$ref": "#/components/parameters/workflow-run-status" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/created" }, { "$ref": "#/components/parameters/exclude-pull-requests" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "workflow_runs" ], "properties": { "total_count": { "type": "integer" }, "workflow_runs": { "type": "array", "items": { "$ref": "#/components/schemas/workflow-run" } } } }, "examples": { "default": { "$ref": "#/components/examples/workflow-run-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}": { "get": { "summary": "Get a workflow run", "description": "Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-workflow-run", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "$ref": "#/components/parameters/exclude-pull-requests" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/workflow-run" }, "examples": { "default": { "$ref": "#/components/examples/workflow-run" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } }, "delete": { "summary": "Delete a workflow run", "description": "Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is\nprivate you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use\nthis endpoint.", "operationId": "actions/delete-workflow-run", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts": { "get": { "summary": "List workflow run artifacts", "description": "Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-workflow-run-artifacts", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-workflow-run-artifacts" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "artifacts" ], "properties": { "total_count": { "type": "integer" }, "artifacts": { "type": "array", "items": { "$ref": "#/components/schemas/artifact" } } } }, "examples": { "default": { "$ref": "#/components/examples/artifact-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/cancel": { "post": { "summary": "Cancel a workflow run", "description": "Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/cancel-workflow-run", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#cancel-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false } } } }, "409": { "$ref": "#/components/responses/conflict" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/jobs": { "get": { "summary": "List jobs for a workflow run", "description": "Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#parameters).", "tags": [ "actions" ], "operationId": "actions/list-jobs-for-workflow-run", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-jobs-for-a-workflow-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "name": "filter", "description": "Filters jobs by their `completed_at` timestamp. `latest` returns jobs from the most recent execution of the workflow run. `all` returns all jobs for a workflow run, including from old executions of the workflow run.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "latest", "all" ], "default": "latest" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "jobs" ], "properties": { "total_count": { "type": "integer" }, "jobs": { "type": "array", "items": { "$ref": "#/components/schemas/job" } } } }, "examples": { "default": { "$ref": "#/components/examples/job-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/logs": { "get": { "summary": "Download workflow run logs", "description": "Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\n`Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use\nthis endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have\nthe `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/download-workflow-run-logs", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#download-workflow-run-logs" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "302": { "description": "Response", "headers": { "Location": { "example": "https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/runs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D", "schema": { "type": "string" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } }, "delete": { "summary": "Delete workflow run logs", "description": "Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-workflow-run-logs", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-workflow-run-logs" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "500": { "$ref": "#/components/responses/internal_error" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/rerun": { "post": { "summary": "Re-run a workflow", "description": "Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/re-run-workflow", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#re-run-a-workflow" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "nullable": true } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/secrets": { "get": { "summary": "List repository secrets", "description": "Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-repo-secrets", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-repository-secrets" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "secrets" ], "properties": { "total_count": { "type": "integer" }, "secrets": { "type": "array", "items": { "$ref": "#/components/schemas/actions-secret" } } } }, "examples": { "default": { "$ref": "#/components/examples/actions-secret-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/secrets/public-key": { "get": { "summary": "Get a repository public key", "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-repo-public-key", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-repository-public-key" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-public-key" }, "examples": { "default": { "$ref": "#/components/examples/actions-public-key" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/secrets/{secret_name}": { "get": { "summary": "Get a repository secret", "description": "Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-repo-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-repository-secret" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/actions-secret" }, "examples": { "default": { "$ref": "#/components/examples/actions-secret" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "put": { "summary": "Create or update a repository secret", "description": "Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use\nthis endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n```\nconst sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n```\n\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "tags": [ "actions" ], "operationId": "actions/create-or-update-repo-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-or-update-a-repository-secret" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "encrypted_value": { "type": "string", "description": "Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-repository-public-key) endpoint.", "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$" }, "key_id": { "type": "string", "description": "ID of the key you used to encrypt the secret." } } }, "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678" } } } } } }, "responses": { "201": { "description": "Response when creating a secret", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false } } } }, "204": { "description": "Response when updating a secret" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } }, "delete": { "summary": "Delete a repository secret", "description": "Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/delete-repo-secret", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#delete-a-repository-secret" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/workflows": { "get": { "summary": "List repository workflows", "description": "Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/list-repo-workflows", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-repository-workflows" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "workflows" ], "properties": { "total_count": { "type": "integer" }, "workflows": { "type": "array", "items": { "$ref": "#/components/schemas/workflow" } } } }, "examples": { "default": { "$ref": "#/components/examples/workflow-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}": { "get": { "summary": "Get a workflow", "description": "Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/get-workflow", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#get-a-workflow" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/workflow" }, "examples": { "default": { "$ref": "#/components/examples/workflow" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": { "put": { "summary": "Disable a workflow", "description": "Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/disable-workflow", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#disable-a-workflow" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { "post": { "summary": "Create a workflow dispatch event", "description": "You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see \"[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see \"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line).\"", "operationId": "actions/create-workflow-dispatch", "tags": [ "actions" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#create-a-workflow-dispatch-event" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "204": { "description": "Response" } }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "ref": { "type": "string", "description": "The git reference for the workflow. The reference can be a branch or tag name." }, "inputs": { "type": "object", "description": "Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted.", "additionalProperties": { "type": "string" }, "maxProperties": 10 } }, "required": [ "ref" ] }, "examples": { "default": { "value": { "ref": "topic-branch", "inputs": { "name": "Mona the Octocat", "home": "San Francisco, CA" } } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": { "put": { "summary": "Enable a workflow", "description": "Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "tags": [ "actions" ], "operationId": "actions/enable-workflow", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#enable-a-workflow" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs": { "get": { "summary": "List workflow runs", "description": "List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#parameters).\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.", "tags": [ "actions" ], "operationId": "actions/list-workflow-runs", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/actions#list-workflow-runs" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" }, { "$ref": "#/components/parameters/actor" }, { "$ref": "#/components/parameters/workflow-run-branch" }, { "$ref": "#/components/parameters/event" }, { "$ref": "#/components/parameters/workflow-run-status" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/created" }, { "$ref": "#/components/parameters/exclude-pull-requests" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "workflow_runs" ], "properties": { "total_count": { "type": "integer" }, "workflow_runs": { "type": "array", "items": { "$ref": "#/components/schemas/workflow-run" } } } }, "examples": { "default": { "$ref": "#/components/examples/workflow-run-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "actions", "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/assignees": { "get": { "summary": "List assignees", "description": "Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.", "tags": [ "issues" ], "operationId": "issues/list-assignees", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/issues#list-assignees" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "issues", "subcategory": "assignees" } } }, "/repos/{owner}/{repo}/assignees/{assignee}": { "get": { "summary": "Check if a user can be assigned", "description": "Checks if a user has permission to be assigned to an issue in this repository.\n\nIf the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.\n\nOtherwise a `404` status code is returned.", "tags": [ "issues" ], "operationId": "issues/check-user-can-be-assigned", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/issues#check-if-a-user-can-be-assigned" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "assignee", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned." }, "404": { "description": "Otherwise a `404` status code is returned.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "issues", "subcategory": "assignees" } } }, "/repos/{owner}/{repo}/branches": { "get": { "summary": "List branches", "description": "", "tags": [ "repos" ], "operationId": "repos/list-branches", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-branches" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "protected", "description": "Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches.", "in": "query", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/short-branch" } }, "examples": { "default": { "$ref": "#/components/examples/short-branch-with-protection-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}": { "get": { "summary": "Get a branch", "description": "", "tags": [ "repos" ], "operationId": "repos/get-branch", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-a-branch" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/branch-with-protection" } } } }, "301": { "$ref": "#/components/responses/moved_permanently" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection": { "get": { "summary": "Get branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/get-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/branch-protection" }, "examples": { "default": { "$ref": "#/components/examples/branch-protection" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": false, "name": "luke-cage", "note": "The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.luke-cage-preview+json\n```" } ] } }, "put": { "summary": "Update branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nProtecting a branch requires admin or owner permissions to the repository.\n\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.\n\n**Note**: The list of users, apps, and teams in total is limited to 100 items.", "tags": [ "repos" ], "operationId": "repos/update-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#update-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "required_status_checks": { "type": "object", "description": "Require status checks to pass before merging. Set to `null` to disable.", "nullable": true, "properties": { "strict": { "type": "boolean", "description": "Require branches to be up to date before merging." }, "contexts": { "type": "array", "deprecated": true, "description": "**Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control.\n", "items": { "type": "string" } }, "checks": { "type": "array", "description": "The list of status checks to require in order to merge into this branch.", "items": { "type": "object", "required": [ "context" ], "properties": { "context": { "type": "string", "description": "The name of the required check" }, "app_id": { "type": "integer", "description": "The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status." } } } } }, "required": [ "strict", "contexts" ] }, "enforce_admins": { "type": "boolean", "description": "Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable.", "nullable": true }, "required_pull_request_reviews": { "type": "object", "description": "Require at least one approving review on a pull request, before merging. Set to `null` to disable.", "nullable": true, "properties": { "dismissal_restrictions": { "type": "object", "description": "Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.", "properties": { "users": { "type": "array", "description": "The list of user `login`s with dismissal access", "items": { "type": "string" } }, "teams": { "type": "array", "description": "The list of team `slug`s with dismissal access", "items": { "type": "string" } }, "apps": { "type": "array", "description": "The list of app `slug`s with dismissal access", "items": { "type": "string" } } } }, "dismiss_stale_reviews": { "type": "boolean", "description": "Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit." }, "require_code_owner_reviews": { "type": "boolean", "description": "Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them." }, "required_approving_review_count": { "type": "integer", "description": "Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6." } } }, "restrictions": { "type": "object", "description": "Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable.", "nullable": true, "properties": { "users": { "type": "array", "description": "The list of user `login`s with push access", "items": { "type": "string" } }, "teams": { "type": "array", "description": "The list of team `slug`s with push access", "items": { "type": "string" } }, "apps": { "type": "array", "description": "The list of app `slug`s with push access", "items": { "type": "string" } } }, "required": [ "users", "teams" ] }, "required_linear_history": { "type": "boolean", "description": "Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see \"[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)\" in the GitHub Help documentation." }, "allow_force_pushes": { "type": "boolean", "description": "Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see \"[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\" in the GitHub Help documentation.\"", "nullable": true }, "allow_deletions": { "type": "boolean", "description": "Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see \"[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)\" in the GitHub Help documentation." }, "block_creations": { "type": "boolean", "description": "If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`." }, "required_conversation_resolution": { "type": "boolean", "description": "Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`." }, "contexts": { "type": "array", "description": "The list of status checks to require in order to merge into this branch.", "items": { "type": "string" } } }, "required": [ "required_status_checks", "enforce_admins", "required_pull_request_reviews", "restrictions" ] }, "examples": { "default": { "value": { "required_status_checks": { "strict": true, "contexts": [ "continuous-integration/travis-ci" ] }, "enforce_admins": true, "required_pull_request_reviews": { "dismissal_restrictions": { "users": [ "octocat" ], "teams": [ "justice-league" ] }, "dismiss_stale_reviews": true, "require_code_owner_reviews": true, "required_approving_review_count": 2, "bypass_pull_request_allowances": { "users": [ "octocat" ], "teams": [ "justice-league" ] } }, "restrictions": { "users": [ "octocat" ], "teams": [ "justice-league" ], "apps": [ "super-ci" ] }, "required_linear_history": true, "allow_force_pushes": true, "allow_deletions": true, "block_creations": true, "required_conversation_resolution": true } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch" } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed_simple" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": false, "name": "luke-cage", "note": "The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.luke-cage-preview+json\n```" } ] } }, "delete": { "summary": "Delete branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/delete-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": { "get": { "summary": "Get admin branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/get-admin-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-admin-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "post": { "summary": "Set admin branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nAdding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.", "tags": [ "repos" ], "operationId": "repos/set-admin-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#set-admin-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced-2" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Delete admin branch protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoving admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.", "tags": [ "repos" ], "operationId": "repos/delete-admin-branch-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-admin-branch-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": { "get": { "summary": "Get pull request review protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/get-pull-request-review-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-pull-request-review-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-pull-request-review" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-pull-request-review" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": false, "name": "luke-cage", "note": "The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.luke-cage-preview+json\n```" } ] } }, "patch": { "summary": "Update pull request review protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nUpdating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\n\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.", "tags": [ "repos" ], "operationId": "repos/update-pull-request-review-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#update-pull-request-review-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "dismissal_restrictions": { "type": "object", "description": "Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories.", "properties": { "users": { "type": "array", "description": "The list of user `login`s with dismissal access", "items": { "type": "string" } }, "teams": { "type": "array", "description": "The list of team `slug`s with dismissal access", "items": { "type": "string" } }, "apps": { "type": "array", "description": "The list of app `slug`s with dismissal access", "items": { "type": "string" } } } }, "dismiss_stale_reviews": { "type": "boolean", "description": "Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit." }, "require_code_owner_reviews": { "type": "boolean", "description": "Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed." }, "required_approving_review_count": { "type": "integer", "description": "Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6." } } }, "examples": { "default": { "value": { "dismissal_restrictions": { "users": [ "octocat" ], "teams": [ "justice-league" ], "apps": [ "octoapp" ] }, "bypass_pull_request_allowances": { "users": [ "octocat" ], "teams": [ "justice-league" ], "apps": [ "octoapp" ] }, "dismiss_stale_reviews": true, "require_code_owner_reviews": true, "required_approving_review_count": 2 } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-pull-request-review" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-pull-request-review" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": false, "name": "luke-cage", "note": "The Protected Branches API now has a setting for requiring a specified number of approving pull request reviews before merging. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.luke-cage-preview+json\n```" } ] } }, "delete": { "summary": "Delete pull request review protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/delete-pull-request-review-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-pull-request-review-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": { "get": { "summary": "Get commit signature protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.\n\n**Note**: You must enable branch protection to require signed commits.", "tags": [ "repos" ], "operationId": "repos/get-commit-signature-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-commit-signature-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": true, "name": "zzzax", "note": "Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.zzzax-preview+json\n```" } ] } }, "post": { "summary": "Create commit signature protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.", "tags": [ "repos" ], "operationId": "repos/create-commit-signature-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-commit-signature-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" }, "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": true, "name": "zzzax", "note": "Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.zzzax-preview+json\n```" } ] } }, "delete": { "summary": "Delete commit signature protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.", "tags": [ "repos" ], "operationId": "repos/delete-commit-signature-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-commit-signature-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches", "previews": [ { "required": true, "name": "zzzax", "note": "Protected Branches API can now manage a setting for requiring signed commits. This feature is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures) for full details. To access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.zzzax-preview+json\n```" } ] } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": { "get": { "summary": "Get status checks protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/get-status-checks-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-status-checks-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/status-check-policy" }, "examples": { "default": { "$ref": "#/components/examples/status-check-policy" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "patch": { "summary": "Update status check protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nUpdating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.", "tags": [ "repos" ], "operationId": "repos/update-status-check-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#update-status-check-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "strict": { "type": "boolean", "description": "Require branches to be up to date before merging." }, "contexts": { "type": "array", "deprecated": true, "description": "The list of status checks to require in order to merge into this branch", "items": { "type": "string" } } } }, "examples": { "default": { "value": { "strict": true, "contexts": [ "continuous-integration/travis-ci" ] } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/status-check-policy" }, "examples": { "default": { "$ref": "#/components/examples/status-check-policy" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Remove status check protection", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/remove-status-check-protection", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-status-check-protection" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": { "get": { "summary": "Get all status check contexts", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/get-all-status-check-contexts", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-all-status-check-contexts" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } }, "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "post": { "summary": "Add status check contexts", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/add-status-check-contexts", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#add-status-check-contexts" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "contexts": { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } }, "required": [ "contexts" ], "example": { "contexts": [ "contexts" ] } }, { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } }, "examples": { "default": { "value": [ "continuous-integration/travis-ci", "continuous-integration/jenkins" ] } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "contexts", "category": "repos", "subcategory": "branches" } }, "put": { "summary": "Set status check contexts", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/set-status-check-contexts", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#set-status-check-contexts" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "contexts": { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } }, "required": [ "contexts" ], "example": { "contexts": [ "contexts" ] } }, { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } }, "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "contexts", "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Remove status check contexts", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.", "tags": [ "repos" ], "operationId": "repos/remove-status-check-contexts", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-status-check-contexts" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "contexts": { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } }, "required": [ "contexts" ], "example": { "contexts": [ "contexts" ] } }, { "type": "array", "description": "contexts parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" } }, "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "contexts", "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions": { "get": { "summary": "Get access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists who has access to this protected branch.\n\n**Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories.", "tags": [ "repos" ], "operationId": "repos/get-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/branch-restriction-policy" }, "examples": { "default": { "$ref": "#/components/examples/branch-restriction-policy" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Delete access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nDisables the ability to restrict who can push to this branch.", "tags": [ "repos" ], "operationId": "repos/delete-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": { "get": { "summary": "Get apps with access to the protected branch", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.", "tags": [ "repos" ], "operationId": "repos/get-apps-with-access-to-protected-branch", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-apps-with-access-to-the-protected-branch" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } }, "examples": { "default": { "$ref": "#/components/examples/integration-items" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "post": { "summary": "Add app access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n| Type | Description |\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/add-app-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#add-app-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "apps": { "type": "array", "description": "apps parameter", "items": { "type": "string" } } }, "required": [ "apps" ], "example": { "apps": [ "my-app" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } }, "examples": { "default": { "$ref": "#/components/examples/integration-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "apps", "category": "repos", "subcategory": "branches" } }, "put": { "summary": "Set app access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n| Type | Description |\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/set-app-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#set-app-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "apps": { "type": "array", "description": "apps parameter", "items": { "type": "string" } } }, "required": [ "apps" ], "example": { "apps": [ "my-app" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } }, "examples": { "default": { "$ref": "#/components/examples/integration-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "apps", "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Remove app access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.\n\n| Type | Description |\n| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/remove-app-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-app-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "apps": { "type": "array", "description": "apps parameter", "items": { "type": "string" } } }, "required": [ "apps" ], "example": { "apps": [ "my-app" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/integration" } }, "examples": { "default": { "$ref": "#/components/examples/integration-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "apps", "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": { "get": { "summary": "Get teams with access to the protected branch", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the teams who have push access to this branch. The list includes child teams.", "tags": [ "repos" ], "operationId": "repos/get-teams-with-access-to-protected-branch", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-teams-with-access-to-the-protected-branch" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "default": { "$ref": "#/components/examples/team-items" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "post": { "summary": "Add team access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified teams push access for this branch. You can also give push access to child teams.\n\n| Type | Description |\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/add-team-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#add-team-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "teams": { "type": "array", "description": "teams parameter", "items": { "type": "string" } } }, "required": [ "teams" ], "example": { "teams": [ "my-team" ] } }, { "type": "array", "description": "teams parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "default": { "$ref": "#/components/examples/team-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "teams", "category": "repos", "subcategory": "branches" } }, "put": { "summary": "Set team access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.\n\n| Type | Description |\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/set-team-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#set-team-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "teams": { "type": "array", "description": "teams parameter", "items": { "type": "string" } } }, "required": [ "teams" ], "example": { "teams": [ "my-team" ] } }, { "type": "array", "description": "teams parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "default": { "$ref": "#/components/examples/team-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "teams", "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Remove team access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of a team to push to this branch. You can also remove push access for child teams.\n\n| Type | Description |\n| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/remove-team-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-team-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "teams": { "type": "array", "description": "teams parameter", "items": { "type": "string" } } }, "required": [ "teams" ], "example": { "teams": [ "my-team" ] } }, { "type": "array", "description": "teams parameter", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/team" } }, "examples": { "default": { "$ref": "#/components/examples/team-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "teams", "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": { "get": { "summary": "Get users with access to the protected branch", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the people who have push access to this branch.", "tags": [ "repos" ], "operationId": "repos/get-users-with-access-to-protected-branch", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-users-with-access-to-the-protected-branch" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } }, "post": { "summary": "Add user access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified people push access for this branch.\n\n| Type | Description |\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/add-user-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#add-user-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "users": { "type": "array", "description": "users parameter", "items": { "type": "string" } } }, "required": [ "users" ], "example": { "users": [ "mona" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "users", "category": "repos", "subcategory": "branches" } }, "put": { "summary": "Set user access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.\n\n| Type | Description |\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/set-user-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#set-user-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "users": { "type": "array", "description": "users parameter", "items": { "type": "string" } } }, "required": [ "users" ], "example": { "users": [ "mona" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "users", "category": "repos", "subcategory": "branches" } }, "delete": { "summary": "Remove user access restrictions", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of a user to push to this branch.\n\n| Type | Description |\n| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "tags": [ "repos" ], "operationId": "repos/remove-user-access-restrictions", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-user-access-restrictions" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "users": { "type": "array", "description": "users parameter", "items": { "type": "string" } } }, "required": [ "users" ], "example": { "users": [ "mona" ] } }, { "type": "array", "items": { "type": "string" } } ] } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/simple-user" } }, "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "requestBodyParameterName": "users", "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/branches/{branch}/rename": { "post": { "summary": "Rename a branch", "description": "Renames a branch in a repository.\n\n**Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see \"[Renaming a branch](https://docs.github.com/enterprise-server@3.1/github/administering-a-repository/renaming-a-branch)\".\n\nThe permissions required to use this endpoint depends on whether you are renaming the default branch.\n\nTo rename a non-default branch:\n\n* Users must have push access.\n* GitHub Apps must have the `contents:write` repository permission.\n\nTo rename the default branch:\n\n* Users must have admin or owner permissions.\n* GitHub Apps must have the `administration:write` repository permission.", "tags": [ "repos" ], "operationId": "repos/rename-branch", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#rename-a-branch" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "new_name": { "type": "string", "description": "The new name of the branch." } }, "required": [ "new_name" ] }, "examples": { "default": { "value": { "new_name": "my_renamed_branch" } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/branch-with-protection" }, "examples": { "default": { "$ref": "#/components/examples/branch-with-protection" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "branches" } } }, "/repos/{owner}/{repo}/check-runs": { "post": { "summary": "Create a check run", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nCreates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs.\n\nIn a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.", "tags": [ "checks" ], "operationId": "checks/create", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#create-a-check-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the check. For example, \"code-coverage\"." }, "head_sha": { "type": "string", "description": "The SHA of the commit." }, "details_url": { "type": "string", "description": "The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used." }, "external_id": { "type": "string", "description": "A reference for the run on the integrator's system." }, "status": { "type": "string", "description": "The current status.", "enum": [ "queued", "in_progress", "completed" ], "default": "queued" }, "started_at": { "type": "string", "format": "date-time", "description": "The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`." }, "conclusion": { "type": "string", "description": "**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. \n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.", "enum": [ "action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out" ] }, "completed_at": { "type": "string", "format": "date-time", "description": "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`." }, "output": { "type": "object", "description": "Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#output-object) description.", "properties": { "title": { "type": "string", "description": "The title of the check run." }, "summary": { "type": "string", "maxLength": 65535, "description": "The summary of the check run. This parameter supports Markdown." }, "text": { "type": "string", "maxLength": 65535, "description": "The details of the check run. This parameter supports Markdown." }, "annotations": { "type": "array", "description": "Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\". See the [`annotations` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#annotations-object) description for details about how to use this parameter.", "maxItems": 50, "items": { "type": "object", "properties": { "path": { "type": "string", "description": "The path of the file to add an annotation to. For example, `assets/css/main.css`." }, "start_line": { "type": "integer", "description": "The start line of the annotation." }, "end_line": { "type": "integer", "description": "The end line of the annotation." }, "start_column": { "type": "integer", "description": "The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values." }, "end_column": { "type": "integer", "description": "The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values." }, "annotation_level": { "type": "string", "description": "The level of the annotation.", "enum": [ "notice", "warning", "failure" ] }, "message": { "type": "string", "description": "A short description of the feedback for these lines of code. The maximum size is 64 KB." }, "title": { "type": "string", "description": "The title that represents the annotation. The maximum size is 255 characters." }, "raw_details": { "type": "string", "description": "Details about this annotation. The maximum size is 64 KB." } }, "required": [ "path", "start_line", "end_line", "annotation_level", "message" ] } }, "images": { "type": "array", "description": "Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#images-object) description for details.", "items": { "type": "object", "properties": { "alt": { "type": "string", "description": "The alternative text for the image." }, "image_url": { "type": "string", "description": "The full URL of the image." }, "caption": { "type": "string", "description": "A short image description." } }, "required": [ "alt", "image_url" ] } } }, "required": [ "title", "summary" ] }, "actions": { "type": "array", "description": "Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#check-runs-and-requested-actions).\"", "maxItems": 3, "items": { "type": "object", "properties": { "label": { "type": "string", "maxLength": 20, "description": "The text to be displayed on a button in the web UI. The maximum size is 20 characters." }, "description": { "type": "string", "maxLength": 40, "description": "A short explanation of what this action would do. The maximum size is 40 characters." }, "identifier": { "type": "string", "maxLength": 20, "description": "A reference for the action on the integrator's system. The maximum size is 20 characters." } }, "required": [ "label", "description", "identifier" ] } } }, "required": [ "name", "head_sha" ], "oneOf": [ { "properties": { "status": { "enum": [ "completed" ] } }, "required": [ "status", "conclusion" ], "additionalProperties": true }, { "properties": { "status": { "enum": [ "queued", "in_progress" ] } }, "additionalProperties": true } ] }, "examples": { "example-of-in-progress-conclusion": { "summary": "Example of an in_progress conclusion", "value": { "name": "mighty_readme", "head_sha": "ce587453ced02b1526dfb4cb910479d431683101", "status": "in_progress", "external_id": "42", "started_at": "2018-05-04T01:14:52Z", "output": { "title": "Mighty Readme report", "summary": "", "text": "" } } }, "example-of-completed-conclusion": { "summary": "Example of a completed conclusion", "value": { "name": "mighty_readme", "head_sha": "ce587453ced02b1526dfb4cb910479d431683101", "status": "completed", "started_at": "2017-11-30T19:39:10Z", "conclusion": "success", "completed_at": "2017-11-30T19:49:10Z", "output": { "title": "Mighty Readme report", "summary": "There are 0 failures, 2 warnings, and 1 notices.", "text": "You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.", "annotations": [ { "path": "README.md", "annotation_level": "warning", "title": "Spell Checker", "message": "Check your spelling for 'banaas'.", "raw_details": "Do you mean 'bananas' or 'banana'?", "start_line": 2, "end_line": 2 }, { "path": "README.md", "annotation_level": "warning", "title": "Spell Checker", "message": "Check your spelling for 'aples'", "raw_details": "Do you mean 'apples' or 'Naples'", "start_line": 4, "end_line": 4 } ], "images": [ { "alt": "Super bananas", "image_url": "http://example.com/images/42" } ] }, "actions": [ { "label": "Fix", "identifier": "fix_errors", "description": "Allow us to fix these errors for you" } ] } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-run" }, "examples": { "example-of-completed-conclusion": { "$ref": "#/components/examples/check-run-example-of-completed-conclusion" }, "example-of-in-progress-conclusion": { "$ref": "#/components/examples/check-run-example-of-in-progress-conclusion" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-runs/{check_run_id}": { "get": { "summary": "Get a check run", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nGets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.", "tags": [ "checks" ], "operationId": "checks/get", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#get-a-check-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-run" }, "examples": { "default": { "$ref": "#/components/examples/check-run" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } }, "patch": { "summary": "Update a check run", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nUpdates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs.", "tags": [ "checks" ], "operationId": "checks/update", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#update-a-check-run" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the check. For example, \"code-coverage\"." }, "details_url": { "type": "string", "description": "The URL of the integrator's site that has the full details of the check." }, "external_id": { "type": "string", "description": "A reference for the run on the integrator's system." }, "started_at": { "type": "string", "format": "date-time", "description": "This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`." }, "status": { "type": "string", "description": "The current status.", "enum": [ "queued", "in_progress", "completed" ] }, "conclusion": { "type": "string", "description": "**Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. \n**Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.", "enum": [ "action_required", "cancelled", "failure", "neutral", "success", "skipped", "stale", "timed_out" ] }, "completed_at": { "type": "string", "format": "date-time", "description": "The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`." }, "output": { "type": "object", "description": "Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#output-object-1) description.", "properties": { "title": { "type": "string", "description": "**Required**." }, "summary": { "type": "string", "description": "Can contain Markdown.", "maxLength": 65535 }, "text": { "type": "string", "description": "Can contain Markdown.", "maxLength": 65535 }, "annotations": { "type": "array", "description": "Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\". See the [`annotations` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#annotations-object-1) description for details.", "maxItems": 50, "items": { "type": "object", "properties": { "path": { "type": "string", "description": "The path of the file to add an annotation to. For example, `assets/css/main.css`." }, "start_line": { "type": "integer", "description": "The start line of the annotation." }, "end_line": { "type": "integer", "description": "The end line of the annotation." }, "start_column": { "type": "integer", "description": "The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values." }, "end_column": { "type": "integer", "description": "The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values." }, "annotation_level": { "type": "string", "description": "The level of the annotation.", "enum": [ "notice", "warning", "failure" ] }, "message": { "type": "string", "description": "A short description of the feedback for these lines of code. The maximum size is 64 KB." }, "title": { "type": "string", "description": "The title that represents the annotation. The maximum size is 255 characters." }, "raw_details": { "type": "string", "description": "Details about this annotation. The maximum size is 64 KB." } }, "required": [ "path", "start_line", "end_line", "annotation_level", "message" ] } }, "images": { "type": "array", "description": "Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#annotations-object-1) description for details.", "items": { "type": "object", "properties": { "alt": { "type": "string", "description": "The alternative text for the image." }, "image_url": { "type": "string", "description": "The full URL of the image." }, "caption": { "type": "string", "description": "A short image description." } }, "required": [ "alt", "image_url" ] } } }, "required": [ "summary" ] }, "actions": { "type": "array", "description": "Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#check-runs-and-requested-actions).\"", "maxItems": 3, "items": { "type": "object", "properties": { "label": { "type": "string", "maxLength": 20, "description": "The text to be displayed on a button in the web UI. The maximum size is 20 characters." }, "description": { "type": "string", "maxLength": 40, "description": "A short explanation of what this action would do. The maximum size is 40 characters." }, "identifier": { "type": "string", "maxLength": 20, "description": "A reference for the action on the integrator's system. The maximum size is 20 characters." } }, "required": [ "label", "description", "identifier" ] } } }, "anyOf": [ { "properties": { "status": { "enum": [ "completed" ] } }, "required": [ "conclusion" ], "additionalProperties": true }, { "properties": { "status": { "enum": [ "queued", "in_progress" ] } }, "additionalProperties": true } ] }, "examples": { "default": { "value": { "name": "mighty_readme", "started_at": "2018-05-04T01:14:52Z", "status": "completed", "conclusion": "success", "completed_at": "2018-05-04T01:14:52Z", "output": { "title": "Mighty Readme report", "summary": "There are 0 failures, 2 warnings, and 1 notices.", "text": "You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.", "annotations": [ { "path": "README.md", "annotation_level": "warning", "title": "Spell Checker", "message": "Check your spelling for 'banaas'.", "raw_details": "Do you mean 'bananas' or 'banana'?", "start_line": 2, "end_line": 2 }, { "path": "README.md", "annotation_level": "warning", "title": "Spell Checker", "message": "Check your spelling for 'aples'", "raw_details": "Do you mean 'apples' or 'Naples'", "start_line": 4, "end_line": 4 } ], "images": [ { "alt": "Super bananas", "image_url": "http://example.com/images/42" } ] } } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-run" }, "examples": { "default": { "$ref": "#/components/examples/check-run" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations": { "get": { "summary": "List check run annotations", "description": "Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository.", "tags": [ "checks" ], "operationId": "checks/list-annotations", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#list-check-run-annotations" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/check-annotation" } }, "examples": { "default": { "$ref": "#/components/examples/check-annotation-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-suites": { "post": { "summary": "Create a check suite", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\nBy default, check suites are automatically created when you create a [check run](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using \"[Update repository preferences for check suites](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#update-repository-preferences-for-check-suites)\". Your GitHub App must have the `checks:write` permission to create check suites.", "tags": [ "checks" ], "operationId": "checks/create-suite", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#create-a-check-suite" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "head_sha": { "type": "string", "description": "The sha of the head commit." } }, "required": [ "head_sha" ] }, "examples": { "default": { "value": { "head_sha": "d6fde92930d4715a2b49857d24b940956b26d2d3" } } } } } }, "responses": { "200": { "description": "Response when the suite already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-suite" }, "examples": { "default": { "$ref": "#/components/examples/check-suite" } } } } }, "201": { "description": "Response when the suite was created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-suite" }, "examples": { "default": { "$ref": "#/components/examples/check-suite" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/preferences": { "patch": { "summary": "Update repository preferences for check suites", "description": "Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites.", "tags": [ "checks" ], "operationId": "checks/set-suites-preferences", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#update-repository-preferences-for-check-suites" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "auto_trigger_checks": { "type": "array", "description": "Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [`auto_trigger_checks` object](https://docs.github.com/enterprise-server@3.1/rest/reference/checks#auto_trigger_checks-object) description for details.", "items": { "type": "object", "properties": { "app_id": { "type": "integer", "description": "The `id` of the GitHub App." }, "setting": { "type": "boolean", "description": "Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them.", "default": true } }, "required": [ "app_id", "setting" ] } } } }, "examples": { "default": { "value": { "auto_trigger_checks": [ { "app_id": 4, "setting": false } ] } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-suite-preference" }, "examples": { "default": { "$ref": "#/components/examples/check-suite-preference" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}": { "get": { "summary": "Get a check suite", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\nGets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.", "tags": [ "checks" ], "operationId": "checks/get-suite", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#get-a-check-suite" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-suite-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/check-suite" }, "examples": { "default": { "$ref": "#/components/examples/check-suite" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs": { "get": { "summary": "List check runs in a check suite", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nLists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.", "tags": [ "checks" ], "operationId": "checks/list-for-suite", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#list-check-runs-in-a-check-suite" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-suite-id" }, { "$ref": "#/components/parameters/check-name" }, { "$ref": "#/components/parameters/status" }, { "name": "filter", "description": "Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "latest", "all" ], "default": "latest" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "check_runs" ], "properties": { "total_count": { "type": "integer" }, "check_runs": { "type": "array", "items": { "$ref": "#/components/schemas/check-run" } } } }, "examples": { "default": { "$ref": "#/components/examples/check-run-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest": { "post": { "summary": "Rerequest a check suite", "description": "Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.\n\nTo rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.", "tags": [ "checks" ], "operationId": "checks/rerequest-suite", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#rerequest-a-check-suite" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-suite-id" } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "properties": { }, "additionalProperties": false } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "suites" } } }, "/repos/{owner}/{repo}/code-scanning/alerts": { "get": { "summary": "List code scanning alerts for a repository", "description": "Lists all open code scanning alerts for the default branch (usually `main`\nor `master`). You must use an access token with the `security_events` scope to use\nthis endpoint. GitHub Apps must have the `security_events` read permission to use\nthis endpoint.\n\nThe response includes a `most_recent_instance` object.\nThis provides details of the most recent instance of this alert\nfor the default branch or for the specified Git reference\n(if you used `ref` in the request).", "tags": [ "code-scanning" ], "operationId": "code-scanning/list-alerts-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/tool-name" }, { "$ref": "#/components/parameters/tool-guid" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/git-ref" }, { "name": "state", "description": "Set to `open`, `fixed`, or `dismissed` to list code scanning alerts in a specific state.", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-alert-state" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/code-scanning-alert-items" } }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-items" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "code-scanning", "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": { "get": { "summary": "Get a code scanning alert", "description": "Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.\n\n**Deprecation notice**:\nThe instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`.", "tags": [ "code-scanning" ], "operationId": "code-scanning/get-alert", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#get-a-code-scanning-alert" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/alert-number" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-alert" }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "code-scanning", "subcategory": null } }, "patch": { "summary": "Update a code scanning alert", "description": "Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.", "operationId": "code-scanning/update-alert", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#update-a-code-scanning-alert" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/alert-number" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "state": { "$ref": "#/components/schemas/code-scanning-alert-set-state" }, "dismissed_reason": { "$ref": "#/components/schemas/code-scanning-alert-dismissed-reason" } }, "required": [ "state" ] }, "examples": { "default": { "value": { "state": "dismissed", "dismissed_reason": "false positive", "dismissed_comment": "This alert is not actually correct, because there's a sanitizer included in the library." } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-alert" }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-dismissed" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_write" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } } }, "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": { "get": { "summary": "List instances of a code scanning alert", "description": "Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.", "tags": [ "code-scanning" ], "operationId": "code-scanning/list-alert-instances", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#list-instances-of-a-code-scanning-alert" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/alert-number" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/git-ref" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/code-scanning-alert-instance" } }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-instances" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "code-scanning", "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/analyses": { "get": { "summary": "List code scanning analyses for a repository", "description": "Lists the details of all code scanning analyses for a repository,\nstarting with the most recent.\nThe response is paginated and you can use the `page` and `per_page` parameters\nto list the analyses you're interested in.\nBy default 30 analyses are listed per page.\n\nThe `rules_count` field in the response give the number of rules\nthat were run in the analysis.\nFor very old analyses this data is not available,\nand `0` is returned in this field.\n\nYou must use an access token with the `security_events` scope to use this endpoint.\nGitHub Apps must have the `security_events` read permission to use this endpoint.\n\n**Deprecation notice**:\nThe `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.", "operationId": "code-scanning/list-recent-analyses", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/tool-name" }, { "$ref": "#/components/parameters/tool-guid" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" }, { "name": "ref", "in": "query", "description": "The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`.", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-ref" } }, { "name": "sarif_id", "in": "query", "description": "Filter analyses belonging to the same SARIF upload.", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-analysis-sarif-id" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/code-scanning-analysis" } }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-analysis-items" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } } }, "/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}": { "get": { "summary": "Get a code scanning analysis for a repository", "description": "Gets a specified code scanning analysis for a repository.\nYou must use an access token with the `security_events` scope to use this endpoint.\nGitHub Apps must have the `security_events` read permission to use this endpoint.\n\nThe default JSON response contains fields that describe the analysis.\nThis includes the Git reference and commit SHA to which the analysis relates,\nthe datetime of the analysis, the name of the code scanning tool,\nand the number of alerts.\n\nThe `rules_count` field in the default response give the number of rules\nthat were run in the analysis.\nFor very old analyses this data is not available,\nand `0` is returned in this field.\n\nIf you use the Accept header `application/sarif+json`,\nthe response contains the analysis data that was uploaded.\nThis is formatted as\n[SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html).\n\n**Deprecation notice**:\nThe `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.", "operationId": "code-scanning/get-analysis", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "analysis_id", "in": "path", "description": "The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-analysis" }, "examples": { "response": { "$ref": "#/components/examples/code-scanning-analysis-default" } } }, "application/json+sarif": { "schema": { "type": "object", "additionalProperties": true }, "examples": { "response": { "$ref": "#/components/examples/code-scanning-analysis-sarif" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } }, "delete": { "summary": "Delete a code scanning analysis from a repository", "description": "Deletes a specified code scanning analysis from a repository. For\nprivate repositories, you must use an access token with the `repo` scope. For public repositories,\nyou must use an access token with `public_repo` and `repo:security_events` scopes.\nGitHub Apps must have the `security_events` write permission to use this endpoint.\n\nYou can delete one analysis at a time.\nTo delete a series of analyses, start with the most recent analysis and work backwards.\nConceptually, the process is similar to the undo function in a text editor.\n\n**Note**: The ability to delete analyses was introduced in GitHub Enterprise Server 3.1.\nYou can delete analyses that were generated prior to installing this release,\nhowever, if you do so, you will lose information about fixed alerts for all such analyses,\nfor the relevant code scanning tool.\nWe recommend that you only delete analyses that were generated with earlier releases\nif you don't need the details of fixed alerts from pre-3.1 releases.\n\nWhen you list the analyses for a repository,\none or more will be identified as deletable in the response:\n\n```\n\"deletable\": true\n```\n\nAn analysis is deletable when it's the most recent in a set of analyses.\nTypically, a repository will have multiple sets of analyses\nfor each enabled code scanning tool,\nwhere a set is determined by a unique combination of analysis values:\n\n* `ref`\n* `tool`\n* `analysis_key`\n* `environment`\n\nIf you attempt to delete an analysis that is not the most recent in a set,\nyou'll get a 400 response with the message:\n\n```\nAnalysis specified is not deletable.\n```\n\nThe response from a successful `DELETE` operation provides you with\ntwo alternative URLs for deleting the next analysis in the set\n(see the example default response below).\nUse the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis\nin the set. This is a useful option if you want to preserve at least one analysis\nfor the specified tool in your repository.\nUse the `confirm_delete_url` URL if you are content to remove all analyses for a tool.\nWhen you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url`\nin the 200 response is `null`.\n\nAs an example of the deletion process,\nlet's imagine that you added a workflow that configured a particular code scanning tool\nto analyze the code in a repository. This tool has added 15 analyses:\n10 on the default branch, and another 5 on a topic branch.\nYou therefore have two separate sets of analyses for this tool.\nYou've now decided that you want to remove all of the analyses for the tool.\nTo do this you must make 15 separate deletion requests.\nTo start, you must find the deletable analysis for one of the sets,\nstep through deleting the analyses in that set,\nand then repeat the process for the second set.\nThe procedure therefore consists of a nested loop:\n\n**Outer loop**:\n* List the analyses for the repository, filtered by tool.\n* Parse this list to find a deletable analysis. If found:\n\n **Inner loop**:\n * Delete the identified analysis.\n * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.\n\nThe above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.", "operationId": "code-scanning/delete-analysis", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#delete-a-code-scanning-analysis-from-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "analysis_id", "in": "path", "description": "The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.", "required": true, "schema": { "type": "integer" } }, { "name": "confirm_delete", "in": "query", "description": "Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.`", "required": false, "schema": { "type": "string", "nullable": true } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-analysis-deletion" }, "examples": { "default-response": { "$ref": "#/components/examples/code-scanning-analysis-deletion" } } } } }, "400": { "$ref": "#/components/responses/bad_request" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_write" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } } }, "/repos/{owner}/{repo}/code-scanning/sarifs": { "post": { "summary": "Upload an analysis as SARIF data", "description": "Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint.\n\nThere are two places where you can upload code scanning results.\n - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see \"[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests).\"\n - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see \"[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository).\"\n\nYou must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:\n\n```\ngzip -c analysis-data.sarif | base64 -w0\n```\n\nSARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries.\n\nThe `202 Accepted`, response includes an `id` value.\nYou can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint.\nFor more information, see \"[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload).\"", "operationId": "code-scanning/upload-sarif", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#upload-a-sarif-file" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "commit_sha": { "$ref": "#/components/schemas/code-scanning-analysis-commit-sha" }, "ref": { "$ref": "#/components/schemas/code-scanning-ref" }, "sarif": { "$ref": "#/components/schemas/code-scanning-analysis-sarif-file" }, "checkout_uri": { "description": "The base directory used in the analysis, as it appears in the SARIF file.\nThis property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.", "example": "file:///github/workspace/", "type": "string", "format": "uri" }, "started_at": { "description": "The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.", "format": "date-time", "type": "string" }, "tool_name": { "description": "The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to \"API\". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`.", "type": "string" } }, "required": [ "commit_sha", "ref", "sarif" ] }, "examples": { "default": { "value": { "commit_sha": "4b6472266afd7b471e86085a6659e8c7f2b119da", "ref": "refs/heads/master", "sarif": "H4sICMLGdF4AA2V4YW1wbGUuc2FyaWYAvVjdbts2FL7PUxDCijaA/CM7iRNfLkPXYgHSNstumlzQ0pHFVCI1korjFgH2ONtr7Ul2KFmy/mOn6QIkjsjDw0/nfN85NL8dEGL9pNwAImqRObECrWM1H40kXQ2XTAfJIlEgXcE1cD10RTQSVDE10K4aKSqZP1AxuKOIKg1ydJU60jSfSh8Hk6EzHA/vlOCWbfa7B6kYPpj90rlsWCZcmbHP5Bs+4oAWIjQD2SMOeJLh2vIQDnIaQerqXHjw8YIgxohybxAyDsS4cAPKsp03K4RcUs6+Up2D+JXpd8mibKIQN9fM/aMCdbyBujGSSQgVxJtx5qX2d2qUcIweQhEuDQf3GBO6CKHkogx/N3MVCKl/AeVKFuf4y5ubsMGDTj1ep+5I7sgmLIpxtU38hLtmMRGSuCFVyip5eKzs5ydh+LztVL6f2m6oih1BkYiuyQIIJWodxVpERPj4sEiWBNNH8EWT0DMG8EAjzKVHXCrB4FkPu/F64NMk1OeC+2yZSNoBOoR7CC0EzYWGbm+xFDFIzbI011+cLjfZtyJkmMZfumAh02uL3NpV2y+MZ6RAjxibyKrNxxJcVjANSb4eBGwZ1M0KsuyR2poLr5rMl8vaDSeVn6eTWEO2j2xIEcmhwlTKNOi4GMOI8gfuZYkvJ7b4v5Tiumyz7RnHeodFzpS8ASIZCH/AYdWi2z3sG8JtFxJ6fF9yR9CdifBr9Pd6d5V2+zbJKjjCFGGmsHuYFy2ytJq9tUxcLSRSQecppOGKrpUxYfxefMEFK+wOGa4hudQByBVT0L+EKtyACxnRsABhEx1QjVDs1KNI9MbpnhqfE45B6FJvu3hRu5VRU9MhZLmK7fqkKyQSTHNoyMqUFMqXCV3CwAeqEwmVokraK8IuBaGvHjQ0gMYrKjnjyw7uk9uD8tgmsBbFMPnU1bV2ZhkJNkuolUiWys3UPWzs5aaIUz9TBe8zMb+6+nT+6fLy91dlE3xzeDDT4zYszb0bW6NjJd0Rvn2EnLvWLFSdKPpBzInzfRgu8ETyMcH8nIfMnJCeC2PyfTA+UKngcnGH7Hw2hGkVQs5YlIRCtdWZYQ4/73es2JlxkfViOEIhoWJq5Oo6UBBfiKIqFBWhiE3jJGbFwVoxBHTRSuIS67sMeplei24X20shLjG+8gqbKC/bESiNMC+wd5q5id0yeS7CJEqXzmrTWNq3k05l84P6f4/bEmXFJjI0fIt1BGQssUnUDkBYeVhE5TqPnMH3jqogDcP0zKcTgLPTMSzOjhbjuVOmW23l1fYNStulfo6sXlFsGLhbDy5RECPRYGCTgOj2bd4nUQEivEd0H7KKYxqnEhFohuur3a3UPskbH/+Yg0+M5P2MHRJu3ziHh3Z2NCrWt3XF1rWTw8Ne/pfbWYXnDSE0SNZQQt1i18q7te2vOhu7ehWuvVyeu0wbLZi24mhoo6aOOTltzG/lgdVvVoXQq5V+pewkFIzL8fjEcadT55jOjpzFzHuOTtDNrMkJPMVQDd7F09RID72O/UPZ0tmctqZ7kWX6EmSZnDpP8GU67SXM8XE3YSrxbKsx6UReZ4y6n/FVZfJjs9Z7stma75W5yQtkzjk5eSJxk1lv4o7+j8TlhaJ2lsKWZO6lruDPBLib3x5ZN/KGWzZ+pn///evv7OOf4iIBv3oY9L/l1wiJ9p0Tc+F1zZnOE9NxXWEus6IQhr5pMfoqxi8WPsuu0azsns4UC6WzNzHIzbeEx4P/AJ3SefgcFAAA" } } } } } }, "responses": { "202": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-sarifs-receipt" }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-sarif-upload" } } } } }, "400": { "description": "Bad Request if the sarif field is invalid" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_write" }, "404": { "$ref": "#/components/responses/not_found" }, "413": { "description": "Payload Too Large if the sarif field is too large" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } } }, "/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}": { "get": { "summary": "Get information about a SARIF upload", "description": "Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see \"[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository).\" You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint.", "operationId": "code-scanning/get-sarif", "tags": [ "code-scanning" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/code-scanning#list-recent-code-scanning-analyses-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "sarif_id", "description": "The SARIF ID obtained after uploading.", "in": "path", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/code-scanning-sarifs-status" }, "examples": { "default": { "$ref": "#/components/examples/code-scanning-sarif-upload-status" } } } } }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "description": "Not Found if the sarif id does not match any upload" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "enabledForGitHubApps": true, "githubCloudOnly": false, "category": "code-scanning" } } }, "/repos/{owner}/{repo}/collaborators": { "get": { "summary": "List repository collaborators", "description": "For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\nOrganization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.\n\nTeam members will include the members of child teams.\n\nYou must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\nendpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\nendpoint.", "tags": [ "repos" ], "operationId": "repos/list-collaborators", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-repository-collaborators" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "affiliation", "description": "Filter collaborators returned by their affiliation. `outside` means all outside collaborators of an organization-owned repository. `direct` means all collaborators with permissions to an organization-owned repository, regardless of organization membership status. `all` means all collaborators the authenticated user can see.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "outside", "direct", "all" ], "default": "all" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/collaborator" } }, "examples": { "default": { "$ref": "#/components/examples/collaborator-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "collaborators" } } }, "/repos/{owner}/{repo}/collaborators/{username}": { "get": { "summary": "Check if a user is a repository collaborator", "description": "For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\n\nTeam members will include the members of child teams.\n\nYou must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\nendpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\nendpoint.", "tags": [ "repos" ], "operationId": "repos/check-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#check-if-a-user-is-a-repository-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response if user is a collaborator" }, "404": { "description": "Not Found if user is not a collaborator" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "collaborators" } }, "put": { "summary": "Add a repository collaborator", "description": "This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.1/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.\n\nFor more information on permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.1/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:\n\n```\nCannot assign {member} permission of {role name}\n```\n\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#http-verbs).\"\n\nThe invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#invitations).\n\n**Updating an existing collaborator's permission level**\n\nThe endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed.\n\n**Rate limits**\n\nYou are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.", "tags": [ "repos" ], "operationId": "repos/add-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#add-a-repository-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "permission": { "type": "string", "description": "The permission to grant the collaborator. **Only valid on organization-owned repositories.**", "enum": [ "pull", "push", "admin", "maintain", "triage" ], "default": "push" } } }, "examples": { "new-invitation-is-created": { "summary": "Add a collaborator with triage permissions", "value": { "permission": "triage" } } } } } }, "responses": { "201": { "description": "Response when a new invitation is created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/repository-invitation" }, "examples": { "new-invitation-is-created": { "$ref": "#/components/examples/repository-invitation-response-when-a-new-invitation-is-created" } } } } }, "204": { "description": "Response when:\n- an existing collaborator is added as a collaborator\n- an organization member is added as an individual collaborator\n- an existing team member (whose team is also a repository collaborator) is added as an individual collaborator" }, "422": { "$ref": "#/components/responses/validation_failed" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "triggersNotification": true, "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "collaborators" } }, "delete": { "summary": "Remove a repository collaborator", "description": "", "tags": [ "repos" ], "operationId": "repos/remove-collaborator", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#remove-a-repository-collaborator" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "collaborators" } } }, "/repos/{owner}/{repo}/collaborators/{username}/permission": { "get": { "summary": "Get repository permissions for a user", "description": "Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`.", "tags": [ "repos" ], "operationId": "repos/get-collaborator-permission-level", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-repository-permissions-for-a-user" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "description": "if user has admin permissions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/repository-collaborator-permission" }, "examples": { "response-if-user-has-admin-permissions": { "$ref": "#/components/examples/repository-collaborator-permission-response-if-user-has-admin-permissions" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "collaborators" } } }, "/repos/{owner}/{repo}/comments": { "get": { "summary": "List commit comments for a repository", "description": "Commit Comments use [these custom media types](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/).\n\nComments are ordered by ascending ID.", "tags": [ "repos" ], "operationId": "repos/list-commit-comments-for-repo", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-commit-comments-for-a-repository" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/commit-comment" } }, "examples": { "default": { "$ref": "#/components/examples/commit-comment-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/repos/{owner}/{repo}/comments/{comment_id}": { "get": { "summary": "Get a commit comment", "description": "", "tags": [ "repos" ], "operationId": "repos/get-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/commit-comment" }, "examples": { "default": { "$ref": "#/components/examples/commit-comment" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "patch": { "summary": "Update a commit comment", "description": "", "tags": [ "repos" ], "operationId": "repos/update-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#update-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "string", "description": "The contents of the comment" } }, "required": [ "body" ] }, "examples": { "default": { "value": { "body": "Nice change" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/commit-comment" }, "examples": { "default": { "$ref": "#/components/examples/commit-comment-2" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments" } }, "delete": { "summary": "Delete a commit comment", "description": "", "tags": [ "repos" ], "operationId": "repos/delete-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments" } } }, "/repos/{owner}/{repo}/comments/{comment_id}/reactions": { "get": { "summary": "List reactions for a commit comment", "description": "List the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#comments).", "tags": [ "reactions" ], "operationId": "reactions/list-for-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#list-reactions-for-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" }, { "name": "content", "description": "Returns a single [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/reaction" } }, "examples": { "default": { "$ref": "#/components/examples/reaction-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create reaction for a commit comment", "description": "Create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment.", "tags": [ "reactions" ], "operationId": "reactions/create-for-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#create-reaction-for-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "string", "description": "The [reaction type](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#reaction-types) to add to the commit comment.", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ] } }, "required": [ "content" ] }, "examples": { "default": { "value": { "content": "heart" } } } } } }, "responses": { "200": { "description": "Reaction exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } }, "201": { "description": "Reaction created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/reaction" }, "examples": { "default": { "$ref": "#/components/examples/reaction" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "415": { "$ref": "#/components/responses/preview_header_missing" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}": { "delete": { "summary": "Delete a commit comment reaction", "description": "**Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.\n\nDelete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#comments).", "tags": [ "reactions" ], "operationId": "reactions/delete-for-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/reactions#delete-a-commit-comment-reaction" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/comment-id" }, { "$ref": "#/components/parameters/reaction-id" } ], "responses": { "204": { "description": "Response" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "reactions", "previews": [ { "required": true, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } } }, "/repos/{owner}/{repo}/commits": { "get": { "summary": "List commits", "description": "**Signature verification object**\n\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n| Name | Type | Description |\n| ---- | ---- | ----------- |\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n| `signature` | `string` | The signature that was extracted from the commit. |\n| `payload` | `string` | The value that was signed. |\n\nThese are the possible values for `reason` in the `verification` object:\n\n| Value | Description |\n| ----- | ----------- |\n| `expired_key` | The key that made the signature is expired. |\n| `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n| `unsigned` | The object does not include a signature. |\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\n| `no_user` | No user was associated with the `committer` email address in the commit. |\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\n| `malformed_signature` | There was an error parsing the signature. |\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |", "tags": [ "repos" ], "operationId": "repos/list-commits", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-commits" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "sha", "description": "SHA or branch to start listing commits from. Default: the repository’s default branch (usually `master`).", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "path", "description": "Only commits containing this file path will be returned.", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "author", "description": "GitHub login or email address by which to filter by commit author.", "in": "query", "required": false, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/since" }, { "name": "until", "description": "Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.", "in": "query", "required": false, "schema": { "type": "string", "format": "date-time" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/commit" } }, "examples": { "default": { "$ref": "#/components/examples/commit-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "500": { "$ref": "#/components/responses/internal_error" }, "400": { "$ref": "#/components/responses/bad_request" }, "404": { "$ref": "#/components/responses/not_found" }, "409": { "$ref": "#/components/responses/conflict" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "commits" } } }, "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head": { "get": { "summary": "List branches for HEAD commit", "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReturns all branches where the given commit SHA is the HEAD, or latest commit for the branch.", "tags": [ "repos" ], "operationId": "repos/list-branches-for-head-commit", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-branches-for-head-commit" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/commit-sha" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/branch-short" } }, "examples": { "default": { "$ref": "#/components/examples/branch-short-items" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "commits", "previews": [ { "required": true, "name": "groot", "note": "Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.groot-preview+json\n```" } ] } } }, "/repos/{owner}/{repo}/commits/{commit_sha}/comments": { "get": { "summary": "List commit comments", "description": "Use the `:commit_sha` to specify the commit that will have its comments listed.", "tags": [ "repos" ], "operationId": "repos/list-comments-for-commit", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-commit-comments" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/commit-sha" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/commit-comment" } }, "examples": { "default": { "$ref": "#/components/examples/commit-comment-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments", "previews": [ { "required": false, "name": "squirrel-girl", "note": "An additional `reactions` object in the issue comment payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2016-05-12-reactions-api-preview) for full details.\n\nTo access the API you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.squirrel-girl-preview\n```\nThe `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://docs.github.com/enterprise-server@3.1/rest/reference/reactions) reactions." } ] } }, "post": { "summary": "Create a commit comment", "description": "Create a comment for a commit using its `:commit_sha`.\n\nThis endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See \"[Secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/overview/resources-in-the-rest-api#secondary-rate-limits)\" and \"[Dealing with secondary rate limits](https://docs.github.com/enterprise-server@3.1/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)\" for details.", "tags": [ "repos" ], "operationId": "repos/create-commit-comment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-a-commit-comment" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/commit-sha" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "string", "description": "The contents of the comment." }, "path": { "type": "string", "description": "Relative path of the file to comment on." }, "position": { "type": "integer", "description": "Line index in the diff to comment on." }, "line": { "type": "integer", "description": "**Deprecated**. Use **position** parameter instead. Line number in the file to comment on." } }, "required": [ "body" ] }, "examples": { "default": { "value": { "body": "Great stuff", "path": "file1.txt", "position": 4, "line": 1 } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/commit-comment" }, "examples": { "default": { "$ref": "#/components/examples/commit-comment" } } } }, "headers": { "Location": { "example": "https://api.github.com/repos/octocat/Hello-World/comments/1", "schema": { "type": "string" } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "triggersNotification": true, "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "comments" } } }, "/repos/{owner}/{repo}/commits/{commit_sha}/pulls": { "get": { "summary": "List pull requests associated with a commit", "description": "Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/enterprise-server@3.1/rest/reference/pulls#list-pull-requests) endpoint.", "tags": [ "repos" ], "operationId": "repos/list-pull-requests-associated-with-commit", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-pull-requests-associated-with-a-commit" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/commit-sha" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/pull-request-simple" } }, "examples": { "default": { "$ref": "#/components/examples/pull-request-simple-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "commits", "previews": [ { "required": true, "name": "groot", "note": "Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the [blog post](https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/) for more details. To access the new endpoints during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.groot-preview+json\n```" } ] } } }, "/repos/{owner}/{repo}/commits/{ref}": { "get": { "summary": "Get a commit", "description": "Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.\n\n**Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.\n\nYou can pass the appropriate [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property.\n\nTo return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.\n\n**Signature verification object**\n\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n| Name | Type | Description |\n| ---- | ---- | ----------- |\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n| `signature` | `string` | The signature that was extracted from the commit. |\n| `payload` | `string` | The value that was signed. |\n\nThese are the possible values for `reason` in the `verification` object:\n\n| Value | Description |\n| ----- | ----------- |\n| `expired_key` | The key that made the signature is expired. |\n| `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n| `unsigned` | The object does not include a signature. |\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\n| `no_user` | No user was associated with the `committer` email address in the commit. |\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\n| `malformed_signature` | There was an error parsing the signature. |\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |", "tags": [ "repos" ], "operationId": "repos/get-commit", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-a-commit" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" }, { "name": "ref", "description": "ref parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/commit" }, "examples": { "default": { "$ref": "#/components/examples/commit" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "commits" } } }, "/repos/{owner}/{repo}/commits/{ref}/check-runs": { "get": { "summary": "List check runs for a Git reference", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nLists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.", "tags": [ "checks" ], "operationId": "checks/list-for-ref", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#list-check-runs-for-a-git-reference" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "ref", "description": "ref parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true }, { "$ref": "#/components/parameters/check-name" }, { "$ref": "#/components/parameters/status" }, { "name": "filter", "description": "Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "latest", "all" ], "default": "latest" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "name": "app_id", "in": "query", "required": false, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "check_runs" ], "properties": { "total_count": { "type": "integer" }, "check_runs": { "type": "array", "items": { "$ref": "#/components/schemas/check-run" } } } }, "examples": { "default": { "$ref": "#/components/examples/check-run-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "runs" } } }, "/repos/{owner}/{repo}/commits/{ref}/check-suites": { "get": { "summary": "List check suites for a Git reference", "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\nLists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.", "tags": [ "checks" ], "operationId": "checks/list-suites-for-ref", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/checks#list-check-suites-for-a-git-reference" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "ref", "description": "ref parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true }, { "name": "app_id", "description": "Filters check suites by GitHub App `id`.", "in": "query", "required": false, "schema": { "type": "integer" }, "example": 1 }, { "$ref": "#/components/parameters/check-name" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "total_count", "check_suites" ], "properties": { "total_count": { "type": "integer" }, "check_suites": { "type": "array", "items": { "$ref": "#/components/schemas/check-suite" } } } }, "examples": { "default": { "$ref": "#/components/examples/check-suite-paginated" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "checks", "subcategory": "suites" } } }, "/repos/{owner}/{repo}/commits/{ref}/status": { "get": { "summary": "Get the combined status for a specific reference", "description": "Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.\n\n\nAdditionally, a combined `state` is returned. The `state` is one of:\n\n* **failure** if any of the contexts report as `error` or `failure`\n* **pending** if there are no statuses or a context is `pending`\n* **success** if the latest status for all contexts is `success`", "tags": [ "repos" ], "operationId": "repos/get-combined-status-for-ref", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-the-combined-status-for-a-specific-reference" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "ref", "description": "ref parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/combined-commit-status" }, "examples": { "default": { "$ref": "#/components/examples/combined-commit-status" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "statuses" } } }, "/repos/{owner}/{repo}/commits/{ref}/statuses": { "get": { "summary": "List commit statuses for a reference", "description": "Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.\n\nThis resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`.", "tags": [ "repos" ], "operationId": "repos/list-commit-statuses-for-ref", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-commit-statuses-for-a-reference" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "ref", "description": "ref parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/status" } }, "examples": { "default": { "$ref": "#/components/examples/status-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "301": { "$ref": "#/components/responses/moved_permanently" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "statuses" } } }, "/repos/{owner}/{repo}/compare/{basehead}": { "get": { "summary": "Compare two commits", "description": "The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `:branch`.\n\nThe response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats.\n\nThe response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.\n\n**Working with large comparisons**\n\nThe response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-commits) to enumerate all commits in the range.\n\nFor comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long\nto generate. You can typically resolve this error by using a smaller commit range.\n\n**Signature verification object**\n\nThe response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:\n\n| Name | Type | Description |\n| ---- | ---- | ----------- |\n| `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. |\n| `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. |\n| `signature` | `string` | The signature that was extracted from the commit. |\n| `payload` | `string` | The value that was signed. |\n\nThese are the possible values for `reason` in the `verification` object:\n\n| Value | Description |\n| ----- | ----------- |\n| `expired_key` | The key that made the signature is expired. |\n| `not_signing_key` | The \"signing\" flag is not among the usage flags in the GPG key that made the signature. |\n| `gpgverify_error` | There was an error communicating with the signature verification service. |\n| `gpgverify_unavailable` | The signature verification service is currently unavailable. |\n| `unsigned` | The object does not include a signature. |\n| `unknown_signature_type` | A non-PGP signature was found in the commit. |\n| `no_user` | No user was associated with the `committer` email address in the commit. |\n| `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. |\n| `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. |\n| `unknown_key` | The key that made the signature has not been registered with any user's account. |\n| `malformed_signature` | There was an error parsing the signature. |\n| `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. |\n| `valid` | None of the above errors applied, so the signature is considered to be verified. |", "tags": [ "repos" ], "operationId": "repos/compare-commits", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#compare-two-commits" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "basehead", "description": "The base branch and head branch to compare. This parameter expects the format `{base}...{head}`.", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/commit-comparison" }, "examples": { "default": { "$ref": "#/components/examples/commit-comparison" } } } } }, "500": { "$ref": "#/components/responses/internal_error" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "commits" } } }, "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { "post": { "summary": "Create a content attachment", "description": "Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/enterprise-server@3.1/webhooks/event-payloads/#content_reference) to create an attachment.\n\nThe app must create a content attachment within six hours of the content reference URL being posted. See \"[Using content attachments](https://docs.github.com/enterprise-server@3.1/apps/using-content-attachments/)\" for details about content attachments.\n\nYou must use an [installation access token](https://docs.github.com/enterprise-server@3.1/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", "tags": [ "apps" ], "operationId": "apps/create-content-attachment", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/apps#create-a-content-attachment" }, "parameters": [ { "name": "owner", "description": "The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "repo", "description": "The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event.", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "content_reference_id", "description": "The `id` of the `content_reference` event.", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "title": { "description": "The title of the attachment", "example": "Title of the attachment", "type": "string", "maxLength": 1024 }, "body": { "description": "The body of the attachment", "example": "Body of the attachment", "type": "string", "maxLength": 262144 } }, "required": [ "title", "body" ], "type": "object" } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/content-reference-attachment" }, "examples": { "default": { "$ref": "#/components/examples/content-reference-attachment" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" }, "410": { "$ref": "#/components/responses/gone" }, "415": { "$ref": "#/components/responses/preview_header_missing" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "previews": [ { "required": true, "name": "corsair", "note": "To access the Content Attachments API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.corsair-preview+json\n```" } ], "category": "apps", "subcategory": "installations" } } }, "/repos/{owner}/{repo}/contents/{path}": { "get": { "summary": "Get repository content", "description": "Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit\n`:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. \n\nFiles and symlinks support [a custom media type](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#custom-media-types) for\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\ntype](https://docs.github.com/enterprise-server@3.1/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent\nobject format.\n\n**Note**:\n* To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.1/rest/reference/git#trees).\n* This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees\nAPI](https://docs.github.com/enterprise-server@3.1/rest/reference/git#get-a-tree).\n* This API supports files up to 1 megabyte in size.\n\n#### If the content is a directory\nThe response will be an array of objects, one object for each item in the directory.\nWhen listing the contents of a directory, submodules have their \"type\" specified as \"file\". Logically, the value\n_should_ be \"submodule\". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW).\nIn the next major version of the API, the type will be returned as \"submodule\".\n\n#### If the content is a symlink \nIf the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the\nAPI responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object \ndescribing the symlink itself.\n\n#### If the content is a submodule\nThe `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific\ncommit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out\nthe submodule at that specific commit.\n\nIf the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links[\"git\"]`) and the\ngithub.com URLs (`html_url` and `_links[\"html\"]`) will have null values.", "tags": [ "repos" ], "operationId": "repos/get-content", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#get-repository-content" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "path", "description": "path parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true }, { "name": "ref", "description": "The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`)", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response", "content": { "application/vnd.github.v3.object": { "schema": { "$ref": "#/components/schemas/content-tree" } }, "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/content-directory" }, { "$ref": "#/components/schemas/content-file" }, { "$ref": "#/components/schemas/content-symlink" }, { "$ref": "#/components/schemas/content-submodule" } ] }, "examples": { "response-if-content-is-a-file": { "$ref": "#/components/examples/content-file-response-if-content-is-a-file" }, "response-if-content-is-a-directory": { "$ref": "#/components/examples/content-file-response-if-content-is-a-directory" }, "response-if-content-is-a-symlink": { "$ref": "#/components/examples/content-file-response-if-content-is-a-symlink" }, "response-if-content-is-a-submodule": { "$ref": "#/components/examples/content-file-response-if-content-is-a-submodule" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "403": { "$ref": "#/components/responses/forbidden" }, "302": { "$ref": "#/components/responses/found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "contents" } }, "put": { "summary": "Create or update file contents", "description": "Creates a new file or replaces an existing file in a repository.", "tags": [ "repos" ], "operationId": "repos/create-or-update-file-contents", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#create-or-update-file-contents" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "path", "description": "path parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The commit message." }, "content": { "type": "string", "description": "The new file content, using Base64 encoding." }, "sha": { "type": "string", "description": "**Required if you are updating a file**. The blob SHA of the file being replaced." }, "branch": { "type": "string", "description": "The branch name. Default: the repository’s default branch (usually `master`)" }, "committer": { "type": "object", "description": "The person that committed the file. Default: the authenticated user.", "properties": { "name": { "type": "string", "description": "The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted." }, "email": { "type": "string", "description": "The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted." }, "date": { "type": "string", "example": "\"2013-01-05T13:13:22+05:00\"" } }, "required": [ "name", "email" ] }, "author": { "type": "object", "description": "The author of the file. Default: The `committer` or the authenticated user if you omit `committer`.", "properties": { "name": { "type": "string", "description": "The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted." }, "email": { "type": "string", "description": "The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted." }, "date": { "type": "string", "example": "\"2013-01-15T17:13:22+05:00\"" } }, "required": [ "name", "email" ] } }, "required": [ "message", "content" ] }, "examples": { "example-for-creating-a-file": { "summary": "Example for creating a file", "value": { "message": "my commit message", "committer": { "name": "Monalisa Octocat", "email": "octocat@github.com" }, "content": "bXkgbmV3IGZpbGUgY29udGVudHM=" } }, "example-for-updating-a-file": { "summary": "Example for updating a file", "value": { "message": "a new commit message", "committer": { "name": "Monalisa Octocat", "email": "octocat@github.com" }, "content": "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz", "sha": "95b966ae1c166bd92f8ae7d1c313e738c731dfc3" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/file-commit" }, "examples": { "example-for-updating-a-file": { "$ref": "#/components/examples/file-commit-example-for-updating-a-file" } } } } }, "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/file-commit" }, "examples": { "example-for-creating-a-file": { "$ref": "#/components/examples/file-commit-example-for-creating-a-file" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" }, "409": { "$ref": "#/components/responses/conflict" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "contents" } }, "delete": { "summary": "Delete a file", "description": "Deletes a file in a repository.\n\nYou can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.\n\nThe `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.\n\nYou must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.", "tags": [ "repos" ], "operationId": "repos/delete-file", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#delete-a-file" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "path", "description": "path parameter", "in": "path", "required": true, "schema": { "type": "string" }, "x-multi-segment": true } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The commit message." }, "sha": { "type": "string", "description": "The blob SHA of the file being replaced." }, "branch": { "type": "string", "description": "The branch name. Default: the repository’s default branch (usually `master`)" }, "committer": { "type": "object", "description": "object containing information about the committer.", "properties": { "name": { "type": "string", "description": "The name of the author (or committer) of the commit" }, "email": { "type": "string", "description": "The email of the author (or committer) of the commit" } } }, "author": { "type": "object", "description": "object containing information about the author.", "properties": { "name": { "type": "string", "description": "The name of the author (or committer) of the commit" }, "email": { "type": "string", "description": "The email of the author (or committer) of the commit" } } } }, "required": [ "message", "sha" ] }, "examples": { "default": { "value": { "message": "my commit message", "committer": { "name": "Monalisa Octocat", "email": "octocat@github.com" }, "sha": "329688480d39049927147c162b9d2deaf885005f" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/file-commit" }, "examples": { "default": { "$ref": "#/components/examples/file-commit" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" }, "409": { "$ref": "#/components/responses/conflict" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "contents" } } }, "/repos/{owner}/{repo}/contributors": { "get": { "summary": "List repository contributors", "description": "Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance.\n\nGitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information.", "tags": [ "repos" ], "operationId": "repos/list-contributors", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-repository-contributors" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "anon", "description": "Set to `1` or `true` to include anonymous contributors in results.", "in": "query", "required": false, "schema": { "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "if repository contains content", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/contributor" } }, "examples": { "response-if-repository-contains-content": { "$ref": "#/components/examples/contributor-items-response-if-repository-contains-content" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "204": { "description": "Response if repository is empty" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": null } } }, "/repos/{owner}/{repo}/deployments": { "get": { "summary": "List deployments", "description": "Simple filtering of deployments is available via query parameters:", "tags": [ "repos" ], "operationId": "repos/list-deployments", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/enterprise-server@3.1/rest/reference/repos#list-deployments" }, "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "name": "sha", "description": "The SHA recorded at creation time.", "in": "query", "required": false, "schema": { "type": "string", "default": "none" } }, { "name": "ref", "description": "The name of the ref. This can be a branch, tag, or SHA.", "in": "query", "required": false, "schema": { "type": "string", "default": "none" } }, { "name": "task", "description": "The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`).", "in": "query", "required": false, "schema": { "type": "string", "default": "none" } }, { "name": "environment", "description": "The name of the environment that was deployed to (e.g., `staging` or `production`).", "in": "query", "required": false, "schema": { "type": "string", "default": "none", "nullable": true } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/deployment" } }, "examples": { "default": { "$ref": "#/components/examples/deployment-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "repos", "subcategory": "deployments", "previews": [ { "required": false, "name": "ant-man", "note": "The `inactive` state and the `log_url`, `environment_url`, and `auto_inactive` parameters are currently available for developers to preview. Please see the [blog post](https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements) for full details.\n\nTo access the API during the preview period, you must provide a custom [media type](https://docs.github.com/enterprise-server@3.1/rest/overview/media-types) in the `Accept` header:\n```shell\napplication/vnd.github.ant-man-preview+json\n```" } ] } }, "post": { "summary": "Create a deployment", "description": "Deployments offer a few configurable parameters with certain defaults.\n\nThe `ref` parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify them\nbefore we merge a pull request.\n\nThe `environment` parameter allows deployments to be issued to different runtime environments. Teams often have\nmultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter\nmakes it easier to track which environments have requested deployments. The default environment is `production`.\n\nThe `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If\nthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,\nthe API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will\nreturn a failure response.\n\nBy default, [commit statuses](https://docs.github.com/enterprise-server@3.1/rest/commits/statuses) for every submitted context must be in a `success`\nstate. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to\nspecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do\nnot require any contexts or create any commit statuses, the deployment will always succeed.\n\nThe `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text\nfield that will be passed on when a deployment event is dispatched.\n\nThe `task` parameter is used by the deployment system to allow different execution paths. In the web world this might\nbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an\napplication with debugging enabled.\n\nUsers with `repo` or `repo_deployment` scopes can create a deployment for a given ref.\n\n#### Merged branch response\nYou will see this response when GitHub automatically merges the base branch into the topic branch instead of creating\na deployment. This auto-merge happens when:\n* Auto-merge option is enabled in the repository\n* Topic branch does not include the latest changes on the base branch, which is `master` in the response example\n* There are no merge conflicts\n\nIf there are no new commits in the base branch, a new request to create a deployment should give a successful\nresponse.\n\n#### Merge conflict response\nThis error happens when the `auto_merge` option is enabled and when the defaul