--- 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 x-github-plan: api.github.com 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: emojis description: List emojis available to use on GitHub. - 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: issues description: Interact with GitHub Issues. - name: licenses description: View various OSS licenses. - name: markdown description: Render GitHub flavored markdown - name: merge-queue description: Interact with GitHub Merge Queues. - name: meta description: Endpoints that give information about the API. - name: migrations description: Move projects to or from GitHub. - 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: search description: Look for stuff on GitHub. - name: secret-scanning description: Retrieve secret scanning alerts from a repository. - name: teams description: Interact with GitHub Teams. - name: users description: Interact with and view information about users and also current user. - name: codespaces description: Endpoints to manage Codespaces using the REST API. - name: copilot description: Endpoints to manage Copilot using the REST API. - name: security-advisories description: Manage security advisories. - name: interactions description: Owner or admin management of users interactions. - name: classroom description: Interact with GitHub Classroom. servers: - url: https://api.github.com externalDocs: description: GitHub v3 REST API url: https://docs.github.com/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 subcategory: meta externalDocs: description: API method documentation url: https://docs.github.com/rest/meta/meta#github-api-root "/advisories": get: summary: List global security advisories description: |- Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware. By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." tags: - security-advisories operationId: security-advisories/list-global-advisories externalDocs: description: API method documentation url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories parameters: - name: ghsa_id in: query description: If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. schema: type: string - name: type in: query description: If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware. schema: type: string enum: - reviewed - malware - unreviewed default: reviewed - name: cve_id description: If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. in: query schema: type: string - name: ecosystem in: query description: If specified, only advisories for these ecosystems will be returned. schema: type: string enum: - actions - composer - erlang - go - maven - npm - nuget - other - pip - pub - rubygems - rust - name: severity in: query description: If specified, only advisories with these severities will be returned. schema: type: string enum: - unknown - low - medium - high - critical - name: cwes in: query description: |- If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned. Example: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22` schema: oneOf: - type: string - type: array items: type: string - name: is_withdrawn in: query description: Whether to only return advisories that have been withdrawn. schema: type: boolean - name: affects in: query description: |- If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified. If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` schema: oneOf: - type: string - type: array maxItems: 1000 items: type: string - name: published in: query description: |- If specified, only return advisories that were published on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." schema: type: string - name: updated in: query description: |- If specified, only return advisories that were updated on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." schema: type: string - name: modified description: |- If specified, only show advisories that were updated or published on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." in: query schema: type: string - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - "$ref": "#/components/parameters/direction" - name: per_page description: The number of results per page (max 100). in: query schema: type: integer minimum: 1 maximum: 100 default: 30 - name: sort description: The property to sort the results by. in: query required: false schema: type: string enum: - updated - published default: published responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/global-advisory" examples: default: "$ref": "#/components/examples/global-advisory-items" '429': description: Too many requests content: application/json: schema: "$ref": "#/components/schemas/basic-error" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: security-advisories subcategory: global-advisories "/advisories/{ghsa_id}": get: summary: Get a global security advisory description: Gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. tags: - security-advisories operationId: security-advisories/get-global-advisory externalDocs: description: API method documentation url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory parameters: - "$ref": "#/components/parameters/ghsa_id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/global-advisory" examples: default: "$ref": "#/components/examples/global-advisory" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: security-advisories subcategory: global-advisories "/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/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps "/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/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/rest/apps/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: apps "/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)." You must use a [JWT](https://docs.github.com/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/rest/apps/webhooks#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)." You must use a [JWT](https://docs.github.com/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/rest/apps/webhooks#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/hook/deliveries": get: summary: List deliveries for an app webhook description: |- Returns a list of webhook deliveries for the webhook configured for a GitHub App. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. tags: - apps operationId: apps/list-webhook-deliveries externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/cursor" - name: redelivery in: query required: false schema: type: boolean responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/hook-delivery-item" examples: default: "$ref": "#/components/examples/hook-delivery-items" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: webhooks "/app/hook/deliveries/{delivery_id}": get: summary: Get a delivery for an app webhook description: |- Returns a delivery for the webhook configured for a GitHub App. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. tags: - apps operationId: apps/get-webhook-delivery externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook parameters: - "$ref": "#/components/parameters/delivery-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/hook-delivery" examples: default: "$ref": "#/components/examples/hook-delivery" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: webhooks "/app/hook/deliveries/{delivery_id}/attempts": post: summary: Redeliver a delivery for an app webhook description: |- Redeliver a delivery for the webhook configured for a GitHub App. You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. tags: - apps operationId: apps/redeliver-webhook-delivery externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook parameters: - "$ref": "#/components/parameters/delivery-id" responses: '202': "$ref": "#/components/responses/accepted" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: webhooks "/app/installation-requests": get: summary: List installation requests for the authenticated app description: Lists all the pending installation requests for the authenticated GitHub App. tags: - apps operationId: apps/list-installation-requests-for-authenticated-app externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: List of integration installation requests content: application/json: schema: type: array items: "$ref": "#/components/schemas/integration-installation-request" examples: exampleKey1: "$ref": "#/components/examples/integration-installation-request-paginated" '304': "$ref": "#/components/responses/not_modified" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: true category: apps subcategory: apps "/app/installations": get: summary: List installations for the authenticated app description: |- You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. The 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/rest/apps/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: apps "/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. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps 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/rest/apps/apps#suspend-an-app-installation)" endpoint. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps "/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. You must use a [JWT](https://docs.github.com/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/rest/apps/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: repository: 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: apps "/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 API or webhook events is blocked for that account. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps delete: summary: Unsuspend an app installation description: |- Removes a GitHub App installation suspension. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps "/applications/{client_id}/grant": delete: summary: Delete an app authorization description: |- OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must use [Basic Authentication](https://docs.github.com/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. Deleting an 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/rest/apps/oauth-applications#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}/token": post: summary: Check a token description: OAuth applications and GitHub applications with OAuth authorizations can use this 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/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the 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/rest/apps/oauth-applications#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 or GitHub 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 and GitHub applications with OAuth authorizations 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/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the 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/rest/apps/oauth-applications#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 or GitHub 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 or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the 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/rest/apps/oauth-applications#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 access token to create a repository scoped and/or permission scoped user 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/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the `client_id` and `client_secret` of the GitHub App 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/rest/apps/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 access token used to authenticate to the GitHub API. example: e72e16c7e42f292c6912e7710c838347ae178b4a target: description: The name of the user or organization to scope the user 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 access token to. **Required** unless `target` is specified. example: 1 type: integer repositories: description: The list of repository names to scope the user 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 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: apps "/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`). If 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/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/rest/apps/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: apps "/assignments/{assignment_id}": get: summary: Get an assignment description: Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. tags: - classroom operationId: classroom/get-an-assignment externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#get-an-assignment parameters: - "$ref": "#/components/parameters/assignment-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/classroom-assignment" examples: default: "$ref": "#/components/examples/classroom-assignment" '404': "$ref": "#/components/responses/not_found" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/assignments/{assignment_id}/accepted_assignments": get: summary: List accepted assignments for an assignment description: Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. tags: - classroom operationId: classroom/list-accepted-assigments-for-an-assignment externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment parameters: - "$ref": "#/components/parameters/assignment-id" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/classroom-accepted-assignment" examples: default: "$ref": "#/components/examples/classroom-accepted-assignment" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/assignments/{assignment_id}/grades": get: summary: Get assignment grades description: Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment. tags: - classroom operationId: classroom/get-assignment-grades externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#get-assignment-grades parameters: - "$ref": "#/components/parameters/assignment-id" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/classroom-assignment-grade" examples: default: "$ref": "#/components/examples/classroom-assignment-grades" '404': "$ref": "#/components/responses/not_found" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/classrooms": get: summary: List classrooms description: Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. tags: - classroom operationId: classroom/list-classrooms externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#list-classrooms parameters: - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/simple-classroom" examples: default: "$ref": "#/components/examples/simple-classroom" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/classrooms/{classroom_id}": get: summary: Get a classroom description: Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom. tags: - classroom operationId: classroom/get-a-classroom externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#get-a-classroom parameters: - "$ref": "#/components/parameters/classroom-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/classroom" examples: default: "$ref": "#/components/examples/classroom" '404': "$ref": "#/components/responses/not_found" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/classrooms/{classroom_id}/assignments": get: summary: List assignments for a classroom description: Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom. tags: - classroom operationId: classroom/list-assignments-for-a-classroom externalDocs: description: API method documentation url: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom parameters: - "$ref": "#/components/parameters/classroom-id" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/simple-classroom-assignment" examples: default: "$ref": "#/components/examples/simple-classroom-assignment" x-github: enabledForGitHubApps: true category: classroom subcategory: classroom "/codes_of_conduct": get: summary: Get all codes of conduct description: Returns array of all GitHub's codes of conduct. tags: - codes-of-conduct operationId: codes-of-conduct/get-all-codes-of-conduct externalDocs: description: API method documentation url: https://docs.github.com/rest/codes-of-conduct/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: codes-of-conduct "/codes_of_conduct/{key}": get: summary: Get a code of conduct description: Returns information about the specified GitHub code of conduct. tags: - codes-of-conduct operationId: codes-of-conduct/get-conduct-code externalDocs: description: API method documentation url: https://docs.github.com/rest/codes-of-conduct/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: codes-of-conduct "/emojis": get: summary: Get emojis description: Lists all the emojis available to use on GitHub. operationId: emojis/get tags: - emojis externalDocs: description: API method documentation url: https://docs.github.com/rest/emojis/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: emojis "/enterprises/{enterprise}/dependabot/alerts": get: summary: List Dependabot alerts for an enterprise description: |- Lists Dependabot alerts for repositories that are owned by the specified enterprise. To use this endpoint, you must be a member of the enterprise, and you must use an access token with the `repo` scope or `security_events` scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." tags: - dependabot operationId: dependabot/list-alerts-for-enterprise externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise parameters: - "$ref": "#/components/parameters/enterprise" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-states" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-severities" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-ecosystems" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-packages" - "$ref": "#/components/parameters/dependabot-alert-scope" - "$ref": "#/components/parameters/dependabot-alert-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - "$ref": "#/components/parameters/pagination-first" - "$ref": "#/components/parameters/pagination-last" - "$ref": "#/components/parameters/per-page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/dependabot-alert-with-repository" examples: default: "$ref": "#/components/examples/dependabot-alerts-for-organization" '304': "$ref": "#/components/responses/not_modified" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: false previews: [] category: dependabot subcategory: alerts "/enterprises/{enterprise}/secret-scanning/alerts": get: summary: List secret scanning alerts for an enterprise description: |- Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest. To use this endpoint, you must be a member of the enterprise, and you must use an access token with the `repo` scope or `security_events` scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a [security manager](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization). tags: - secret-scanning operationId: secret-scanning/list-alerts-for-enterprise externalDocs: description: API method documentation url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise parameters: - "$ref": "#/components/parameters/enterprise" - "$ref": "#/components/parameters/secret-scanning-alert-state" - "$ref": "#/components/parameters/secret-scanning-alert-secret-type" - "$ref": "#/components/parameters/secret-scanning-alert-resolution" - "$ref": "#/components/parameters/secret-scanning-alert-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/organization-secret-scanning-alert" examples: default: "$ref": "#/components/examples/organization-secret-scanning-alert-list" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: false category: secret-scanning subcategory: secret-scanning "/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/rest/activity/events#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 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: * **Timeline**: The GitHub global public timeline * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * **Current user public**: The public timeline for the authenticated user * **Current user**: The private timeline for the authenticated user * **Current user actor**: The private timeline for activity created by the authenticated user * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/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/rest/activity/feeds#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/rest/gists/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: gists post: summary: Create a gist description: |- Allows you to add a new gist with one or more files. **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/rest/gists/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: gists "/gists/public": get: summary: List public gists description: |- List public gists sorted by most recently updated to least recently updated. Note: With [pagination](https://docs.github.com/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/rest/gists/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: gists "/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/rest/gists/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: gists "/gists/{gist_id}": get: summary: Get a gist description: '' tags: - gists operationId: gists/get externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/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: gists patch: summary: Update a gist description: |- Allows you to update a gist's description and to update, delete, or rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. At least one of `description` or `files` is required. tags: - gists operationId: gists/update externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/gists#update-a-gist parameters: - "$ref": "#/components/parameters/gist-id" requestBody: required: true content: application/json: schema: properties: description: description: The description of the gist. example: Example Ruby script type: string files: description: |- The gist files to be updated, renamed, or deleted. Each `key` must match the current filename (including extension) of the targeted gist file. For example: `hello.py`. To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also be deleted if the specified object does not contain at least one of `content` or `filename`. 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 type: object nullable: true examples: updateGist: summary: Updating a gist value: description: An updated gist description files: README.md: content: Hello World from GitHub deleteFile: summary: Deleting a gist file value: files: hello.py: renameFile: summary: Renaming a gist file value: files: hello.py: filename: goodbye.py responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/gist-simple" examples: updateGist: "$ref": "#/components/examples/gist" deleteFile: "$ref": "#/components/examples/delete-gist-file" renameFile: "$ref": "#/components/examples/rename-gist-file" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: gists subcategory: gists delete: summary: Delete a gist description: '' tags: - gists operationId: gists/delete externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/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: gists "/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/rest/gists/comments#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/rest/gists/comments#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/rest/gists/comments#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/rest/gists/comments#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/rest/gists/comments#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/rest/gists/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: gists "/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/rest/gists/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: gists post: summary: Fork a gist description: '' tags: - gists operationId: gists/fork externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/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: gists "/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/rest/gists/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: gists 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/rest/overview/resources-in-the-rest-api#http-verbs)." tags: - gists operationId: gists/star externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/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: gists delete: summary: Unstar a gist description: '' tags: - gists operationId: gists/unstar externalDocs: description: API method documentation url: https://docs.github.com/rest/gists/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: gists "/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/rest/gists/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: gists "/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/rest/repos/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/rest/gitignore/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: gitignore "/gitignore/templates/{name}": get: summary: Get a gitignore template description: |- The API also allows fetching the source of a single template. Use the raw [media type](https://docs.github.com/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/rest/gitignore/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: gitignore "/installation/repositories": get: summary: List repositories accessible to the app installation description: |- List repositories that an app installation can access. You must use an [installation access token](https://docs.github.com/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/rest/apps/installations#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 "/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. Once 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/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint. You must use an [installation access token](https://docs.github.com/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/rest/apps/installations#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 repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not necessarily assigned to you. **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `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 request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. tags: - issues operationId: issues/list externalDocs: description: API method documentation url: https://docs.github.com/rest/issues/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. 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. 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 subcategory: issues "/licenses": get: summary: Get all commonly used licenses description: Lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." tags: - licenses operationId: licenses/get-all-commonly-used externalDocs: description: API method documentation url: https://docs.github.com/rest/licenses/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: licenses "/licenses/{license}": get: summary: Get a license description: Gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." tags: - licenses operationId: licenses/get externalDocs: description: API method documentation url: https://docs.github.com/rest/licenses/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: licenses "/markdown": post: summary: Render a Markdown document description: '' operationId: markdown/render tags: - markdown externalDocs: description: API method documentation url: https://docs.github.com/rest/markdown/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. 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 examples: default: summary: Rendering markdown value: text: Hello **world** 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 examples: default: summary: Example response value: "

Hello world

" '304': "$ref": "#/components/responses/not_modified" x-github: githubCloudOnly: false enabledForGitHubApps: true category: markdown subcategory: markdown "/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/rest/markdown/markdown#render-a-markdown-document-in-raw-mode parameters: [] requestBody: required: false content: text/plain: schema: type: string examples: default: value: text: Hello **world** text/x-markdown: schema: type: string examples: default: summary: Rendering markdown value: text: Hello **world** responses: '200': description: Response headers: X-CommonMarker-Version: "$ref": "#/components/headers/x-common-marker-version" content: text/html: schema: type: string examples: default: summary: Example response value: "

Hello world

" '304': "$ref": "#/components/responses/not_modified" x-github: githubCloudOnly: false enabledForGitHubApps: true category: markdown subcategory: markdown "/marketplace_listing/accounts/{account_id}": get: summary: Get a subscription plan for an account description: |- Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/get-subscription-plan-for-account externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account parameters: - "$ref": "#/components/parameters/account-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/marketplace-purchase" examples: default: "$ref": "#/components/examples/marketplace-purchase" '404': description: Not Found when the account has not purchased the listing content: application/json: schema: "$ref": "#/components/schemas/basic-error" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/marketplace_listing/plans": get: summary: List plans description: |- Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/list-plans externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#list-plans parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/marketplace-listing-plan" examples: default: "$ref": "#/components/examples/marketplace-listing-plan-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/marketplace_listing/plans/{plan_id}/accounts": get: summary: List accounts for a plan description: |- Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/list-accounts-for-plan externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan parameters: - "$ref": "#/components/parameters/plan-id" - "$ref": "#/components/parameters/sort" - name: direction description: To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter. 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/marketplace-purchase" examples: default: "$ref": "#/components/examples/marketplace-purchase-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/marketplace_listing/stubbed/accounts/{account_id}": get: summary: Get a subscription plan for an account (stubbed) description: |- Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/get-subscription-plan-for-account-stubbed externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed parameters: - "$ref": "#/components/parameters/account-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/marketplace-purchase" examples: default: "$ref": "#/components/examples/marketplace-purchase" '404': description: Not Found when the account has not purchased the listing '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/marketplace_listing/stubbed/plans": get: summary: List plans (stubbed) description: |- Lists all plans that are part of your GitHub Marketplace listing. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/list-plans-stubbed externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/marketplace-listing-plan" examples: default: "$ref": "#/components/examples/marketplace-listing-plan-items" headers: Link: "$ref": "#/components/headers/link" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/marketplace_listing/stubbed/plans/{plan_id}/accounts": get: summary: List accounts for a plan (stubbed) description: |- Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. tags: - apps operationId: apps/list-accounts-for-plan-stubbed externalDocs: description: API method documentation url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed parameters: - "$ref": "#/components/parameters/plan-id" - "$ref": "#/components/parameters/sort" - name: direction description: To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter. 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/marketplace-purchase" examples: default: "$ref": "#/components/examples/marketplace-purchase-items" headers: Link: "$ref": "#/components/headers/link" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: apps subcategory: marketplace "/meta": get: summary: Get GitHub meta information description: |- Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)." The API's response also includes a list of GitHub's domain names. The values shown in the documentation's response are example values. You must always query the API directly to get the latest values. **Note:** This endpoint returns both IPv4 and IPv6 addresses. However, not all features support IPv6. You should refer to the specific documentation for each feature to determine if IPv6 is supported. tags: - meta operationId: meta/get externalDocs: description: API method documentation url: https://docs.github.com/rest/meta/meta#get-apiname-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: meta "/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/rest/activity/events#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/rest/activity/notifications#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/page" - name: per_page description: The number of results per page (max 50). in: query schema: type: integer default: 50 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" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub 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/rest/activity/notifications#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/rest/activity/notifications#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: Gets information about a notification thread. tags: - activity operationId: activity/get-thread externalDocs: description: API method documentation url: https://docs.github.com/rest/activity/notifications#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: 'Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.' tags: - activity operationId: activity/mark-thread-as-read externalDocs: description: API method documentation url: https://docs.github.com/rest/activity/notifications#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/rest/activity/watching#get-a-repository-subscription). Note 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/rest/activity/notifications#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**. You 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. Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint. tags: - activity operationId: activity/set-thread-subscription externalDocs: description: API method documentation url: https://docs.github.com/rest/activity/notifications#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/rest/activity/notifications#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/rest/activity/notifications#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/rest/meta/meta#get-octocat x-github: githubCloudOnly: false enabledForGitHubApps: true category: meta subcategory: meta "/organizations": get: summary: List organizations description: |- Lists all organizations, in the order that they were created on GitHub. **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) 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/rest/orgs/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: orgs "/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/). GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." tags: - orgs operationId: orgs/get externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/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" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: orgs patch: summary: Update an organization description: |- **Parameter Deprecation Notice:** GitHub 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). Enables an authenticated organization owner with the `admin:org` scope or the `repo` 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/rest/orgs/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. `private` is only available to repositories that are part of an organization on GitHub Enterprise Cloud. \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 members_can_create_public_pages: type: boolean description: Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted. default: true members_can_create_private_pages: type: boolean description: Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted. default: true members_can_fork_private_repositories: type: boolean description: Whether organization members can fork private organization repositories. default: false web_commit_signoff_required: type: boolean description: Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. default: false blog: type: string example: '"http://github.blog"' advanced_security_enabled_for_new_repositories: type: boolean description: |- Whether GitHub Advanced Security is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. dependabot_alerts_enabled_for_new_repositories: type: boolean description: |- Whether Dependabot alerts is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. dependabot_security_updates_enabled_for_new_repositories: type: boolean description: |- Whether Dependabot security updates is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. dependency_graph_enabled_for_new_repositories: type: boolean description: |- Whether dependency graph is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. secret_scanning_enabled_for_new_repositories: type: boolean description: |- Whether secret scanning is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. secret_scanning_push_protection_enabled_for_new_repositories: type: boolean description: |- Whether secret scanning push protection is automatically enabled for new repositories. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. secret_scanning_push_protection_custom_link_enabled: type: boolean description: Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. secret_scanning_push_protection_custom_link: type: string description: If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. 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 subcategory: orgs delete: summary: Delete an organization description: |- Deletes an organization and all its repositories. The organization login will be unavailable for 90 days after deletion. Please review the Terms of Service regarding account deletion before using this endpoint: https://docs.github.com/site-policy/github-terms/github-terms-of-service operationId: orgs/delete tags: - orgs externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/orgs#delete-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '202': "$ref": "#/components/responses/accepted" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: orgs "/orgs/{org}/actions/cache/usage": get: summary: Get GitHub Actions cache usage for an organization description: |- Gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. You must authenticate using an access token with the `read:org` scope to use this endpoint. GitHub Apps must have the `organization_admistration:read` permission to use this endpoint. tags: - actions operationId: actions/get-actions-cache-usage-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-cache-usage-org-enterprise" examples: default: "$ref": "#/components/examples/actions-cache-usage-org-enterprise" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: cache "/orgs/{org}/actions/cache/usage-by-repository": get: summary: List repositories with GitHub Actions cache usage for an organization description: |- Lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. You must authenticate using an access token with the `read:org` scope to use this endpoint. GitHub Apps must have the `organization_admistration:read` permission to use this endpoint. tags: - actions operationId: actions/get-actions-cache-usage-by-repo-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-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 - repository_cache_usages properties: total_count: type: integer repository_cache_usages: type: array items: "$ref": "#/components/schemas/actions-cache-usage-by-repository" examples: default: "$ref": "#/components/examples/org-actions-cache-usage-by-repo" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: cache "/orgs/{org}/actions/oidc/customization/sub": get: summary: Get the customization template for an OIDC subject claim for an organization description: |- Gets the customization template for an OpenID Connect (OIDC) subject claim. You must authenticate using an access token with the `read:org` scope to use this endpoint. GitHub Apps must have the `organization_administration:write` permission to use this endpoint. tags: - oidc operationId: oidc/get-oidc-custom-sub-template-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: A JSON serialized template for OIDC subject claim customization content: application/json: schema: "$ref": "#/components/schemas/oidc-custom-sub" examples: default: "$ref": "#/components/examples/oidc-custom-sub" x-github: enabledForGitHubApps: true category: actions subcategory: oidc put: summary: Set the customization template for an OIDC subject claim for an organization description: |- Creates or updates the customization template for an OpenID Connect (OIDC) subject claim. You must authenticate using an access token with the `write:org` scope to use this endpoint. GitHub Apps must have the `admin:org` permission to use this endpoint. tags: - oidc operationId: oidc/update-oidc-custom-sub-template-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/oidc-custom-sub" examples: default: "$ref": "#/components/examples/oidc-custom-sub" responses: '201': description: Empty response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" x-github: enabledForGitHubApps: true previews: [] category: actions subcategory: oidc "/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 and reusable workflows in an organization. You 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/rest/actions/permissions#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 and reusable workflows in an organization. You 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/rest/actions/permissions#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)." You 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/rest/actions/permissions#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)." You 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/rest/actions/permissions#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)." You 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/rest/actions/permissions#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)." You 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/rest/actions/permissions#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 and reusable workflows for an organization description: |- Gets the selected actions and reusable workflows 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)."" You 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/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-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 and reusable workflows for an organization description: |- Sets the actions and reusable workflows 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)." You 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/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-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/permissions/workflow": get: summary: Get default workflow permissions for an organization description: |- Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, as well as whether GitHub Actions can submit approving pull request reviews. For more information, see "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." You 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. tags: - actions operationId: actions/get-github-actions-default-workflow-permissions-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-get-default-workflow-permissions" examples: default: "$ref": "#/components/examples/actions-default-workflow-permissions" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: permissions put: summary: Set default workflow permissions for an organization description: |- Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions can submit approving pull request reviews. For more information, see "[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)." You 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. tags: - actions operationId: actions/set-github-actions-default-workflow-permissions-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '204': description: Success response requestBody: required: false content: application/json: schema: "$ref": "#/components/schemas/actions-set-default-workflow-permissions" examples: default: "$ref": "#/components/examples/actions-default-workflow-permissions" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: permissions "/orgs/{org}/actions/runners": get: summary: List self-hosted runners for an organization description: |- Lists all self-hosted runners configured in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-self-hosted-runners-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization parameters: - name: name description: The name of a self-hosted runner. in: query schema: type: string - "$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. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-runner-applications-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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/generate-jitconfig": post: summary: Create configuration for a just-in-time runner for an organization description: |- Generates a configuration that can be passed to the runner application at startup. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/generate-runner-jitconfig-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object required: - name - runner_group_id - labels properties: name: type: string description: The name of the new runner. runner_group_id: type: integer description: The ID of the runner group to register the runner to. labels: type: array minItems: 1 maxItems: 100 items: type: string description: 'The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100.' work_folder: type: string description: The working directory to be used for job execution, relative to the runner install directory. default: _work examples: default: value: name: New runner runner_group_id: 1 labels: - self-hosted - X64 - macOS - no-gpu work_folder: _work responses: '201': "$ref": "#/components/responses/actions_runner_jitconfig" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" 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.\nIf the repository is private, you must use an access token with the `repo` scope.\nGitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations.\nAuthenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints.\n\nExample 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/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. Example using remove token: To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this endpoint. ``` ./config.sh remove --token TOKEN ``` tags: - actions operationId: actions/create-remove-token-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/get-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/delete-self-hosted-runner-from-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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/runners/{runner_id}/labels": get: summary: List labels for a self-hosted runner for an organization description: |- Lists all labels for a self-hosted runner configured in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-labels-for-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/runner-id" responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners post: summary: Add custom labels to a self-hosted runner for an organization description: |- Add custom labels to a self-hosted runner configured in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/add-custom-labels-to-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/runner-id" requestBody: required: true content: application/json: schema: type: object required: - labels properties: labels: type: array minItems: 1 maxItems: 100 description: The names of the custom labels to add to the runner. items: type: string examples: default: value: labels: - gpu - accelerated responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners put: summary: Set custom labels for a self-hosted runner for an organization description: |- Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/set-custom-labels-for-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/runner-id" requestBody: required: true content: application/json: schema: type: object required: - labels properties: labels: type: array minItems: 0 maxItems: 100 description: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. items: type: string examples: default: value: labels: - gpu - accelerated responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners delete: summary: Remove all custom labels from a self-hosted runner for an organization description: |- Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/remove-all-custom-labels-from-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/runner-id" responses: '200': "$ref": "#/components/responses/actions_runner_labels_readonly" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners "/orgs/{org}/actions/runners/{runner_id}/labels/{name}": delete: summary: Remove a custom label from a self-hosted runner for an organization description: |- Remove a custom label from a self-hosted runner configured in an organization. Returns the remaining labels from the runner. This endpoint returns a `404 Not Found` status if the custom label is not present on the runner. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/remove-custom-label-from-self-hosted-runner-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/runner-id" - "$ref": "#/components/parameters/runner-label-name" responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" 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. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/list-org-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/get-org-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/get-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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 [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/create-or-update-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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/rest/actions/secrets#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/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#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: '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. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/delete-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/list-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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/rest/actions/secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/set-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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 [Add selected repository to an organization secret](https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/actions/secrets#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/rest/actions/secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/add-selected-repo-to-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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/rest/actions/secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/remove-selected-repo-from-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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}/actions/variables": get: summary: List organization variables description: |- Lists all organization variables. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/list-org-variables externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#list-organization-variables parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variables-per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - variables properties: total_count: type: integer variables: type: array items: "$ref": "#/components/schemas/organization-actions-variable" examples: default: "$ref": "#/components/examples/organization-actions-variables-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables post: summary: Create an organization variable description: |- Creates an organization variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/create-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#create-an-organization-variable parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: The name of the variable. value: type: string description: The value of the variable. visibility: type: string description: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. enum: - all - private - selected selected_repository_ids: type: array description: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. items: type: integer required: - name - value - visibility examples: default: value: name: USERNAME value: octocat visibility: selected selected_repository_ids: - 1296269 - 1296280 responses: '201': description: Response when creating a variable content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/orgs/{org}/actions/variables/{name}": get: summary: Get an organization variable description: |- Gets a specific variable in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/get-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#get-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/organization-actions-variable" examples: default: "$ref": "#/components/examples/organization-actions-variable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables patch: summary: Update an organization variable description: |- Updates an organization variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/update-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#update-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: The name of the variable. value: type: string description: The value of the variable. visibility: type: string description: The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. enum: - all - private - selected selected_repository_ids: type: array description: An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. items: type: integer examples: default: value: name: USERNAME value: octocat visibility: selected selected_repository_ids: - 1296269 - 1296280 responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables delete: summary: Delete an organization variable description: |- Deletes an organization variable using the variable name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/delete-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/orgs/{org}/actions/variables/{name}/repositories": get: summary: List selected repositories for an organization variable description: |- Lists all repositories that can access an organization variable that is available to selected repositories. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/list-selected-repos-for-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-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" '409': description: Response when the visibility of the variable is not set to `selected` x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables put: summary: Set selected repositories for an organization variable description: |- Replaces all repositories for an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/set-selected-repos-for-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" requestBody: required: true content: application/json: schema: type: object properties: selected_repository_ids: type: array description: The IDs of the repositories that can access the organization variable. items: type: integer required: - selected_repository_ids examples: default: value: selected_repository_ids: - 64780797 responses: '204': description: Response '409': description: Response when the visibility of the variable is not set to `selected` x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}": put: summary: Add selected repository to an organization variable description: |- Adds a repository to an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/add-selected-repo-to-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" - name: repository_id in: path required: true schema: type: integer responses: '204': description: Response '409': description: Response when the visibility of the variable is not set to `selected` x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables delete: summary: Remove selected repository from an organization variable description: |- Removes a repository from an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/remove-selected-repo-from-org-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/variable-name" - name: repository_id in: path required: true schema: type: integer responses: '204': description: Response '409': description: Response when the visibility of the variable is not set to `selected` x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/orgs/{org}/blocks": get: summary: List users blocked by an organization description: List the users blocked by an organization. tags: - orgs operationId: orgs/list-blocked-users externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-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: array items: "$ref": "#/components/schemas/simple-user" examples: default: "$ref": "#/components/examples/simple-user-items" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: blocking "/orgs/{org}/blocks/{username}": get: summary: Check if a user is blocked by an organization description: Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub. tags: - orgs operationId: orgs/check-blocked-user externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" responses: '204': description: If the user is blocked '404': description: If the user is not blocked content: application/json: schema: "$ref": "#/components/schemas/basic-error" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: blocking put: summary: Block a user from an organization description: Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned. tags: - orgs operationId: orgs/block-user externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" responses: '204': description: Response '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: blocking delete: summary: Unblock a user from an organization description: Unblocks the given user on behalf of the specified organization. tags: - orgs operationId: orgs/unblock-user externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: blocking "/orgs/{org}/code-scanning/alerts": get: summary: List code scanning alerts for an organization description: |- Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." To use this endpoint, you must be an owner or security manager for the organization, and you must use an access token with the `repo` scope or `security_events` scope. For public repositories, you may instead use the `public_repo` scope. GitHub Apps must have the `security_events` read permission to use this endpoint. tags: - code-scanning operationId: code-scanning/list-alerts-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/tool-name" - "$ref": "#/components/parameters/tool-guid" - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/direction" - name: state description: If specified, only code scanning alerts with this state will be returned. in: query required: false schema: "$ref": "#/components/schemas/code-scanning-alert-state-query" - name: sort description: The property by which to sort the results. in: query required: false schema: type: string enum: - created - updated default: created - name: severity description: If specified, only code scanning alerts with this severity will be returned. in: query required: false schema: "$ref": "#/components/schemas/code-scanning-alert-severity" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/code-scanning-organization-alert-items" examples: default: "$ref": "#/components/examples/code-scanning-organization-alert-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: code-scanning subcategory: code-scanning "/orgs/{org}/codespaces": get: summary: List codespaces for the organization description: |- Lists the codespaces associated to a specified organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/list-in-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - codespaces properties: total_count: type: integer codespaces: type: array items: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespaces-list" '304': "$ref": "#/components/responses/not_modified" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/codespaces/access": put: summary: Manage access control for organization codespaces description: |- Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces access permissions for users according to the visibility. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/set-codespaces-access externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces parameters: - "$ref": "#/components/parameters/org" deprecated: true requestBody: required: true content: application/json: schema: type: object properties: visibility: type: string description: Which users can access codespaces in the organization. `disabled` means that no users can access codespaces in the organization. enum: - disabled - selected_members - all_members - all_members_and_outside_collaborators selected_usernames: type: array description: The usernames of the organization members who should have access to codespaces in the organization. Required when `visibility` is `selected_members`. The provided list of usernames will replace any existing value. items: type: string maxItems: 100 required: - visibility examples: default: value: visibility: selected_members selected_usernames: - johnDoe - atomIO responses: '204': description: Response when successfully modifying permissions. '304': "$ref": "#/components/responses/not_modified" '400': description: Users are neither members nor collaborators of this organization. '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '500': "$ref": "#/components/responses/internal_error" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/codespaces/access/selected_users": post: summary: Add users to Codespaces access for an organization description: |- Codespaces for the specified users will be billed to the organization. To use this endpoint, the access settings for the organization must be set to `selected_members`. For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)." You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/set-codespaces-access-users externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization parameters: - "$ref": "#/components/parameters/org" deprecated: true requestBody: required: true content: application/json: schema: type: object properties: selected_usernames: type: array description: The usernames of the organization members whose codespaces be billed to the organization. items: type: string maxItems: 100 required: - selected_usernames examples: default: value: selected_usernames: - johnDoe - atomIO responses: '204': description: Response when successfully modifying permissions. '304': "$ref": "#/components/responses/not_modified" '400': description: Users are neither members nor collaborators of this organization. '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '500': "$ref": "#/components/responses/internal_error" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations delete: summary: Remove users from Codespaces access for an organization description: |- Codespaces for the specified users will no longer be billed to the organization. To use this endpoint, the access settings for the organization must be set to `selected_members`. For information on how to change this setting, see "[Manage access control for organization codespaces](https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces)." You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/delete-codespaces-access-users externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization deprecated: true parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object properties: selected_usernames: type: array description: The usernames of the organization members whose codespaces should not be billed to the organization. items: type: string maxItems: 100 required: - selected_usernames examples: default: value: selected_usernames: - johnDoe - atomIO responses: '204': description: Response when successfully modifying permissions. '304': "$ref": "#/components/responses/not_modified" '400': description: Users are neither members nor collaborators of this organization. '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '500': "$ref": "#/components/responses/internal_error" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/codespaces/secrets": get: summary: List organization secrets description: |- Lists all Codespaces secrets available at the organization-level without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/list-org-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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/codespaces-org-secret" examples: default: "$ref": "#/components/examples/repo-codespaces-secret-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets "/orgs/{org}/codespaces/secrets/public-key": get: summary: Get an organization public key description: Gets a public key for an organization, which is required in order to encrypt secrets. You need to encrypt the value of 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. tags: - codespaces operationId: codespaces/get-org-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/codespaces-public-key" examples: default: "$ref": "#/components/examples/codespaces-public-key" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets "/orgs/{org}/codespaces/secrets/{secret_name}": get: summary: Get an organization secret description: |- Gets an organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/get-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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/codespaces-org-secret" examples: default: "$ref": "#/components/examples/repo-codespaces-secret" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets put: summary: Create or update an organization secret description: |- Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/create-or-update-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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: The 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/rest/codespaces/organization-secrets#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: The 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/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#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: '204': description: Response when updating a secret '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets delete: summary: Delete an organization secret description: Deletes an organization secret using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/delete-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/secret-name" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets "/orgs/{org}/codespaces/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. tags: - codespaces operationId: codespaces/list-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-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/rest/codespaces/organization-secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/set-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/codespaces/organization-secrets#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 '404': "$ref": "#/components/responses/not_found" '409': description: Conflict when visibility type not set to selected x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets "/orgs/{org}/codespaces/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/rest/codespaces/organization-secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/add-selected-repo-to-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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 '404': "$ref": "#/components/responses/not_found" '409': description: Conflict when visibility type is not set to selected '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-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/rest/codespaces/organization-secrets#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/remove-selected-repo-from-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organization-secrets#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 '404': "$ref": "#/components/responses/not_found" '409': description: Conflict when visibility type not set to selected '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organization-secrets "/orgs/{org}/copilot/billing": get: summary: Get Copilot for Business seat information and settings for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Gets information about an organization's Copilot for Business subscription, including seat breakdown and code matching policies. To configure these settings, go to your organization's settings on GitHub.com. For more information, see "[Configuring GitHub Copilot settings in your organization](https://docs.github.com/copilot/configuring-github-copilot/configuring-github-copilot-settings-in-your-organization)". Only organization owners and members with admin permissions can configure and view details about the organization's Copilot for Business subscription. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. tags: - copilot operationId: copilot/get-copilot-organization-details externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-information-and-settings-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: OK content: application/json: schema: "$ref": "#/components/schemas/copilot-organization-details" examples: default: "$ref": "#/components/examples/copilot-organization-details" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business "/orgs/{org}/copilot/billing/seats": get: summary: List all Copilot for Business seat assignments for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Lists all Copilot for Business seat assignments for an organization that are currently being billed (either active or pending cancellation at the start of the next billing cycle). Only organization owners and members with admin permissions can configure and view details about the organization's Copilot for Business subscription. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. tags: - copilot operationId: copilot/list-copilot-seats externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#list-all-copilot-for-business-seat-assignments-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/page" - name: per_page description: The number of results per page (max 100). in: query schema: type: integer default: 50 responses: '200': description: Response content: application/json: schema: type: object properties: total_seats: type: integer description: Total number of Copilot For Business seats for the organization currently being billed. seats: type: array items: "$ref": "#/components/schemas/copilot-seat-details" examples: default: "$ref": "#/components/examples/copilot-seats-list" headers: Link: "$ref": "#/components/headers/link" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business "/orgs/{org}/copilot/billing/selected_teams": post: summary: Add teams to the Copilot for Business subscription for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Purchases a GitHub Copilot for Business seat for all users within each specified team. The organization will be billed accordingly. For more information about Copilot for Business pricing, see "[About billing for GitHub Copilot for Business](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#pricing-for-github-copilot-for-business)". Only organization owners and members with admin permissions can configure GitHub Copilot in their organization. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. In order for an admin to use this endpoint, the organization must have a Copilot for Business subscription and a configured suggestion matching policy. For more information about setting up a Copilot for Business subscription, see "[Setting up a Copilot for Business subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise#setting-up-a-copilot-for-business-subscription-for-your-organization)". For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/configuring-github-copilot/configuring-github-copilot-settings-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". tags: - copilot operationId: copilot/add-copilot-for-business-seats-for-teams externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#add-teams-to-the-copilot-for-business-subscription-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: content: application/json: schema: type: object properties: selected_teams: type: array description: List of team names within the organization to which to grant access to GitHub Copilot. items: type: string minItems: 1 required: - selected_teams examples: default: value: selected_teams: - engteam1 - engteam2 - engteam3 required: true responses: '201': description: OK content: application/json: schema: type: object description: The total number of seat assignments created. properties: seats_created: type: integer required: - seats_created examples: default: value: seats_created: 5 '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': description: Copilot for Business is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business delete: summary: Remove teams from the Copilot for Business subscription for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Cancels the Copilot for Business seat assignment for all members of each team specified. This will cause the members of the specified team(s) to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. For more information about Copilot for Business pricing, see "[About billing for GitHub Copilot for Business](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#pricing-for-github-copilot-for-business)". For more information about disabling access to Copilot for Business, see "[Disabling access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/configuring-github-copilot/configuring-github-copilot-settings-in-your-organization#disabling-access-to-github-copilot-for-specific-users-in-your-organization)". Only organization owners and members with admin permissions can configure GitHub Copilot in their organization. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. tags: - copilot operationId: copilot/cancel-copilot-seat-assignment-for-teams externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#remove-teams-from-the-copilot-for-business-subscription-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: content: application/json: schema: type: object properties: selected_teams: type: array description: The names of teams from which to revoke access to GitHub Copilot. items: type: string minItems: 1 required: - selected_teams examples: default: value: selected_teams: - engteam1 - engteam2 - engteam3 required: true responses: '200': description: OK content: application/json: schema: type: object description: The total number of seat assignments cancelled. properties: seats_cancelled: type: integer required: - seats_cancelled examples: default: value: seats_cancelled: 5 '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': description: Copilot for Business is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business "/orgs/{org}/copilot/billing/selected_users": post: summary: Add users to the Copilot for Business subscription for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Purchases a GitHub Copilot for Business seat for each user specified. The organization will be billed accordingly. For more information about Copilot for Business pricing, see "[About billing for GitHub Copilot for Business](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#pricing-for-github-copilot-for-business)". Only organization owners and members with admin permissions can configure GitHub Copilot in their organization. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. In order for an admin to use this endpoint, the organization must have a Copilot for Business subscription and a configured suggestion matching policy. For more information about setting up a Copilot for Business subscription, see "[Setting up a Copilot for Business subscription for your organization](https://docs.github.com/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription-for-your-organization-or-enterprise#setting-up-a-copilot-for-business-subscription-for-your-organization)". For more information about setting a suggestion matching policy, see "[Configuring suggestion matching policies for GitHub Copilot in your organization](https://docs.github.com/copilot/configuring-github-copilot/configuring-github-copilot-settings-in-your-organization#configuring-suggestion-matching-policies-for-github-copilot-in-your-organization)". tags: - copilot operationId: copilot/add-copilot-for-business-seats-for-users externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#add-users-to-the-copilot-for-business-subscription-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: content: application/json: schema: type: object properties: selected_usernames: type: array description: The usernames of the organization members to be granted access to GitHub Copilot. items: type: string minItems: 1 required: - selected_usernames examples: default: value: selected_usernames: - cooluser1 - hacker2 - octocat required: true responses: '201': description: OK content: application/json: schema: type: object description: The total number of seat assignments created. properties: seats_created: type: integer required: - seats_created examples: default: value: seats_created: 5 '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': description: Copilot for Business is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, or the organization's Copilot access setting is set to enable Copilot for all users or is unconfigured. x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business delete: summary: Remove users from the Copilot for Business subscription for an organization description: |- **Note**: This endpoint is in beta and is subject to change. Cancels the Copilot for Business seat assignment for each user specified. This will cause the specified users to lose access to GitHub Copilot at the end of the current billing cycle, and the organization will not be billed further for those users. For more information about Copilot for Business pricing, see "[About billing for GitHub Copilot for Business](https://docs.github.com/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#pricing-for-github-copilot-for-business)" For more information about disabling access to Copilot for Business, see "[Disabling access to GitHub Copilot for specific users in your organization](https://docs.github.com/copilot/configuring-github-copilot/configuring-github-copilot-settings-in-your-organization#disabling-access-to-github-copilot-for-specific-users-in-your-organization)". Only organization owners and members with admin permissions can configure GitHub Copilot in their organization. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. tags: - copilot operationId: copilot/cancel-copilot-seat-assignment-for-users externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#remove-users-from-the-copilot-for-business-subscription-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: content: application/json: schema: type: object properties: selected_usernames: type: array description: The usernames of the organization members for which to revoke access to GitHub Copilot. items: type: string minItems: 1 required: - selected_usernames examples: default: value: selected_usernames: - cooluser1 - hacker2 - octocat required: true responses: '200': description: OK content: application/json: schema: type: object description: The total number of seat assignments cancelled. properties: seats_cancelled: type: integer required: - seats_cancelled examples: default: value: seats_cancelled: 5 '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': description: Copilot for Business is not enabled for this organization, billing has not been set up for this organization, a public code suggestions policy has not been set for this organization, the seat management setting is set to enable Copilot for all users or is unconfigured, or a user's seat cannot be cancelled because it was assigned to them via a team. x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business "/orgs/{org}/dependabot/alerts": get: summary: List Dependabot alerts for an organization description: |- Lists Dependabot alerts for an organization. To use this endpoint, you must be an owner or security manager for the organization, and you must use an access token with the `repo` scope or `security_events` scope. For public repositories, you may instead use the `public_repo` scope. GitHub Apps must have **Dependabot alerts** read permission to use this endpoint. tags: - dependabot operationId: dependabot/list-alerts-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-states" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-severities" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-ecosystems" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-packages" - "$ref": "#/components/parameters/dependabot-alert-scope" - "$ref": "#/components/parameters/dependabot-alert-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - "$ref": "#/components/parameters/pagination-first" - "$ref": "#/components/parameters/pagination-last" - "$ref": "#/components/parameters/per-page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/dependabot-alert-with-repository" examples: default: "$ref": "#/components/examples/dependabot-alerts-for-organization" '304': "$ref": "#/components/responses/not_modified" '400': "$ref": "#/components/responses/bad_request" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot subcategory: alerts "/orgs/{org}/dependabot/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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/list-org-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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-dependabot-secret" examples: default: "$ref": "#/components/examples/organization-dependabot-secret-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot subcategory: secrets "/orgs/{org}/dependabot/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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/get-org-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/dependabot-public-key" examples: default: "$ref": "#/components/examples/dependabot-public-key" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot subcategory: secrets "/orgs/{org}/dependabot/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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/get-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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-dependabot-secret" examples: default: "$ref": "#/components/examples/organization-dependabot-secret" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot 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 [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/create-or-update-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/rest/dependabot/secrets#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/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. items: type: string 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: '204': description: Response when updating a secret x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot 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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/delete-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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: dependabot subcategory: secrets "/orgs/{org}/dependabot/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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/list-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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: dependabot 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/rest/dependabot/secrets#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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/set-selected-repos-for-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/dependabot/secrets#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: dependabot subcategory: secrets "/orgs/{org}/dependabot/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/rest/dependabot/secrets#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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/add-selected-repo-to-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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: dependabot 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/rest/dependabot/secrets#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 `dependabot_secrets` organization permission to use this endpoint. tags: - dependabot operationId: dependabot/remove-selected-repo-from-org-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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: dependabot subcategory: secrets "/orgs/{org}/docker/conflicts": get: summary: Get list of conflicting packages during Docker migration for organization description: |- Lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration. To use this endpoint, you must authenticate using an access token with the `read:packages` scope. tags: - packages operationId: packages/list-docker-migration-conflicting-packages-for-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/package" examples: default: "$ref": "#/components/examples/packages-for-org" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/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/rest/activity/events#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}/failed_invitations": get: summary: List failed organization invitations description: The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. tags: - orgs operationId: orgs/list-failed-invitations externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations 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/organization-invitation" examples: default: "$ref": "#/components/examples/organization-invitation-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: members "/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/rest/orgs/webhooks#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/rest/orgs/webhooks#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. 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/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. 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/orgs/webhooks#get-a-webhook-configuration-for-an-organization)." tags: - orgs operationId: orgs/get-webhook externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/webhooks#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/orgs/webhooks#update-a-webhook-configuration-for-an-organization)." tags: - orgs operationId: orgs/update-webhook externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/webhooks#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. 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/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/rest/orgs/webhooks#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/orgs/webhooks#get-an-organization-webhook)." Access 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/rest/orgs/webhooks#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/orgs/webhooks#update-an-organization-webhook)." Access 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/rest/orgs/webhooks#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}/deliveries": get: summary: List deliveries for an organization webhook description: Returns a list of webhook deliveries for a webhook configured in an organization. tags: - orgs operationId: orgs/list-webhook-deliveries externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/hook-id" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/cursor" - name: redelivery in: query required: false schema: type: boolean responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/hook-delivery-item" examples: default: "$ref": "#/components/examples/hook-delivery-items" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: webhooks "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}": get: summary: Get a webhook delivery for an organization webhook description: Returns a delivery for a webhook configured in an organization. tags: - orgs operationId: orgs/get-webhook-delivery externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/hook-id" - "$ref": "#/components/parameters/delivery-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/hook-delivery" examples: default: "$ref": "#/components/examples/hook-delivery" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: webhooks "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": post: summary: Redeliver a delivery for an organization webhook description: Redeliver a delivery for a webhook configured in an organization. tags: - orgs operationId: orgs/redeliver-webhook-delivery externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/hook-id" - "$ref": "#/components/parameters/delivery-id" responses: '202': "$ref": "#/components/responses/accepted" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed" 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/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/rest/orgs/webhooks#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. You must use a [JWT](https://docs.github.com/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/rest/apps/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: apps "/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/rest/orgs/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: orgs "/orgs/{org}/interaction-limits": get: summary: Get interaction restrictions for an organization description: Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. tags: - interactions operationId: interactions/get-restrictions-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: anyOf: - "$ref": "#/components/schemas/interaction-limit-response" - type: object properties: {} additionalProperties: false examples: default: "$ref": "#/components/examples/interaction-limit-response" x-github: githubCloudOnly: false enabledForGitHubApps: true category: interactions subcategory: orgs put: summary: Set interaction restrictions for an organization description: Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. tags: - interactions operationId: interactions/set-restrictions-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/interaction-limit" examples: default: value: limit: collaborators_only expiry: one_month responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/interaction-limit-response" examples: default: "$ref": "#/components/examples/interaction-limit-response" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: interactions subcategory: orgs delete: summary: Remove interaction restrictions for an organization description: Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. tags: - interactions operationId: interactions/remove-restrictions-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: interactions subcategory: orgs "/orgs/{org}/invitations": get: summary: List pending organization invitations description: 'The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, or `hiring_manager`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.' tags: - orgs operationId: orgs/list-pending-invitations externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - name: role description: Filter invitations by their member role. in: query required: false schema: type: string enum: - all - admin - direct_member - billing_manager - hiring_manager default: all - name: invitation_source description: Filter invitations by their invitation source. in: query required: false schema: type: string enum: - all - member - scim default: all responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/organization-invitation" examples: default: "$ref": "#/components/examples/organization-invitation-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: members post: summary: Create an organization invitation description: |- Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/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/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. tags: - orgs operationId: orgs/create-invitation externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation parameters: - "$ref": "#/components/parameters/org" requestBody: required: false content: application/json: schema: type: object properties: invitee_id: type: integer description: "**Required unless you provide `email`**. GitHub user ID for the person you are inviting." email: type: string description: "**Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user." role: type: string description: "The role for the new member. \n * `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. \n * `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. \n * `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization." enum: - admin - direct_member - billing_manager default: direct_member team_ids: type: array description: Specify IDs for the teams you want to invite new members to. items: type: integer examples: default: value: email: octocat@github.com role: direct_member team_ids: - 12 - 26 responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/organization-invitation" examples: default: "$ref": "#/components/examples/organization-invitation" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" x-github: triggersNotification: true githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: members "/orgs/{org}/invitations/{invitation_id}": delete: summary: Cancel an organization invitation description: |- Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). tags: - orgs operationId: orgs/cancel-invitation externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/invitation-id" responses: '204': description: Response '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" x-github: triggersNotification: true githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: members "/orgs/{org}/invitations/{invitation_id}/teams": get: summary: List organization invitation teams description: List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. tags: - orgs operationId: orgs/list-invitation-teams externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/invitation-id" - "$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" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: members "/orgs/{org}/issues": get: summary: List organization issues assigned to the authenticated user description: |- List issues in an organization assigned to the authenticated user. **Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `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 request id, use the "[List pull requests](https://docs.github.com/rest/pulls/pulls#list-pull-requests)" endpoint. tags: - issues operationId: issues/list-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/issues/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. 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. 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 subcategory: issues "/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/rest/orgs/members#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" '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/rest/orgs/members#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/rest/orgs/members#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}/members/{username}/codespaces": get: summary: List codespaces for a user in organization description: |- Lists the codespaces that a member of an organization has for repositories in that organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/get-codespaces-for-user-in-org externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - codespaces properties: total_count: type: integer codespaces: type: array items: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespaces-list" '304': "$ref": "#/components/responses/not_modified" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/members/{username}/codespaces/{codespace_name}": delete: summary: Delete a codespace from the organization description: |- Deletes a user's codespace. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/delete-from-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" - "$ref": "#/components/parameters/codespace-name" responses: '202': "$ref": "#/components/responses/accepted" '304': "$ref": "#/components/responses/not_modified" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/members/{username}/codespaces/{codespace_name}/stop": post: summary: Stop a codespace for an organization user description: |- Stops a user's codespace. You must authenticate using an access token with the `admin:org` scope to use this endpoint. tags: - codespaces operationId: codespaces/stop-in-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" - "$ref": "#/components/parameters/codespace-name" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespace" '304': "$ref": "#/components/responses/not_modified" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: organizations "/orgs/{org}/members/{username}/copilot": get: summary: Get Copilot for Business seat assignment details for a user description: |- **Note**: This endpoint is in beta and is subject to change. Gets the GitHub Copilot for Business seat assignment details for a member of an organization who currently has access to GitHub Copilot. Organization owners and members with admin permissions can view GitHub Copilot seat assignment details for members in their organization. You must authenticate using an access token with the `manage_billing:copilot` scope to use this endpoint. tags: - copilot operationId: copilot/get-copilot-seat-assignment-details-for-user externalDocs: description: API method documentation url: https://docs.github.com/rest/copilot/copilot-for-business#get-copilot-for-business-seat-assignment-details-for-a-user parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/username" responses: '200': description: The user's GitHub Copilot seat details, including usage. content: application/json: schema: "$ref": "#/components/schemas/copilot-seat-details" examples: default: "$ref": "#/components/examples/copilot-seat-detail-active" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': description: Copilot for Business is not enabled for this organization or the user has a pending organization invitation. x-github: githubCloudOnly: false enabledForGitHubApps: true category: copilot subcategory: copilot-for-business "/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/rest/orgs/members#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/rest/orgs/members#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/rest/orgs/members#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. If 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/rest/orgs/members#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}/migrations": get: summary: List organization migrations description: |- Lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API). A list of `repositories` is only returned for export migrations. tags: - migrations operationId: migrations/list-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - name: exclude description: Exclude attributes from the API response to improve performance in: query schema: type: array items: description: Allowed values that can be passed to the exclude param. enum: - repositories example: repositories type: string responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/migration" examples: default: "$ref": "#/components/examples/migration-with-short-org-items" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs post: summary: Start an organization migration description: Initiates the generation of a migration archive. tags: - migrations operationId: migrations/start-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object properties: repositories: type: array description: A list of arrays indicating which repositories should be migrated. items: type: string lock_repositories: type: boolean example: true description: Indicates whether repositories should be locked (to prevent manipulation) while migrating data. default: false exclude_metadata: type: boolean description: Indicates whether metadata should be excluded and only git source should be included for the migration. default: false exclude_git_data: type: boolean description: Indicates whether the repository git data should be excluded from the migration. default: false exclude_attachments: type: boolean example: true description: Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). default: false exclude_releases: type: boolean example: true description: Indicates whether releases should be excluded from the migration (to reduce migration archive file size). default: false exclude_owner_projects: type: boolean example: true description: Indicates whether projects owned by the organization or users should be excluded. from the migration. default: false org_metadata_only: type: boolean example: true description: Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). default: false exclude: type: array description: 'Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`.' items: type: string enum: - repositories required: - repositories examples: default: value: repositories: - github/Hello-World lock_repositories: true responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/migration" examples: default: "$ref": "#/components/examples/migration-with-short-org-2" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs "/orgs/{org}/migrations/{migration_id}": get: summary: Get an organization migration status description: |- Fetches the status of a migration. The `state` of a migration can be one of the following values: * `pending`, which means the migration hasn't started yet. * `exporting`, which means the migration is in progress. * `exported`, which means the migration finished successfully. * `failed`, which means the migration failed. tags: - migrations operationId: migrations/get-status-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/migration-id" - name: exclude description: Exclude attributes from the API response to improve performance in: query schema: type: array items: description: Allowed values that can be passed to the exclude param. enum: - repositories example: repositories type: string responses: '200': description: |- * `pending`, which means the migration hasn't started yet. * `exporting`, which means the migration is in progress. * `exported`, which means the migration finished successfully. * `failed`, which means the migration failed. content: application/json: schema: "$ref": "#/components/schemas/migration" examples: default: "$ref": "#/components/examples/migration-with-short-org" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs "/orgs/{org}/migrations/{migration_id}/archive": get: summary: Download an organization migration archive description: Fetches the URL to a migration archive. tags: - migrations operationId: migrations/download-archive-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/migration-id" responses: '302': description: Response '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs delete: summary: Delete an organization migration archive description: Deletes a previous migration archive. Migration archives are automatically deleted after seven days. tags: - migrations operationId: migrations/delete-archive-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/migration-id" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs "/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock": delete: summary: Unlock an organization repository description: Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data. tags: - migrations operationId: migrations/unlock-repo-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/migration-id" - "$ref": "#/components/parameters/repo-name" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs "/orgs/{org}/migrations/{migration_id}/repositories": get: summary: List repositories in an organization migration description: List all the repositories for this organization migration. tags: - migrations operationId: migrations/list-repos-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/migration-id" - "$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" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: migrations subcategory: orgs "/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/rest/orgs/outside-collaborators#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/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." tags: - orgs operationId: orgs/convert-member-to-outside-collaborator externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/outside-collaborators#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: responses: '202': description: User is getting converted asynchronously content: application/json: schema: type: object properties: {} additionalProperties: false examples: '202': value: '204': description: User was converted '403': description: Forbidden if user is the last owner of the organization, not a member of the organization, or if the enterprise enforces a policy for inviting outside collaborators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." '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/rest/orgs/outside-collaborators#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/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: outside-collaborators "/orgs/{org}/packages": get: summary: List packages for an organization description: |- Lists packages in an organization readable by the user. To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." tags: - packages operationId: packages/list-packages-for-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization parameters: - name: package_type description: The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. in: query required: true schema: type: string enum: - npm - maven - rubygems - docker - nuget - container - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/package-visibility" - name: page description: Page number of the results to fetch. in: query schema: type: integer default: 1 - name: per_page description: The number of results per page (max 100). in: query schema: type: integer default: 30 responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/package" examples: default: "$ref": "#/components/examples/packages-for-org" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" '400': "$ref": "#/components/responses/package_es_list_error" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/packages/{package_type}/{package_name}": get: summary: Get a package for an organization description: |- Gets a specific package in an organization. To use this endpoint, you must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." tags: - packages operationId: packages/get-package-for-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/package" examples: default: "$ref": "#/components/examples/package-org" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages delete: summary: Delete a package for an organization description: |- Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `read:packages` and `delete:packages` scopes. In addition: - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to delete. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." tags: - packages operationId: packages/delete-package-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/packages/{package_type}/{package_name}/restore": post: summary: Restore a package for an organization description: |- Restores an entire package in an organization. You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `read:packages` and `write:packages` scopes. In addition: - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package you want to restore. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." tags: - packages operationId: packages/restore-package-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" - name: token description: package token schema: type: string required: false in: query responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/packages/{package_type}/{package_name}/versions": get: summary: List package versions for a package owned by an organization description: |- Lists package versions for a package owned by an organization. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." tags: - packages operationId: packages/get-all-package-versions-for-package-owned-by-org externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" - name: state in: query required: false description: The state of the package, either active or deleted. schema: type: string enum: - active - deleted default: active responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/package-version" examples: default: "$ref": "#/components/examples/package-versions-for-org" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": get: summary: Get a package version for an organization description: |- Gets a specific package version in an organization. You must authenticate using an access token with the `read:packages` scope. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of GitHub Packages registries that only support repository-scoped permissions, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." tags: - packages operationId: packages/get-package-version-for-organization externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/package-version-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/package-version" examples: default: "$ref": "#/components/examples/package-version-org" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages delete: summary: Delete package version for an organization description: |- Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `read:packages` and `delete:packages` scopes. In addition: - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to delete. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." tags: - packages operationId: packages/delete-package-version-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/package-version-id" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": post: summary: Restore package version for an organization description: |- Restores a specific package version in an organization. You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `read:packages` and `write:packages` scopes. In addition: - If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, your token must also include the `repo` scope. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." - If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, you must have admin permissions to the package whose version you want to restore. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." tags: - packages operationId: packages/restore-package-version-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization parameters: - "$ref": "#/components/parameters/package-type" - "$ref": "#/components/parameters/package-name" - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/package-version-id" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '401': "$ref": "#/components/responses/requires_authentication" x-github: githubCloudOnly: false enabledForGitHubApps: false category: packages subcategory: packages "/orgs/{org}/personal-access-token-requests": get: summary: List requests to access organization resources with fine-grained personal access tokens description: |- Lists requests from organization members to access organization resources with a fine-grained personal access token. Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: read` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/list-pat-grant-requests externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/personal-access-token-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/personal-access-token-owner" - "$ref": "#/components/parameters/personal-access-token-repository" - "$ref": "#/components/parameters/personal-access-token-permission" - "$ref": "#/components/parameters/personal-access-token-before" - "$ref": "#/components/parameters/personal-access-token-after" responses: '500': "$ref": "#/components/responses/internal_error" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/organization-programmatic-access-grant-request" examples: default: "$ref": "#/components/examples/org-pat-grant-request-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens post: summary: Review requests to access organization resources with fine-grained personal access tokens description: |- Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token. Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/review-pat-grant-requests-in-bulk externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object properties: pat_request_ids: type: array description: Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. items: type: integer minItems: 1 maxItems: 100 action: type: string description: Action to apply to the requests. enum: - approve - deny reason: type: string description: Reason for approving or denying the requests. Max 1024 characters. maxLength: 1024 nullable: true required: - action examples: '204': summary: Example of denying a request value: pat_request_ids: - 42 - 73 action: deny reason: Access is too broad. responses: '500': "$ref": "#/components/responses/internal_error" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '202': "$ref": "#/components/responses/accepted" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens "/orgs/{org}/personal-access-token-requests/{pat_request_id}": post: summary: Review a request to access organization resources with a fine-grained personal access token description: |- Approves or denies a pending request to access organization resources via a fine-grained personal access token. Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/review-pat-grant-request externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token parameters: - "$ref": "#/components/parameters/org" - name: pat_request_id in: path description: Unique identifier of the request for access via fine-grained personal access token. required: true schema: type: integer requestBody: required: true content: application/json: schema: type: object properties: action: type: string description: Action to apply to the request. enum: - approve - deny reason: type: string description: Reason for approving or denying the request. Max 1024 characters. maxLength: 1024 nullable: true required: - action examples: '204': summary: Example of denying a request value: action: deny reason: This request is denied because the access is too broad. responses: '500': "$ref": "#/components/responses/internal_error" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '204': "$ref": "#/components/responses/no_content" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens "/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories": get: summary: List repositories requested to be accessed by a fine-grained personal access token description: |- Lists the repositories a fine-grained personal access token request is requesting access to. Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: read` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/list-pat-grant-request-repositories externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token parameters: - "$ref": "#/components/parameters/org" - name: pat_request_id in: path description: Unique identifier of the request for access via fine-grained personal access token. required: true schema: type: integer - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '500': "$ref": "#/components/responses/internal_error" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '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: orgs subcategory: personal-access-tokens "/orgs/{org}/personal-access-tokens": get: summary: List fine-grained personal access tokens with access to organization resources description: |- Lists approved fine-grained personal access tokens owned by organization members that can access organization resources. Only GitHub Apps can call this API, using the `organization_personal_access_tokens: read` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/list-pat-grants externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/personal-access-token-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/personal-access-token-owner" - "$ref": "#/components/parameters/personal-access-token-repository" - "$ref": "#/components/parameters/personal-access-token-permission" - "$ref": "#/components/parameters/personal-access-token-before" - "$ref": "#/components/parameters/personal-access-token-after" responses: '500': "$ref": "#/components/responses/internal_error" '422': "$ref": "#/components/responses/validation_failed" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/organization-programmatic-access-grant" examples: default: "$ref": "#/components/examples/org-pat-grant-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens post: summary: Update the access to organization resources via fine-grained personal access tokens description: |- Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access. Only GitHub Apps can call this API, using the `organization_personal_access_tokens: write` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/update-pat-accesses externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens parameters: - "$ref": "#/components/parameters/org" requestBody: required: true content: application/json: schema: type: object properties: action: type: string description: Action to apply to the fine-grained personal access token. enum: - revoke pat_ids: description: The IDs of the fine-grained personal access tokens. type: array items: type: integer description: Unique identifier of the fine-grained personal access token. minItems: 1 maxItems: 100 required: - action - pat_ids examples: '204': summary: Example of revoking a fine-grained personal access token. value: action: revoke pat_ids: - 1296269 - 1296280 responses: '500': "$ref": "#/components/responses/internal_error" '404': "$ref": "#/components/responses/not_found" '202': "$ref": "#/components/responses/accepted" '403': "$ref": "#/components/responses/forbidden" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens "/orgs/{org}/personal-access-tokens/{pat_id}": post: summary: Update the access a fine-grained personal access token has to organization resources description: |- Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access. Only GitHub Apps can call this API, using the `organization_personal_access_tokens: write` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/update-pat-access externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/fine-grained-personal-access-token-id" requestBody: required: true content: application/json: schema: type: object properties: action: type: string description: Action to apply to the fine-grained personal access token. enum: - revoke required: - action examples: '204': summary: Example of revoking a fine-grained personal access token. value: action: revoke responses: '500': "$ref": "#/components/responses/internal_error" '404': "$ref": "#/components/responses/not_found" '204': "$ref": "#/components/responses/no_content" '403': "$ref": "#/components/responses/forbidden" '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: personal-access-tokens "/orgs/{org}/personal-access-tokens/{pat_id}/repositories": get: summary: List repositories a fine-grained personal access token has access to description: |- Lists the repositories a fine-grained personal access token has access to. Only GitHub Apps can call this API, using the `organization_personal_access_tokens: read` permission. **Note**: Fine-grained PATs are in public beta. Related APIs, events, and functionality are subject to change. tags: - orgs operationId: orgs/list-pat-grant-repositories externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to parameters: - "$ref": "#/components/parameters/org" - name: pat_id in: path description: Unique identifier of the fine-grained personal access token. required: true schema: type: integer - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '500': "$ref": "#/components/responses/internal_error" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" '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: orgs subcategory: personal-access-tokens "/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/rest/projects/projects#list-organization-projects parameters: - "$ref": "#/components/parameters/org" - name: state description: Indicates the state of the projects to return. 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 subcategory: projects post: summary: Create an organization project description: Creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. 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/rest/projects/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 subcategory: projects "/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/rest/orgs/members#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: Check if the provided user is a public member of the organization. tags: - orgs operationId: orgs/check-public-membership-for-user externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#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.) 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/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/rest/orgs/members#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: Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. tags: - orgs operationId: orgs/remove-public-membership-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/members#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. **Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." tags: - repos operationId: repos/list-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#list-organization-repositories parameters: - "$ref": "#/components/parameters/org" - name: type description: Specifies the types of repositories you want returned. in: query required: false schema: type: string enum: - all - public - private - forks - sources - member default: all - 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 subcategory: repos 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. **OAuth scope requirements** When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * `repo` scope to create a private repository tags: - repos operationId: repos/create-in-org externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/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: The visibility of the repository. enum: - public - private 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 has_downloads: description: Whether downloads are enabled. default: true type: boolean example: 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 allow_auto_merge: type: boolean description: Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. default: false 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. **The authenticated user must be an organization owner to set this property to `true`.** 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. **This property has been deprecated. Please use `squash_merge_commit_title` instead. default: false deprecated: true squash_merge_commit_title: type: string enum: - PR_TITLE - COMMIT_OR_PR_TITLE description: |- The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). squash_merge_commit_message: type: string enum: - PR_BODY - COMMIT_MESSAGES - BLANK description: |- The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message. merge_commit_title: type: string enum: - PR_TITLE - MERGE_MESSAGE description: |- The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). merge_commit_message: type: string enum: - PR_BODY - PR_TITLE - BLANK description: |- The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message. 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 subcategory: repos "/orgs/{org}/rulesets": get: summary: Get all organization repository rulesets description: Get all the repository rulesets for an organization. tags: - repos operationId: repos/get-org-rulesets externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rules 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/repository-ruleset" examples: default: "$ref": "#/components/examples/org-ruleset-items" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" post: summary: Create an organization repository ruleset description: Create a repository ruleset for an organization. tags: - repos operationId: repos/create-org-ruleset externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rules parameters: - "$ref": "#/components/parameters/org" requestBody: description: Request body required: true content: application/json: schema: type: object properties: name: type: string description: The name of the ruleset. target: type: string description: The target of the ruleset. enum: - branch - tag enforcement: "$ref": "#/components/schemas/repository-rule-enforcement" bypass_actors: type: array description: The actors that can bypass the rules in this ruleset items: "$ref": "#/components/schemas/repository-ruleset-bypass-actor" conditions: "$ref": "#/components/schemas/org-ruleset-conditions" rules: type: array description: An array of rules within the ruleset. items: "$ref": "#/components/schemas/repository-rule" required: - name - enforcement examples: default: value: name: super cool ruleset target: branch enforcement: active bypass_actors: - actor_id: 234 actor_type: Team bypass_mode: always conditions: ref_name: include: - refs/heads/main - refs/heads/master exclude: - refs/heads/dev* repository_name: include: - important_repository - another_important_repository exclude: - unimportant_repository protected: true rules: - type: commit_author_email_pattern parameters: operator: contains pattern: github responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/repository-ruleset" examples: default: "$ref": "#/components/examples/org-ruleset" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" "/orgs/{org}/rulesets/rule-suites": get: summary: List organization rule suites description: |- Lists suites of rule evaluations at the organization level. For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." tags: - repos operationId: repos/get-org-rule-suites externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/repository-name-in-query" - "$ref": "#/components/parameters/time-period" - "$ref": "#/components/parameters/actor-name-in-query" - "$ref": "#/components/parameters/rule-suite-result" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/rule-suites" examples: default: "$ref": "#/components/examples/rule-suite-items" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rule-suites "/orgs/{org}/rulesets/rule-suites/{rule_suite_id}": get: summary: Get an organization rule suite description: |- Gets information about a suite of rule evaluations from within an organization. For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." tags: - repos operationId: repos/get-org-rule-suite externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/rule-suite-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/rule-suite" examples: default: "$ref": "#/components/examples/rule-suite" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rule-suites "/orgs/{org}/rulesets/{ruleset_id}": get: summary: Get an organization repository ruleset description: Get a repository ruleset for an organization. tags: - repos operationId: repos/get-org-ruleset externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rules parameters: - "$ref": "#/components/parameters/org" - name: ruleset_id description: The ID of the ruleset. in: path required: true schema: type: integer responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/repository-ruleset" examples: default: "$ref": "#/components/examples/org-ruleset" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" put: summary: Update an organization repository ruleset description: Update a ruleset for an organization. tags: - repos operationId: repos/update-org-ruleset externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rules parameters: - "$ref": "#/components/parameters/org" - name: ruleset_id description: The ID of the ruleset. in: path required: true schema: type: integer requestBody: description: Request body required: false content: application/json: schema: type: object properties: name: type: string description: The name of the ruleset. target: type: string description: The target of the ruleset. enum: - branch - tag enforcement: "$ref": "#/components/schemas/repository-rule-enforcement" bypass_actors: type: array description: The actors that can bypass the rules in this ruleset items: "$ref": "#/components/schemas/repository-ruleset-bypass-actor" conditions: "$ref": "#/components/schemas/org-ruleset-conditions" rules: description: An array of rules within the ruleset. type: array items: "$ref": "#/components/schemas/repository-rule" examples: default: value: name: super cool ruleset target: branch enforcement: active bypass_actors: - actor_id: 234 actor_type: Team bypass_mode: always conditions: ref_name: include: - refs/heads/main - refs/heads/master exclude: - refs/heads/dev* repository_name: include: - important_repository - another_important_repository exclude: - unimportant_repository protected: true rules: - type: commit_author_email_pattern parameters: operator: contains pattern: github responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/repository-ruleset" examples: default: "$ref": "#/components/examples/org-ruleset" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" delete: summary: Delete an organization repository ruleset description: Delete a ruleset for an organization. tags: - repos operationId: repos/delete-org-ruleset externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset x-github: githubCloudOnly: false enabledForGitHubApps: true category: orgs subcategory: rules parameters: - "$ref": "#/components/parameters/org" - name: ruleset_id description: The ID of the ruleset. in: path required: true schema: type: integer responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" "/orgs/{org}/secret-scanning/alerts": get: summary: List secret scanning alerts for an organization description: |- Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest. To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the `repo` scope or `security_events` scope. For public repositories, you may instead use the `public_repo` scope. GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. tags: - secret-scanning operationId: secret-scanning/list-alerts-for-org externalDocs: description: API method documentation url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/secret-scanning-alert-state" - "$ref": "#/components/parameters/secret-scanning-alert-secret-type" - "$ref": "#/components/parameters/secret-scanning-alert-resolution" - "$ref": "#/components/parameters/secret-scanning-alert-sort" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/secret-scanning-pagination-before-org-repo" - "$ref": "#/components/parameters/secret-scanning-pagination-after-org-repo" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/organization-secret-scanning-alert" examples: default: "$ref": "#/components/examples/organization-secret-scanning-alert-list" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: secret-scanning subcategory: secret-scanning "/orgs/{org}/security-advisories": get: summary: List repository security advisories for an organization description: |- Lists repository security advisories for an organization. To use this endpoint, you must be an owner or security manager for the organization, and you must use an access token with the `repo` scope or `repository_advisories:write` permission. tags: - security-advisories operationId: security-advisories/list-org-repository-advisories externalDocs: description: API method documentation url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/direction" - name: sort description: The property to sort the results by. in: query required: false schema: type: string enum: - created - updated - published default: created - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - name: per_page description: The number of advisories to return per page. in: query required: false schema: type: integer minimum: 1 maximum: 100 default: 30 - name: state description: Filter by the state of the repository advisories. Only advisories of this state will be returned. in: query required: false schema: type: string enum: - triage - draft - published - closed responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/repository-advisory" examples: default: "$ref": "#/components/examples/list-repository-advisories" '400': "$ref": "#/components/responses/bad_request" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: security-advisories subcategory: repository-advisories "/orgs/{org}/security-managers": get: summary: List security manager teams description: |- Lists teams that are security managers for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the `read:org` scope. GitHub Apps must have the `administration` organization read permission to use this endpoint. tags: - orgs operationId: orgs/list-security-manager-teams externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/team-simple" examples: default: "$ref": "#/components/examples/team-items" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: orgs subcategory: security-managers "/orgs/{org}/security-managers/teams/{team_slug}": put: summary: Add a security manager team description: |- Adds a team as a security manager for an organization. For more information, see "[Managing security for an organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) for an organization." To use this endpoint, you must be an administrator for the organization, and you must use an access token with the `write:org` scope. GitHub Apps must have the `administration` organization read-write permission to use this endpoint. tags: - orgs operationId: orgs/add-security-manager-team externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/team-slug" responses: '204': description: Response '409': description: The organization has reached the maximum number of security manager teams. x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: orgs subcategory: security-managers delete: summary: Remove a security manager team description: |- Removes the security manager role from a team for an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization) team from an organization." To use this endpoint, you must be an administrator for the organization, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `administration` organization read-write permission to use this endpoint. tags: - orgs operationId: orgs/remove-security-manager-team externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/team-slug" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: orgs subcategory: security-managers "/orgs/{org}/settings/billing/actions": get: summary: Get GitHub Actions billing for an organization description: |- Gets the summary of the free and paid GitHub Actions minutes used. Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". Access tokens must have the `repo` or `admin:org` scope. operationId: billing/get-github-actions-billing-org tags: - billing externalDocs: description: API method documentation url: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-billing-usage" examples: default: "$ref": "#/components/examples/actions-billing-usage" x-github: githubCloudOnly: false enabledForGitHubApps: false category: billing subcategory: billing "/orgs/{org}/settings/billing/packages": get: summary: Get GitHub Packages billing for an organization description: |- Gets the free and paid storage used for GitHub Packages in gigabytes. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the `repo` or `admin:org` scope. operationId: billing/get-github-packages-billing-org tags: - billing externalDocs: description: API method documentation url: https://docs.github.com/rest/billing/billing#get-github-packages-billing-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/packages-billing-usage" examples: default: "$ref": "#/components/examples/packages-billing-usage" x-github: githubCloudOnly: false enabledForGitHubApps: false category: billing subcategory: billing "/orgs/{org}/settings/billing/shared-storage": get: summary: Get shared storage billing for an organization description: |- Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages. Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." Access tokens must have the `repo` or `admin:org` scope. operationId: billing/get-shared-storage-billing-org tags: - billing externalDocs: description: API method documentation url: https://docs.github.com/rest/billing/billing#get-shared-storage-billing-for-an-organization parameters: - "$ref": "#/components/parameters/org" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/combined-billing-usage" examples: default: "$ref": "#/components/examples/combined-billing-usage" x-github: githubCloudOnly: false enabledForGitHubApps: false category: billing subcategory: billing "/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/rest/teams/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: teams 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/articles/setting-team-creation-permissions-in-your-organization)." When 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/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/rest/teams/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 notification_setting: type: string description: "The notification setting the team has chosen. The options are: \n * `notifications_enabled` - team members receive notifications when the team is @mentioned. \n * `notifications_disabled` - no one receives notifications. \nDefault: `notifications_enabled`" enum: - notifications_enabled - notifications_disabled 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. required: - name examples: default: value: name: Justice League description: A great team permission: push notification_setting: notifications_enabled 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: teams "/orgs/{org}/teams/{team_slug}": get: summary: Get a team by name description: |- Gets a team using the team's `slug`. To create the `slug`, GitHub replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`. **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/rest/teams/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: teams patch: summary: Update a team description: |- To edit a team, the authenticated user must either be an organization owner or a team maintainer. **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/rest/teams/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 notification_setting: type: string description: "The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: \n * `notifications_enabled` - team members receive notifications when the team is @mentioned. \n * `notifications_disabled` - no one receives notifications." enum: - notifications_enabled - notifications_disabled 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 notification_setting: notifications_enabled responses: '200': description: Response when the updated information already exists content: application/json: schema: "$ref": "#/components/schemas/team-full" examples: default: "$ref": "#/components/examples/team-full" '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/team-full" examples: default: "$ref": "#/components/examples/team-full" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '403': "$ref": "#/components/responses/forbidden" x-github: githubCloudOnly: false enabledForGitHubApps: true category: teams subcategory: teams delete: summary: Delete a team description: |- To delete a team, the authenticated user must be an organization owner or team maintainer. If you are an organization owner, deleting a parent team will delete all of its child teams as well. **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/rest/teams/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: teams "/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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussions#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/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/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. **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/rest/teams/discussions#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 "/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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussions#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussions#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussions#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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussion-comments#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). This endpoint triggers [notifications](https://docs.github.com/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/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. **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/rest/teams/discussion-comments#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 "/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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussion-comments#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussion-comments#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 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/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/teams/discussion-comments#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/rest/teams/discussion-comments#get-a-discussion-comment). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/reactions/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/rest/reactions/reactions#about-reactions). 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 subcategory: reactions post: summary: Create reaction for a team discussion comment description: |- Create a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/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. **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/rest/reactions/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/rest/reactions/reactions#about-reactions) 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 subcategory: 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`. Delete a reaction to a [team discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/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/rest/reactions/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 subcategory: 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/rest/teams/discussions#get-a-discussion). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). **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/rest/reactions/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/rest/reactions/reactions#about-reactions). 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 subcategory: reactions post: summary: Create reaction for a team discussion description: |- Create a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/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. **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/rest/reactions/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/rest/reactions/reactions#about-reactions) 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 subcategory: 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`. Delete a reaction to a [team discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/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/rest/reactions/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 subcategory: reactions "/orgs/{org}/teams/{team_slug}/invitations": get: summary: List pending team invitations description: |- The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. tags: - teams operationId: teams/list-pending-invitations-in-org externalDocs: description: API method documentation url: https://docs.github.com/rest/teams/members#list-pending-team-invitations 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/organization-invitation" examples: default: "$ref": "#/components/examples/organization-invitation-items" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: teams subcategory: members "/orgs/{org}/teams/{team_slug}/members": get: summary: List team members description: |- Team members will include the members of child teams. To 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/rest/teams/members#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. To get a user's membership with a team, the team must be visible to the authenticated user. **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}`. **Note:** The response contains the `state` of the membership and the member's `role`. The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team). tags: - teams operationId: teams/get-membership-for-user-in-org externalDocs: description: API method documentation url: https://docs.github.com/rest/teams/members#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: |- Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. 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. **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 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](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." An 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. If 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. **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/rest/teams/members#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: |- To 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. 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. **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 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](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." **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/rest/teams/members#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. **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/rest/teams/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 subcategory: teams "/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. **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/rest/teams/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 subcategory: teams 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. **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/rest/teams/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/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/rest/teams/teams#add-or-update-team-project-permissions x-github: githubCloudOnly: false enabledForGitHubApps: true category: teams subcategory: teams 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. **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/rest/teams/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: teams "/orgs/{org}/teams/{team_slug}/repos": get: summary: List team repositories description: |- Lists a team's repositories visible to the authenticated user. **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/rest/teams/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: teams "/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. You 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/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. **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/rest/teams/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: teams 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/rest/overview/resources-in-the-rest-api#http-verbs)." **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}`. For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/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/rest/teams/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. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team''s `permission` attribute will be used to determine what permission to grant the team on this repository.' 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: teams 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. **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/rest/teams/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: teams "/orgs/{org}/teams/{team_slug}/teams": get: summary: List child teams description: |- Lists the child teams of the team specified by `{team_slug}`. **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/rest/teams/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: teams "/orgs/{org}/{security_product}/{enablement}": post: summary: Enable or disable a security feature for an organization description: |- Enables or disables the specified security feature for all eligible repositories in an organization. To use this endpoint, you must be an organization owner or be member of a team with the security manager role. A token with the 'write:org' scope is also required. GitHub Apps must have the `organization_administration:write` permission to use this endpoint. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." tags: - orgs operationId: orgs/enable-or-disable-security-product-on-all-org-repos externalDocs: description: API method documentation url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization parameters: - "$ref": "#/components/parameters/org" - "$ref": "#/components/parameters/security-product" - "$ref": "#/components/parameters/org-security-product-enablement" requestBody: required: false content: application/json: schema: properties: query_suite: description: |- CodeQL query suite to be used. If you specify the `query_suite` parameter, the default setup will be configured with this query suite only on all repositories that didn't have default setup already configured. It will not change the query suite on repositories that already have default setup configured. If you don't specify any `query_suite` in your request, the preferred query suite of the organization will be applied. type: string enum: - default - extended examples: default: value: query_suite: default responses: '204': description: Action started '422': description: The action could not be taken due to an in progress enablement, or a policy is preventing enablement x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: orgs subcategory: orgs "/projects/columns/cards/{card_id}": get: summary: Get a project card description: Gets information about a project card. tags: - projects operationId: projects/get-card externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/cards#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 patch: summary: Update an existing project card description: '' tags: - projects operationId: projects/update-card externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/cards#update-an-existing-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 delete: summary: Delete a project card description: Deletes a project card tags: - projects operationId: projects/delete-card externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/cards#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 "/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/rest/projects/cards#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: '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 "/projects/columns/{column_id}": get: summary: Get a project column description: Gets information about a project column. tags: - projects operationId: projects/get-column externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/columns#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 patch: summary: Update an existing project column description: '' tags: - projects operationId: projects/update-column externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/columns#update-an-existing-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 delete: summary: Delete a project column description: Deletes a project column. tags: - projects operationId: projects/delete-column externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/columns#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 "/projects/columns/{column_id}/cards": get: summary: List project cards description: Lists the project cards in a project. tags: - projects operationId: projects/list-cards externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/cards#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 post: summary: Create a project card description: '' tags: - projects operationId: projects/create-card externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/cards#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 "/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/rest/projects/columns#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: '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 "/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/rest/projects/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 subcategory: projects 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/rest/projects/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 subcategory: projects 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/rest/projects/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 subcategory: projects "/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/rest/projects/collaborators#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 "/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/rest/projects/collaborators#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 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/rest/projects/collaborators#remove-user-as-a-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 "/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/rest/projects/collaborators#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 "/projects/{project_id}/columns": get: summary: List project columns description: Lists the project columns in a project. tags: - projects operationId: projects/list-columns externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/columns#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 post: summary: Create a project column description: Creates a new project column. tags: - projects operationId: projects/create-column externalDocs: description: API method documentation url: https://docs.github.com/rest/projects/columns#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 "/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. Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories: * The `core` object provides your rate limit status for all non-search-related resources in the REST API. * The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/rest/search)." * The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/rest/search/search#search-code)." * The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/graphql/overview/resource-limitations#rate-limit)." * The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)." * The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/rest/dependency-graph)." * The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)." * The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/rest/actions/self-hosted-runners)." * The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/rest/overview/api-versions)." **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/rest/rate-limit/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: rate-limit "/repos/{owner}/{repo}": get: summary: Get a repository description: |- The `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. **Note:** In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." tags: - repos operationId: repos/get externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/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" '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 subcategory: repos patch: summary: Update a repository description: "**Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/repos/repos#replace-all-repository-topics) endpoint." tags: - repos operationId: repos/update externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/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." default: false visibility: type: string description: The visibility of the repository. enum: - public - private security_and_analysis: type: object description: |- Specify which security and analysis features to enable or disable for the repository. To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request: `{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`. You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. nullable: true properties: advanced_security: type: object description: Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." properties: status: type: string description: Can be `enabled` or `disabled`. secret_scanning: type: object description: Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." properties: status: type: string description: Can be `enabled` or `disabled`. secret_scanning_push_protection: type: object description: Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." properties: status: type: string description: Can be `enabled` or `disabled`. 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 allow_auto_merge: type: boolean description: Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. default: false 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. **This property has been deprecated. Please use `squash_merge_commit_title` instead. default: false deprecated: true squash_merge_commit_title: type: string enum: - PR_TITLE - COMMIT_OR_PR_TITLE description: |- The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). squash_merge_commit_message: type: string enum: - PR_BODY - COMMIT_MESSAGES - BLANK description: |- The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message. merge_commit_title: type: string enum: - PR_TITLE - MERGE_MESSAGE description: |- The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). merge_commit_message: type: string enum: - PR_BODY - PR_TITLE - BLANK description: |- The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message. archived: type: boolean description: Whether to archive this repository. `false` will unarchive a previously archived repository. default: false allow_forking: type: boolean description: Either `true` to allow private forks, or `false` to prevent private forks. default: false web_commit_signoff_required: type: boolean description: Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. 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 subcategory: repos delete: summary: Delete a repository description: |- Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, you will get a `403 Forbidden` response. tags: - repos operationId: repos/delete externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/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/rest/repos/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: repos "/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/rest/actions/artifacts#list-artifacts-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/artifact-name" 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/rest/actions/artifacts#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/rest/actions/artifacts#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 the response header to find the URL for the download. The `:archive_format` must be `zip`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub 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/rest/actions/artifacts#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/cache/usage": get: summary: Get GitHub Actions cache usage for a repository description: |- Gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. 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-actions-cache-usage externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-cache-usage-by-repository" examples: default: "$ref": "#/components/examples/actions-cache-usage" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: cache "/repos/{owner}/{repo}/actions/caches": get: summary: List GitHub Actions caches for a repository description: |- Lists the GitHub Actions caches for a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:read` permission to use this endpoint. tags: - actions operationId: actions/get-actions-cache-list externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/actions-cache-git-ref-full" - "$ref": "#/components/parameters/actions-cache-key" - "$ref": "#/components/parameters/actions-cache-list-sort" - "$ref": "#/components/parameters/direction" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-cache-list" examples: default: "$ref": "#/components/examples/actions-cache-list" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: actions subcategory: cache delete: summary: Delete GitHub Actions caches for a repository (using a cache key) description: |- Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. 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-actions-cache-by-key externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/actions-cache-key-required" - "$ref": "#/components/parameters/actions-cache-git-ref-full" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-cache-list" examples: default: "$ref": "#/components/examples/actions-cache-list" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: cache "/repos/{owner}/{repo}/actions/caches/{cache_id}": delete: summary: Delete a GitHub Actions cache for a repository (using a cache ID) description: |- Deletes a GitHub Actions cache for a repository, using a cache 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/delete-actions-cache-by-id externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/cache-id" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: cache "/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/rest/actions/workflow-jobs#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 for `Location:` in the response header to find the URL for the download. 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/download-job-logs-for-workflow-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-jobs#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/jobs/{job_id}/rerun": post: summary: Re-run a job from a workflow run description: |- Re-run a job and its dependent jobs in 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/re-run-job-for-workflow-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/job-id" requestBody: required: false content: application/json: schema: type: object nullable: true properties: enable_debug_logging: type: boolean default: false description: Whether to enable debug logging for the re-run. examples: default: value: responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '403': "$ref": "#/components/responses/forbidden" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/oidc/customization/sub": get: summary: Get the customization template for an OIDC subject claim for a repository description: |- Gets the customization template for an OpenID Connect (OIDC) subject claim. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `organization_administration:read` permission to use this endpoint. tags: - actions operationId: actions/get-custom-oidc-sub-claim-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Status response content: application/json: schema: "$ref": "#/components/schemas/oidc-custom-sub-repo" examples: default: "$ref": "#/components/examples/oidc-custom-sub-repo" '400': "$ref": "#/components/responses/bad_request" '404': "$ref": "#/components/responses/not_found" x-github: enabledForGitHubApps: true previews: [] category: actions subcategory: oidc put: summary: Set the customization template for an OIDC subject claim for a repository description: |- Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. 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/set-custom-oidc-sub-claim-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: title: Actions OIDC subject customization for a repository description: Actions OIDC subject customization for a repository type: object required: - use_default properties: use_default: description: Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. type: boolean include_claim_keys: description: Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. type: array items: type: string examples: default: value: use_default: false include_claim_keys: - repo - context responses: '201': description: Empty response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '404': "$ref": "#/components/responses/not_found" '400': "$ref": "#/components/responses/bad_request" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: enabledForGitHubApps: true previews: [] category: actions subcategory: oidc "/repos/{owner}/{repo}/actions/organization-secrets": get: summary: List repository organization secrets description: |- Lists all organization secrets shared with 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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/list-repo-organization-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#list-repository-organization-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/organization-variables": get: summary: List repository organization variables description: |- Lists all organiation variables shared with a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:read` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/list-repo-organization-variables externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/variables-per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - variables properties: total_count: type: integer variables: type: array items: "$ref": "#/components/schemas/actions-variable" examples: default: "$ref": "#/components/examples/actions-variables-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/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 and reusable workflows allowed to run in the repository. You 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/rest/actions/permissions#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 and reusable workflows in the repository. You 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/rest/actions/permissions#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/access": get: summary: Get the level of access for workflows outside of the repository description: |- Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to private repositories. For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the repository `administration` permission to use this endpoint. tags: - actions operationId: actions/get-workflow-access-to-repository externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-workflow-access-to-repository" examples: default: "$ref": "#/components/examples/actions-workflow-access-to-repository" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: actions subcategory: permissions put: summary: Set the level of access for workflows outside of the repository description: |- Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to private repositories. For more information, see "[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)". You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the repository `administration` permission to use this endpoint. tags: - actions operationId: actions/set-workflow-access-to-repository externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/actions-workflow-access-to-repository" examples: default: "$ref": "#/components/examples/actions-workflow-access-to-repository" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: actions subcategory: permissions "/repos/{owner}/{repo}/actions/permissions/selected-actions": get: summary: Get allowed actions and reusable workflows for a repository description: |- Gets the settings for selected actions and reusable workflows 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)." You 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/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-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 and reusable workflows for a repository description: |- Sets the actions and reusable workflows 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)." You 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/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-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/permissions/workflow": get: summary: Get default workflow permissions for a repository description: |- Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, as well as if GitHub Actions can submit approving pull request reviews. For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the repository `administration` permission to use this API. tags: - actions operationId: actions/get-github-actions-default-workflow-permissions-repository externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#get-default-workflow-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-get-default-workflow-permissions" examples: default: "$ref": "#/components/examples/actions-default-workflow-permissions" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: permissions put: summary: Set default workflow permissions for a repository description: |- Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions can submit approving pull request reviews. For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the repository `administration` permission to use this API. tags: - actions operationId: actions/set-github-actions-default-workflow-permissions-repository externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '204': description: Success response '409': description: Conflict response when changing a setting is prevented by the owning organization requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/actions-set-default-workflow-permissions" examples: default: "$ref": "#/components/examples/actions-default-workflow-permissions" x-github: githubCloudOnly: false enabledForGitHubApps: true 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. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-self-hosted-runners-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository parameters: - name: name description: The name of a self-hosted runner. in: query schema: type: string - "$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. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-runner-applications-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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/generate-jitconfig": post: summary: Create configuration for a just-in-time runner for a repository description: |- Generates a configuration that can be passed to the runner application at startup. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/generate-runner-jitconfig-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: type: object required: - name - runner_group_id - labels properties: name: type: string description: The name of the new runner. runner_group_id: type: integer description: The ID of the runner group to register the runner to. labels: type: array minItems: 1 maxItems: 100 items: type: string description: 'The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100.' work_folder: type: string description: The working directory to be used for job execution, relative to the runner install directory. default: _work examples: default: value: name: New runner runner_group_id: 1 labels: - self-hosted - X64 - macOS - no-gpu work_folder: _work responses: '201': "$ref": "#/components/responses/actions_runner_jitconfig" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" 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 using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. Example using registration token: Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. ```config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN``` tags: - actions operationId: actions/create-registration-token-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. Example using remove token: To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. ```config.sh remove --token TOKEN``` tags: - actions operationId: actions/create-remove-token-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/get-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/delete-self-hosted-runner-from-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#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/runners/{runner_id}/labels": get: summary: List labels for a self-hosted runner for a repository description: |- Lists all labels for a self-hosted runner configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/list-labels-for-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/runner-id" responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners post: summary: Add custom labels to a self-hosted runner for a repository description: |- Add custom labels to a self-hosted runner configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/add-custom-labels-to-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/runner-id" requestBody: required: true content: application/json: schema: type: object required: - labels properties: labels: type: array minItems: 1 maxItems: 100 description: The names of the custom labels to add to the runner. items: type: string examples: default: value: labels: - gpu - accelerated responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners put: summary: Set custom labels for a self-hosted runner for a repository description: |- Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/set-custom-labels-for-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/runner-id" requestBody: required: true content: application/json: schema: type: object required: - labels properties: labels: type: array minItems: 0 maxItems: 100 description: The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. items: type: string examples: default: value: labels: - gpu - accelerated responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners delete: summary: Remove all custom labels from a self-hosted runner for a repository description: |- Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/remove-all-custom-labels-from-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/runner-id" responses: '200': "$ref": "#/components/responses/actions_runner_labels_readonly" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: self-hosted-runners "/repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}": delete: summary: Remove a custom label from a self-hosted runner for a repository description: |- Remove a custom label from a self-hosted runner configured in a repository. Returns the remaining labels from the runner. This endpoint returns a `404 Not Found` status if the custom label is not present on the runner. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` permission for repositories and the `organization_self_hosted_runners` permission for organizations. Authenticated users must have admin access to repositories or organizations, or the `manage_runners:enterprise` scope for enterprises, to use these endpoints. tags: - actions operationId: actions/remove-custom-label-from-self-hosted-runner-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/runner-id" - "$ref": "#/components/parameters/runner-label-name" responses: '200': "$ref": "#/components/responses/actions_runner_labels" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" 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/rest/overview/resources-in-the-rest-api#parameters). 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-runs-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#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" - "$ref": "#/components/parameters/workflow-run-check-suite-id" - "$ref": "#/components/parameters/workflow-run-head-sha" 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/rest/actions/workflow-runs#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 private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use this endpoint. operationId: actions/delete-workflow-run tags: - actions externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#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}/approvals": get: summary: Get the review history for a workflow run description: 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-reviews-for-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/environment-approvals" examples: default: "$ref": "#/components/examples/environment-approvals-items" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/runs/{run_id}/approve": post: summary: Approve a workflow run for a fork pull request description: |- Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)." 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/approve-workflow-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" 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/rest/actions/artifacts#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" - "$ref": "#/components/parameters/artifact-name" 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}/attempts/{attempt_number}": get: summary: Get a workflow run attempt description: |- Gets a specific workflow run attempt. 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-attempt externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" - "$ref": "#/components/parameters/attempt-number" - "$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 "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs": get: summary: List jobs for a workflow run attempt description: Lists jobs for a specific workflow run attempt. 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/rest/overview/resources-in-the-rest-api#parameters). tags: - actions operationId: actions/list-jobs-for-workflow-run-attempt externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" - "$ref": "#/components/parameters/attempt-number" - "$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" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-jobs "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs": get: summary: Download workflow run attempt logs description: |- Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. 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/download-workflow-run-attempt-logs externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" - "$ref": "#/components/parameters/attempt-number" 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 "/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/rest/actions/workflow-runs#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: "$ref": "#/components/schemas/empty-object" examples: default: value: '409': "$ref": "#/components/responses/conflict" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule": post: summary: Review custom deployment protection rules for a workflow run description: |- Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment)." **Note:** GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run). If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have read and write permission for **Deployments** to use this endpoint. tags: - actions operationId: actions/review-custom-gates-for-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" requestBody: required: true content: application/json: schema: anyOf: - "$ref": "#/components/schemas/review-custom-gates-comment-required" - "$ref": "#/components/schemas/review-custom-gates-state-required" examples: default: value: environment_name: prod-eus state: approved comment: All health checks passed. responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel": post: summary: Force cancel a workflow run description: |- Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job. You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-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/force-cancel-workflow-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#force-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: "$ref": "#/components/schemas/empty-object" examples: default: value: '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/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/rest/actions/workflow-jobs#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 `Location:` in the response header to find the URL for the download. 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/download-workflow-run-logs externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#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/rest/actions/workflow-runs#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}/pending_deployments": get: summary: Get pending deployments for a workflow run description: |- Get all deployment environments for a workflow run that are waiting for protection rules to pass. 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-pending-deployments-for-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/pending-deployment" examples: default: "$ref": "#/components/examples/pending-deployment-items" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-runs post: summary: Review pending deployments for a workflow run description: |- Approve or reject pending deployments that are waiting on approval by a required reviewer. Required reviewers with read access to the repository contents and deployments can use this endpoint. Required reviewers must authenticate using an access token with the `repo` scope to use this endpoint. tags: - actions operationId: actions/review-pending-deployments-for-run externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" requestBody: required: true content: application/json: schema: type: object properties: environment_ids: type: array description: The list of environment ids to approve or reject example: - 161171787 - 161171795 items: type: integer example: 161171787 state: type: string description: Whether to approve or reject deployment to the specified environments. enum: - approved - rejected example: approved comment: type: string description: A comment to accompany the deployment review example: Ship it! required: - environment_ids - state - comment examples: default: value: environment_ids: - 161171787 state: approved comment: Ship it! responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/deployment" examples: default: "$ref": "#/components/examples/deployment-items" x-github: githubCloudOnly: false enabledForGitHubApps: false 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/rest/actions/workflow-runs#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 properties: enable_debug_logging: type: boolean default: false description: Whether to enable debug logging for the re-run. examples: default: value: responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: x-github: githubCloudOnly: false enabledForGitHubApps: false category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs": post: summary: Re-run failed jobs from a workflow run description: Re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. tags: - actions operationId: actions/re-run-workflow-failed-jobs externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run 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 properties: enable_debug_logging: type: boolean default: false description: Whether to enable debug logging for the re-run. examples: default: value: responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: workflow-runs "/repos/{owner}/{repo}/actions/runs/{run_id}/timing": get: summary: Get workflow run usage description: |- Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". 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-usage externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/run-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/workflow-run-usage" examples: default: "$ref": "#/components/examples/workflow-run-usage" 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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/list-repo-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/get-repo-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/get-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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 [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." 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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/create-or-update-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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/rest/actions/secrets#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: "$ref": "#/components/schemas/empty-object" examples: default: value: '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. Authenticated users must have collaborator access to a repository to create, update, or read secrets. tags: - actions operationId: actions/delete-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/secrets#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/variables": get: summary: List repository variables description: |- Lists all repository variables. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:read` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/list-repo-variables externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#list-repository-variables parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/variables-per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - variables properties: total_count: type: integer variables: type: array items: "$ref": "#/components/schemas/actions-variable" examples: default: "$ref": "#/components/examples/actions-variables-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables post: summary: Create a repository variable description: |- Creates a repository variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:write` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/create-repo-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#create-a-repository-variable 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 variable. value: type: string description: The value of the variable. required: - name - value examples: default: value: name: USERNAME value: octocat responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/repos/{owner}/{repo}/actions/variables/{name}": get: summary: Get a repository variable description: |- Gets a specific variable in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:read` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/get-repo-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#get-a-repository-variable parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/variable-name" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/actions-variable" examples: default: "$ref": "#/components/examples/actions-variable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables patch: summary: Update a repository variable description: |- Updates a repository variable that you can reference in a GitHub Actions workflow. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:write` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/update-repo-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#update-a-repository-variable parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/variable-name" requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: The name of the variable. value: type: string description: The value of the variable. examples: default: value: name: USERNAME value: octocat responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables delete: summary: Delete a repository variable description: |- Deletes a repository variable using the variable name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions_variables:write` repository permission to use this endpoint. Authenticated users must have collaborator access to a repository to create, update, or read variables. tags: - actions operationId: actions/delete-repo-variable externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/variable-name" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: actions subcategory: variables "/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/rest/actions/workflows#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/rest/actions/workflows#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`. 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/disable-workflow externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflows#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`. You 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)." 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. 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/rest/actions/workflows#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: true 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`. 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/enable-workflow externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflows#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 for a workflow 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/rest/overview/resources-in-the-rest-api#parameters). 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. tags: - actions operationId: actions/list-workflow-runs externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow 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" - "$ref": "#/components/parameters/workflow-run-check-suite-id" - "$ref": "#/components/parameters/workflow-run-head-sha" 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/workflows/{workflow_id}/timing": get: summary: Get workflow usage description: |- Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". 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-usage externalDocs: description: API method documentation url: https://docs.github.com/rest/actions/workflows#get-workflow-usage 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-usage" examples: default: "$ref": "#/components/examples/workflow-usage" x-github: githubCloudOnly: false enabledForGitHubApps: false category: actions subcategory: workflows "/repos/{owner}/{repo}/activity": get: summary: List repository activities description: |- Lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users. For more information about viewing repository activity, see "[Viewing repository activity](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/viewing-repository-activity)." tags: - repos operationId: repos/list-activities externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#list-repository-activities parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/direction" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - name: ref description: |- The Git reference for the activities you want to list. The `ref` for a branch can be formatted either as `refs/heads/BRANCH_NAME` or `BRANCH_NAME`, where `BRANCH_NAME` is the name of your branch. in: query required: false schema: type: string - name: actor description: The GitHub username to use to filter by the actor who performed the activity. in: query required: false schema: type: string - name: time_period description: |- The time period to filter by. For example, `day` will filter for activity that occurred in the past 24 hours, and `week` will filter for activity that occurred in the past 7 days (168 hours). in: query required: false schema: type: string enum: - day - week - month - quarter - year - name: activity_type description: |- The activity type to filter by. For example, you can choose to filter by "force_push", to see all force pushes to the repository. in: query required: false schema: type: string enum: - push - force_push - branch_creation - branch_deletion - pr_merge - merge_queue_merge responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/activity" examples: default: "$ref": "#/components/examples/activity-items" headers: Link: "$ref": "#/components/headers/link" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: repos "/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/rest/issues/assignees#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. If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. Otherwise 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/rest/issues/assignees#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}/autolinks": get: summary: List all autolinks of a repository description: |- This returns a list of autolinks configured for the given repository. Information about autolinks are only available to repository administrators. tags: - repos operationId: repos/list-autolinks externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/autolink" examples: default: "$ref": "#/components/examples/autolink-items" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: autolinks post: summary: Create an autolink reference for a repository description: Users with admin access to the repository can create an autolink. tags: - repos operationId: repos/create-autolink externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: type: object properties: key_prefix: type: string description: This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. url_template: type: string description: The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. is_alphanumeric: type: boolean default: true description: Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. required: - key_prefix - url_template examples: default: value: key_prefix: TICKET- url_template: https://example.com/TICKET?query= is_alphanumeric: true responses: '201': description: response content: application/json: schema: "$ref": "#/components/schemas/autolink" examples: default: "$ref": "#/components/examples/autolink" headers: Location: example: https://api.github.com/repos/octocat/Hello-World/autolinks/1 schema: type: string '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: autolinks "/repos/{owner}/{repo}/autolinks/{autolink_id}": get: summary: Get an autolink reference of a repository description: |- This returns a single autolink reference by ID that was configured for the given repository. Information about autolinks are only available to repository administrators. tags: - repos operationId: repos/get-autolink externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/autolink-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/autolink" examples: default: "$ref": "#/components/examples/autolink" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: autolinks delete: summary: Delete an autolink reference from a repository description: |- This deletes a single autolink reference by ID that was configured for the given repository. Information about autolinks are only available to repository administrators. tags: - repos operationId: repos/delete-autolink externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/autolink-id" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: autolinks "/repos/{owner}/{repo}/automated-security-fixes": get: summary: Check if automated security fixes are enabled for a repository description: Shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". tags: - repos operationId: repos/check-automated-security-fixes externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response if dependabot is enabled content: application/json: schema: "$ref": "#/components/schemas/check-automated-security-fixes" examples: default: value: enabled: true paused: false '404': description: Not Found if dependabot is not enabled for the repository x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: repos put: summary: Enable automated security fixes description: Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". tags: - repos operationId: repos/enable-automated-security-fixes externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: repos delete: summary: Disable automated security fixes description: Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/articles/configuring-automated-security-fixes)". tags: - repos operationId: repos/disable-automated-security-fixes externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: repos "/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/rest/branches/branches#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: branches 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/rest/branches/branches#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" examples: default: "$ref": "#/components/examples/branch-get" '301': "$ref": "#/components/responses/moved_permanently" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: branches 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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Protecting a branch requires admin or owner permissions to the repository. **Note**: Passing new arrays of `users` and `teams` replaces their previous values. **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/rest/branches/branch-protection#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 or 0 to not require reviewers. require_last_push_approval: type: boolean description: 'Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`.' default: false bypass_pull_request_allowances: type: object description: Allow specific users, teams, or apps to bypass pull request requirements. properties: users: type: array description: The list of user `login`s allowed to bypass pull request requirements. items: type: string teams: type: array description: The list of team `slug`s allowed to bypass pull request requirements. items: type: string apps: type: array description: The list of app `slug`s allowed to bypass pull request requirements. items: type: string 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/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/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`.' lock_branch: type: boolean description: 'Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`.' default: false allow_fork_syncing: type: boolean description: 'Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`.' default: false 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 require_last_push_approval: true 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 lock_branch: true allow_fork_syncing: true responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/protected-branch" examples: default: "$ref": "#/components/examples/branch-protection-update" '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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Adding 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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Removing 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. **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/rest/branches/branch-protection#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 or 0 to not require reviewers. require_last_push_approval: type: boolean description: 'Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`' default: false bypass_pull_request_allowances: type: object description: Allow specific users, teams, or apps to bypass pull request requirements. properties: users: type: array description: The list of user `login`s allowed to bypass pull request requirements. items: type: string teams: type: array description: The list of team `slug`s allowed to bypass pull request requirements. items: type: string apps: type: array description: The list of app `slug`s allowed to bypass pull request requirements. items: type: string 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 require_last_push_approval: true 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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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. When 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. **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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. When 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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. When 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Updating 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/rest/branches/branch-protection#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: "**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. 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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: The name of the status checks items: type: string required: - contexts example: contexts: - contexts - type: array description: The name of the status checks items: type: string examples: default: summary: Example adding status checks to a branch protection rule value: contexts: - continuous-integration/travis-ci - continuous-integration/jenkins 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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: The name of the status checks items: type: string required: - contexts example: contexts: - contexts - type: array description: The name of the status checks items: type: string examples: default: summary: Example updating status checks for a branch protection rule value: contexts: - continuous-integration/travis-ci 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: branches subcategory: branch-protection 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/rest/branches/branch-protection#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: The name of the status checks items: type: string required: - contexts example: contexts: - contexts - type: array description: The name of the status checks items: type: string examples: default: summary: Example removing status checks from a branch protection rule value: contexts: - continuous-integration/jenkins 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: branches subcategory: branch-protection "/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. Lists who has access to this protected branch. **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/rest/branches/branch-protection#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: branches subcategory: branch-protection 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. Disables 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/rest/branches/branch-protection#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: branches subcategory: branch-protection "/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. Lists 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/rest/branches/branch-protection#get-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: branches subcategory: branch-protection 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. Grants 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. tags: - repos operationId: repos/add-app-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: 'The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items.' items: type: string required: - apps example: apps: - my-app - type: array items: type: string examples: default: value: apps: - octoapp 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: branches subcategory: branch-protection 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. Replaces 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. tags: - repos operationId: repos/set-app-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: 'The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items.' items: type: string required: - apps example: apps: - my-app - type: array items: type: string examples: default: value: apps: - octoapp 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: branches subcategory: branch-protection 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. Removes 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. tags: - repos operationId: repos/remove-app-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: 'The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items.' items: type: string required: - apps example: apps: - my-app - type: array items: type: string examples: default: value: apps: - my-app 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: branches subcategory: branch-protection "/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. Lists 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/rest/branches/branch-protection#get-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: branches subcategory: branch-protection 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. Grants the specified teams push access for this branch. You can also give push access to child teams. tags: - repos operationId: repos/add-team-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: The slug values for teams items: type: string required: - teams example: teams: - my-team - type: array description: The slug values for teams items: type: string examples: default: summary: Example adding a team in a branch protection rule value: teams: - justice-league 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: branches subcategory: branch-protection 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. Replaces 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. tags: - repos operationId: repos/set-team-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: The slug values for teams items: type: string required: - teams example: teams: - justice-league - type: array description: The slug values for teams items: type: string examples: default: summary: Example replacing a team in a branch protection rule value: teams: - justice-league 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: branches subcategory: branch-protection 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. Removes the ability of a team to push to this branch. You can also remove push access for child teams. tags: - repos operationId: repos/remove-team-access-restrictions externalDocs: description: API method documentation url: https://docs.github.com/rest/branches/branch-protection#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: The slug values for teams items: type: string required: - teams example: teams: - my-team - type: array description: The slug values for teams items: type: string examples: default: summary: Example removing a team in a branch protection rule value: teams: - octocats 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: branches subcategory: branch-protection "/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. Lists 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/rest/branches/branch-protection#get-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: branches subcategory: branch-protection 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. Grants the specified people push access for this branch. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | `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/rest/branches/branch-protection#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: The username for users items: type: string required: - users example: users: - mona - type: array items: type: string examples: default: summary: Example adding a user in a branch protection rule value: users: - octocat 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: branches subcategory: branch-protection 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. Replaces 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. | Type | Description | | ------- | ----------------------------------------------------------------------------------------------------------------------------- | | `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/rest/branches/branch-protection#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: The username for users items: type: string required: - users example: users: - mona - type: array items: type: string examples: default: summary: Example replacing a user in a branch protection rule value: users: - octocat 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: branches subcategory: branch-protection 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. Removes the ability of a user to push to this branch. | Type | Description | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | `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/rest/branches/branch-protection#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: The username for users items: type: string required: - users example: users: - mona - type: array items: type: string examples: default: summary: Example removing a user in a branch protection rule value: users: - octocat 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: branches subcategory: branch-protection "/repos/{owner}/{repo}/branches/{branch}/rename": post: summary: Rename a branch description: |- Renames a branch in a repository. **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/github/administering-a-repository/renaming-a-branch)". The permissions required to use this endpoint depends on whether you are renaming the default branch. To rename a non-default branch: * Users must have push access. * GitHub Apps must have the `contents:write` repository permission. To rename the default branch: * Users must have admin or owner permissions. * 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/rest/branches/branches#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: branches 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. Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. In 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/rest/checks/runs#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. 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. **Maximum length**: 65535 characters.' text: type: string maxLength: 65535 description: 'The details of the check run. This parameter supports Markdown. **Maximum length**: 65535 characters.' 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/rest/checks/runs#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. GitHub Actions are limited to 10 warning annotations and 10 error annotations per step. For details about how you can view annotations on GitHub, see "[About status checks](https://docs.github.com/articles/about-status-checks#checks)". 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. Line numbers start at 1. 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. Column numbers start at 1. 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. 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/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-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. Gets 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/rest/checks/runs#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: |- Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs. **Note:** The endpoints to manage checks only look 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. tags: - checks operationId: checks/update externalDocs: description: API method documentation url: https://docs.github.com/rest/checks/runs#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. 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/rest/checks/runs#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. GitHub Actions are limited to 10 warning annotations and 10 error annotations per step. For details about annotations in the UI, see "[About status checks](https://docs.github.com/articles/about-status-checks#checks)". 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. Line numbers start at 1. 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. Column numbers start at 1. 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. 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. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-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/rest/checks/runs#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-runs/{check_run_id}/rerequest": post: summary: Rerequest a check run description: |- Triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. To rerequest a check run, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)". tags: - checks operationId: checks/rerequest-run externalDocs: description: API method documentation url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/check-run-id" responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '403': description: Forbidden if the check run is not rerequestable or doesn't belong to the authenticated GitHub App content: application/json: schema: "$ref": "#/components/schemas/basic-error" '422': description: Validation error if the check run is not rerequestable content: application/json: schema: "$ref": "#/components/schemas/basic-error" '404': "$ref": "#/components/responses/not_found" 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`. By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/checks/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/rest/checks/suites#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/rest/checks/suites#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/rest/checks/suites#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/rest/checks/suites#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. 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`. Gets 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/rest/checks/suites#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: |- Lists 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. **Note:** The endpoints to manage checks only look 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. tags: - checks operationId: checks/list-for-suite externalDocs: description: API method documentation url: https://docs.github.com/rest/checks/runs#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/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. To rerequest a check suite, your GitHub App must have the `checks:write` 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/rest/checks/suites#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: "$ref": "#/components/schemas/empty-object" examples: default: value: 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 code scanning alerts. To use this endpoint, you must use an access token with the `security_events` scope or, for alerts from public repositories only, an access token with the `public_repo` scope. GitHub Apps must have the `security_events` read permission to use this endpoint. The response includes a `most_recent_instance` object. This provides details of the most recent instance of this alert for the default branch (or for the specified Git reference 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/rest/code-scanning/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" - "$ref": "#/components/parameters/direction" - name: sort description: The property by which to sort the results. in: query required: false schema: type: string enum: - created - updated default: created - name: state description: If specified, only code scanning alerts with this state will be returned. in: query required: false schema: "$ref": "#/components/schemas/code-scanning-alert-state-query" - name: severity description: If specified, only code scanning alerts with this severity will be returned. in: query required: false schema: "$ref": "#/components/schemas/code-scanning-alert-severity" 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" '304': "$ref": "#/components/responses/not_modified" '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: code-scanning "/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 with private repos, the `public_repo` scope also grants permission to read security events on public repos only. GitHub Apps must have the `security_events` read permission to use this endpoint. tags: - code-scanning operationId: code-scanning/get-alert externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/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" '304': "$ref": "#/components/responses/not_modified" '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: code-scanning 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 with private repositories. You can also use tokens with the `public_repo` scope for public repositories only. 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/rest/code-scanning/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" dismissed_comment: "$ref": "#/components/schemas/code-scanning-alert-dismissed-comment" 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 subcategory: 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 with private repos, the `public_repo` scope also grants permission to read security events on public repos only. 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/rest/code-scanning/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: code-scanning "/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, starting with the most recent. The response is paginated and you can use the `page` and `per_page` parameters to list the analyses you're interested in. By default 30 analyses are listed per page. The `rules_count` field in the response give the number of rules that were run in the analysis. For very old analyses this data is not available, and `0` is returned in this field. You must use an access token with the `security_events` scope to use this endpoint with private repos, the `public_repo` scope also grants permission to read security events on public repos only. GitHub Apps must have the `security_events` read permission to use this endpoint. **Deprecation notice**: The `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/rest/code-scanning/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" - "$ref": "#/components/parameters/direction" - name: sort description: The property by which to sort the results. in: query required: false schema: type: string enum: - created default: created 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 subcategory: 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. You must use an access token with the `security_events` scope to use this endpoint with private repos, the `public_repo` scope also grants permission to read security events on public repos only. GitHub Apps must have the `security_events` read permission to use this endpoint. The default JSON response contains fields that describe the analysis. This includes the Git reference and commit SHA to which the analysis relates, the datetime of the analysis, the name of the code scanning tool, and the number of alerts. The `rules_count` field in the default response give the number of rules that were run in the analysis. For very old analyses this data is not available, and `0` is returned in this field. If you use the Accept header `application/sarif+json`, the response contains the analysis data that was uploaded. This is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). operationId: code-scanning/get-analysis tags: - code-scanning externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/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 subcategory: code-scanning delete: summary: Delete a code scanning analysis from a repository description: |- Deletes a specified code scanning analysis from a repository. For private repositories, you must use an access token with the `repo` scope. For public repositories, you must use an access token with `public_repo` scope. GitHub Apps must have the `security_events` write permission to use this endpoint. You can delete one analysis at a time. To delete a series of analyses, start with the most recent analysis and work backwards. Conceptually, the process is similar to the undo function in a text editor. When you list the analyses for a repository, one or more will be identified as deletable in the response: ``` "deletable": true ``` An analysis is deletable when it's the most recent in a set of analyses. Typically, a repository will have multiple sets of analyses for each enabled code scanning tool, where a set is determined by a unique combination of analysis values: * `ref` * `tool` * `category` If you attempt to delete an analysis that is not the most recent in a set, you'll get a 400 response with the message: ``` Analysis specified is not deletable. ``` The response from a successful `DELETE` operation provides you with two alternative URLs for deleting the next analysis in the set: `next_analysis_url` and `confirm_delete_url`. Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis in a set. This is a useful option if you want to preserve at least one analysis for the specified tool in your repository. Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url` in the 200 response is `null`. As an example of the deletion process, let's imagine that you added a workflow that configured a particular code scanning tool to analyze the code in a repository. This tool has added 15 analyses: 10 on the default branch, and another 5 on a topic branch. You therefore have two separate sets of analyses for this tool. You've now decided that you want to remove all of the analyses for the tool. To do this you must make 15 separate deletion requests. To start, you must find an analysis that's identified as deletable. Each set of analyses always has one that's identified as deletable. Having found the deletable analysis for one of the two sets, delete this analysis and then continue deleting the next analysis in the set until they're all deleted. Then repeat the process for the second set. The procedure therefore consists of a nested loop: **Outer loop**: * List the analyses for the repository, filtered by tool. * Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration. The 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/rest/code-scanning/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 subcategory: code-scanning "/repos/{owner}/{repo}/code-scanning/codeql/databases": get: summary: List CodeQL databases for a repository description: |- Lists the CodeQL databases that are available in a repository. For private repositories, you must use an access token with the `security_events` scope. For public repositories, you can use tokens with the `security_events` or `public_repo` scope. GitHub Apps must have the `contents` read permission to use this endpoint. tags: - code-scanning operationId: code-scanning/list-codeql-databases externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-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/code-scanning-codeql-database" examples: default: "$ref": "#/components/examples/code-scanning-codeql-databases" '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 previews: [] category: code-scanning subcategory: code-scanning "/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}": get: summary: Get a CodeQL database for a repository description: |- Gets a CodeQL database for a language in a repository. By default this endpoint returns JSON metadata about the CodeQL database. To download the CodeQL database binary content, set the `Accept` header of the request to [`application/zip`](https://docs.github.com/rest/overview/media-types), and make sure your HTTP client is configured to follow redirects or use the `Location` header to make a second request to get the redirect URL. For private repositories, you must use an access token with the `security_events` scope. For public repositories, you can use tokens with the `security_events` or `public_repo` scope. GitHub Apps must have the `contents` read permission to use this endpoint. tags: - code-scanning operationId: code-scanning/get-codeql-database externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: language in: path description: The language of the CodeQL database. schema: type: string required: true responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/code-scanning-codeql-database" examples: default: "$ref": "#/components/examples/code-scanning-codeql-database" '302': "$ref": "#/components/responses/found" '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 previews: [] category: code-scanning subcategory: code-scanning "/repos/{owner}/{repo}/code-scanning/default-setup": get: summary: Get a code scanning default setup configuration description: |- Gets a code scanning default setup configuration. You must use an access token with the `repo` scope to use this endpoint with private repos or the `public_repo` scope for public repos. GitHub Apps must have the `repo` write permission to use this endpoint. tags: - code-scanning operationId: code-scanning/get-default-setup externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/code-scanning-default-setup" examples: default: "$ref": "#/components/examples/code-scanning-default-setup" '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: code-scanning patch: summary: Update a code scanning default setup configuration description: |- Updates a code scanning default setup configuration. You must use an access token with the `repo` scope to use this endpoint with private repos or the `public_repo` scope for public repos. GitHub Apps must have the `repo` write permission to use this endpoint. tags: - code-scanning operationId: code-scanning/update-default-setup externalDocs: description: API method documentation url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/code-scanning-default-setup-update" examples: default: "$ref": "#/components/examples/code-scanning-default-setup-update" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/empty-object" examples: default: value: '202': description: Response content: application/json: schema: "$ref": "#/components/schemas/code-scanning-default-setup-update-response" examples: default: "$ref": "#/components/examples/code-scanning-default-setup-update-response" '403': "$ref": "#/components/responses/code_scanning_forbidden_write" '404': "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/code_scanning_conflict" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: code-scanning subcategory: 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 for private repositories. You can also use tokens with the `public_repo` scope for public repositories only. GitHub Apps must have the `security_events` write permission to use this endpoint. For troubleshooting information, see \"[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif).\"\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 number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.\nTo get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see \"[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit).\"\n\n\n| **SARIF data** | **Maximum values** | **Additional limits** \ |\n|----------------------------------|:------------------:|----------------------------------------------------------------------------------|\n| Runs per file | 20 | |\n| Results per run | 25,000 | Only the top 5,000 results will be included, prioritized by severity. |\n| Rules per run | 25,000 | |\n| Tool extensions per run | 100 | |\n| Thread Flow Locations per result | 10,000 | Only the top 1,000 Thread Flow Locations will be included, using prioritization. |\n| Location per result\t | 1,000 | Only 100 locations will be included. |\n| Tags per rule\t \ | 20 | Only 10 tags will be included. |\n\n\nThe `202 Accepted` response includes an `id` value.\nYou can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.\nFor more information, see \"[Get information about a SARIF upload](/rest/code-scanning/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/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data 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. This 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 validate: description: |- Whether the SARIF file will be validated according to the code scanning specifications. This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning. type: boolean 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 subcategory: 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/code-scanning/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 with private repos, the `public_repo` scope also grants permission to read security events on public repos only. 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/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload 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 subcategory: code-scanning "/repos/{owner}/{repo}/codeowners/errors": get: summary: List CODEOWNERS errors description: |- List any syntax errors that are detected in the CODEOWNERS file. For more information about the correct CODEOWNERS syntax, see "[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." tags: - repos operationId: repos/codeowners-errors externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#list-codeowners-errors parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: ref description: 'A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. Default: the repository''s default branch (e.g. `main`)' in: query required: false schema: type: string responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/codeowners-errors" examples: default: "$ref": "#/components/examples/codeowners-errors" '404': description: Resource not found x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: repos subcategory: repos "/repos/{owner}/{repo}/codespaces": get: summary: List codespaces in a repository for the authenticated user description: |- Lists the codespaces associated to a specified repository and the authenticated user. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have read access to the `codespaces` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/list-in-repository-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - codespaces properties: total_count: type: integer codespaces: type: array items: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespaces-list-for-repository" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: codespaces post: summary: Create a codespace in a repository description: |- Creates a codespace owned by the authenticated user in the specified repository. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/create-with-repo-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: type: object nullable: true properties: ref: description: Git ref (typically a branch name) for this codespace type: string location: description: The requested location for a new codespace. Best efforts are made to respect this upon creation. Assigned by IP if not provided. type: string geo: description: The geographic area for this codespace. If not specified, the value is assigned by IP. This property replaces `location`, which is being deprecated. type: string enum: - EuropeWest - SoutheastAsia - UsEast - UsWest client_ip: description: IP for location auto-detection when proxying a request type: string machine: description: Machine type to use for this codespace type: string devcontainer_path: description: Path to devcontainer.json config to use for this codespace type: string multi_repo_permissions_opt_out: description: Whether to authorize requested permissions from devcontainer.json type: boolean working_directory: description: Working directory for this codespace type: string idle_timeout_minutes: description: Time in minutes before codespace stops from inactivity type: integer display_name: description: Display name for this codespace type: string retention_period_minutes: description: Duration in minutes after codespace has gone idle in which it will be deleted. Must be integer minutes between 0 and 43200 (30 days). type: integer examples: default: value: ref: main machine: standardLinux32gb responses: '201': description: Response when the codespace was successfully created content: application/json: schema: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespace" '202': description: Response when the codespace creation partially failed but is being retried in the background content: application/json: schema: "$ref": "#/components/schemas/codespace" examples: default: "$ref": "#/components/examples/codespace" '400': "$ref": "#/components/responses/bad_request" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: codespaces "/repos/{owner}/{repo}/codespaces/devcontainers": get: summary: List devcontainer configurations in a repository for the authenticated user description: |- Lists the devcontainer.json files associated with a specified repository and the authenticated user. These files specify launchpoint configurations for codespaces created within the repository. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have read access to the `codespaces_metadata` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/list-devcontainers-in-repository-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user parameters: - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: type: object required: - total_count - devcontainers properties: total_count: type: integer devcontainers: type: array items: type: object required: - path properties: path: type: string name: type: string display_name: type: string examples: default: "$ref": "#/components/examples/codespaces-list-devcontainers-for-repository" '500': "$ref": "#/components/responses/internal_error" '400': "$ref": "#/components/responses/bad_request" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: codespaces "/repos/{owner}/{repo}/codespaces/machines": get: summary: List available machine types for a repository description: |- List the machine types available for a given repository based on its configuration. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have write access to the `codespaces_metadata` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/repo-machines-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: location description: The location to check for available machines. Assigned by IP if not provided. in: query schema: type: string example: WestUs2 - name: client_ip description: IP for location auto-detection when proxying a request in: query schema: type: string - name: ref description: The branch or commit to check for prebuild availability and devcontainer restrictions. in: query schema: type: string example: main responses: '200': description: Response content: application/json: schema: type: object required: - total_count - machines properties: total_count: type: integer machines: type: array items: "$ref": "#/components/schemas/codespace-machine" examples: default: "$ref": "#/components/examples/codespace-machines-list" '304': "$ref": "#/components/responses/not_modified" '500': "$ref": "#/components/responses/internal_error" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: machines "/repos/{owner}/{repo}/codespaces/new": get: summary: Get default attributes for a codespace description: |- Gets the default attributes for codespaces created by the user with the repository. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/pre-flight-with-repo-for-authenticated-user externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: ref description: The branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked. in: query schema: type: string example: main - name: client_ip description: An alternative IP for default location auto-detection, such as when proxying a request. in: query schema: type: string example: 1.2.3.4 responses: '200': description: Response when a user is able to create codespaces from the repository. content: application/json: schema: type: object properties: billable_owner: "$ref": "#/components/schemas/simple-user" defaults: type: object required: - location - devcontainer_path properties: location: type: string devcontainer_path: type: string nullable: true examples: default: "$ref": "#/components/examples/codespaces-default-attributes-for-a-codespace" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: codespaces "/repos/{owner}/{repo}/codespaces/permissions_check": get: summary: Check if permissions defined by a devcontainer have been accepted by the authenticated user description: |- Checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user. You must authenticate using an access token with the `codespace` scope to use this endpoint. GitHub Apps must have write access to the `codespaces` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/check-permissions-for-devcontainer externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: ref description: The git reference that points to the location of the devcontainer configuration to use for the permission check. The value of `ref` will typically be a branch name (`heads/BRANCH_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. in: query required: true schema: type: string example: master - name: devcontainer_path description: Path to the devcontainer.json configuration to use for the permission check. in: query required: true schema: type: string example: ".devcontainer/example/devcontainer.json" responses: '200': description: Response when the permission check is successful content: application/json: schema: "$ref": "#/components/schemas/codespaces-permissions-check-for-devcontainer" examples: default: "$ref": "#/components/examples/codespaces-permissions-check-for-devcontainer" '401': "$ref": "#/components/responses/requires_authentication" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: codespaces "/repos/{owner}/{repo}/codespaces/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 write access to the `codespaces_secrets` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/list-repo-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/repository-secrets#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/repo-codespaces-secret" examples: default: "$ref": "#/components/examples/repo-codespaces-secret-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: repository-secrets "/repos/{owner}/{repo}/codespaces/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 write access to the `codespaces_secrets` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/get-repo-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/repository-secrets#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/codespaces-public-key" examples: default: "$ref": "#/components/examples/codespaces-public-key" x-github: githubCloudOnly: false enabledForGitHubApps: false category: codespaces subcategory: repository-secrets "/repos/{owner}/{repo}/codespaces/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 write access to the `codespaces_secrets` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/get-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/repository-secrets#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/repo-codespaces-secret" examples: default: "$ref": "#/components/examples/repo-codespaces-secret" x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: repository-secrets put: summary: Create or update a repository secret description: |- Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have write access to the `codespaces_secrets` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/create-or-update-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/repository-secrets#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/rest/codespaces/repository-secrets#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: "$ref": "#/components/schemas/empty-object" examples: default: value: '204': description: Response when updating a secret x-github: githubCloudOnly: false enabledForGitHubApps: true category: codespaces subcategory: repository-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 write access to the `codespaces_secrets` repository permission to use this endpoint. tags: - codespaces operationId: codespaces/delete-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/codespaces/repository-secrets#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: codespaces subcategory: repository-secrets "/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. Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint. Team members will include the members of child teams. You must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this endpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this endpoint. tags: - repos operationId: repos/list-collaborators externalDocs: description: API method documentation url: https://docs.github.com/rest/collaborators/collaborators#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 - name: permission description: Filter collaborators by the permissions they have on the repository. If not specified, all collaborators will be returned. in: query required: false schema: type: string enum: - pull - triage - push - maintain - admin - "$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: collaborators 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. Team members will include the members of child teams. You must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this endpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this endpoint. tags: - repos operationId: repos/check-collaborator externalDocs: description: API method documentation url: https://docs.github.com/rest/collaborators/collaborators#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: collaborators subcategory: collaborators put: summary: Add a repository collaborator description: |- This endpoint triggers [notifications](https://docs.github.com/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/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/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: ``` Cannot assign {member} permission of {role name} ``` 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/rest/overview/resources-in-the-rest-api#http-verbs)." The 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 [API](https://docs.github.com/rest/collaborators/invitations). **Updating an existing collaborator's permission level** The 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. **Rate limits** You 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/rest/collaborators/collaborators#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.** We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any.' 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: - an existing collaborator is added as a collaborator - an organization member is added as an individual collaborator - 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: collaborators subcategory: collaborators delete: summary: Remove a repository collaborator description: |- Removes a collaborator from a repository. To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal. This endpoint also: - Cancels any outstanding invitations - Unasigns the user from any issues - Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories. - Unstars the repository - Updates access permissions to packages Removing a user as a collaborator has the following effects on forks: - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork. - If the user had their own fork of the repository, the fork will be deleted. - If the user still has read access to the repository, open pull requests by this user from a fork will be denied. **Note**: A user can still have access to the repository through organization permissions like base repository permissions. Although the API responds immediately, the additional permission updates might take some extra time to complete in the background. For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)". tags: - repos operationId: repos/remove-collaborator externalDocs: description: API method documentation url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/username" responses: '204': description: No Content when collaborator was removed from the repository. '422': "$ref": "#/components/responses/validation_failed" '403': "$ref": "#/components/responses/forbidden" x-github: githubCloudOnly: false enabledForGitHubApps: true category: collaborators 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`. *Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the `maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to the collaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The `permissions` hash can also be used to determine which base level of access the collaborator has to the repository. tags: - repos operationId: repos/get-collaborator-permission-level externalDocs: description: API method documentation url: https://docs.github.com/rest/collaborators/collaborators#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: collaborators 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/rest/overview/media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). Comments are ordered by ascending ID. tags: - repos operationId: repos/list-commit-comments-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/commits/comments#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: commits subcategory: comments "/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/rest/commits/comments#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: commits subcategory: comments patch: summary: Update a commit comment description: '' tags: - repos operationId: repos/update-commit-comment externalDocs: description: API method documentation url: https://docs.github.com/rest/commits/comments#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: commits 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/rest/commits/comments#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: commits 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/rest/commits/comments#get-a-commit-comment). tags: - reactions operationId: reactions/list-for-commit-comment externalDocs: description: API method documentation url: https://docs.github.com/rest/reactions/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/rest/reactions/reactions#about-reactions). 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 subcategory: reactions post: summary: Create reaction for a commit comment description: Create a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). 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/rest/reactions/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/rest/reactions/reactions#about-reactions) 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" x-github: githubCloudOnly: false enabledForGitHubApps: true category: reactions subcategory: 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`. Delete a reaction to a [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment). tags: - reactions operationId: reactions/delete-for-commit-comment externalDocs: description: API method documentation url: https://docs.github.com/rest/reactions/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 subcategory: reactions "/repos/{owner}/{repo}/commits": get: summary: List commits description: |- **Signature verification object** The 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: | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. | These are the possible values for `reason` in the `verification` object: | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `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/rest/commits/commits#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 `main`).' 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 username or email address to use to filter by commit author. in: query required: false schema: type: string - name: committer description: GitHub username or email address to use to filter by commit committer. 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: commits 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. Returns 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/rest/commits/commits#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: commits subcategory: commits "/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/rest/commits/comments#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: commits subcategory: comments post: summary: Create a commit comment description: |- Create a comment for a commit using its `:commit_sha`. This endpoint triggers [notifications](https://docs.github.com/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/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/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/rest/commits/comments#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: commits 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, will only return open pull requests associated with the commit. To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. tags: - repos operationId: repos/list-pull-requests-associated-with-commit externalDocs: description: API method documentation url: https://docs.github.com/rest/commits/commits#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: commits subcategory: commits "/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. **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. You can pass the appropriate [media type](https://docs.github.com/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. To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/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. **Signature verification object** The 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: | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. | These are the possible values for `reason` in the `verification` object: | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `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/rest/commits/commits#get-a-commit parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/commit-ref" 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" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: commits subcategory: commits "/repos/{owner}/{repo}/commits/{ref}/check-runs": get: summary: List check runs for a Git reference description: |- Lists 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. **Note:** The endpoints to manage checks only look 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. If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint. tags: - checks operationId: checks/list-for-ref externalDocs: description: API method documentation url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/commit-ref" - "$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: |- Lists 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. **Note:** The endpoints to manage checks only look 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`. tags: - checks operationId: checks/list-suites-for-ref externalDocs: description: API method documentation url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/commit-ref" - 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. Additionally, a combined `state` is returned. The `state` is one of: * **failure** if any of the contexts report as `error` or `failure` * **pending** if there are no statuses or a context is `pending` * **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/rest/commits/statuses#get-the-combined-status-for-a-specific-reference parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/commit-ref" - "$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: commits 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. This 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/rest/commits/statuses#list-commit-statuses-for-a-reference parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/commit-ref" - "$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: commits subcategory: statuses "/repos/{owner}/{repo}/community/profile": get: summary: Get community profile metrics description: |- Returns all community profile metrics for a repository. The repository cannot be a fork. The returned metrics include an overall health score, the repository description, the presence of documentation, the detected code of conduct, the detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, README, and CONTRIBUTING files. The `health_percentage` score is defined as a percentage of how many of the recommended community health files are present. For more information, see "[About community profiles for public repositories](https://docs.github.com/communities/setting-up-your-project-for-healthy-contributions/about-community-profiles-for-public-repositories)." `content_reports_enabled` is only returned for organization-owned repositories. tags: - repos operationId: repos/get-community-profile-metrics externalDocs: description: API method documentation url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/community-profile" examples: default: "$ref": "#/components/examples/community-profile" x-github: githubCloudOnly: false enabledForGitHubApps: true category: metrics subcategory: community "/repos/{owner}/{repo}/compare/{basehead}": get: summary: Compare two commits description: |- Compares two commits against one another. You can compare branches in the same repository, or you can compare branches that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)." This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order. You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. The API response includes details about the files that were changed between the two commits. This includes the status of the change (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. When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison. **Working with large comparisons** To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination: - The list of changed files is only shown on the first page of results, but it includes all changed files for the entire comparison. - The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results. For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api)." **Signature verification object** The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields: | Name | Type | Description | | ---- | ---- | ----------- | | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | | `signature` | `string` | The signature that was extracted from the commit. | | `payload` | `string` | The value that was signed. | These are the possible values for `reason` in the `verification` object: | Value | Description | | ----- | ----------- | | `expired_key` | The key that made the signature is expired. | | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | | `gpgverify_error` | There was an error communicating with the signature verification service. | | `gpgverify_unavailable` | The signature verification service is currently unavailable. | | `unsigned` | The object does not include a signature. | | `unknown_signature_type` | A non-PGP signature was found in the commit. | | `no_user` | No user was associated with the `committer` email address in the commit. | | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. | | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | | `unknown_key` | The key that made the signature has not been registered with any user's account. | | `malformed_signature` | There was an error parsing the signature. | | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | | `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/rest/commits/commits#compare-two-commits parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/page" - "$ref": "#/components/parameters/per-page" - name: basehead description: The base branch and head branch to compare. This parameter expects the format `BASE...HEAD`. Both must be branch names in `repo`. To compare with a branch that exists in a different repository in the same network as `repo`, the `basehead` parameter expects the format `USERNAME:BASE...USERNAME:HEAD`. in: path required: true x-multi-segment: true schema: type: string responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/commit-comparison" examples: default: "$ref": "#/components/examples/commit-comparison" '404': "$ref": "#/components/responses/not_found" '500': "$ref": "#/components/responses/internal_error" '503': "$ref": "#/components/responses/service_unavailable" x-github: githubCloudOnly: false enabledForGitHubApps: true category: commits subcategory: commits "/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/rest/overview/media-types) for\nretrieving the raw content or rendered HTML (when supported). All content types support [a custom media\ntype](https://docs.github.com/rest/overview/media-types) to ensure the content is returned in a consistent\nobject format.\n\n**Notes**:\n* \ To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/git/trees#get-a-tree).\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/rest/git/trees#get-a-tree).\n * Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.\n Size limits:\nIf the requested file's size is:\n* 1 MB or smaller: All features of this endpoint are supported.\n* Between 1-100 MB: Only the `raw` or `object` [custom media types](https://docs.github.com/rest/repos/contents#custom-media-types-for-repository-contents) are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an empty string and the `encoding` field will be `\"none\"`. To get the contents of these larger files, use the `raw` media type.\n * Greater than 100 MB: This endpoint is not supported.\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/rest/repos/contents#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.' in: query required: false schema: type: string responses: '200': description: Response content: application/vnd.github.object: schema: "$ref": "#/components/schemas/content-tree" 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-object" 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. You must authenticate using an access token with the `repo` scope to use this endpoint. If you want to modify files in the `.github/workflows` directory, you must authenticate using an access token with the `workflow` scope. **Note:** If you use this endpoint and the "[Delete a file](https://docs.github.com/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. tags: - repos operationId: repos/create-or-update-file-contents externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/contents#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.' 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. You 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. The `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. You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code. **Note:** If you use this endpoint and the "[Create or update file contents](https://docs.github.com/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. tags: - repos operationId: repos/delete-file externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/contents#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 deleted. branch: type: string description: 'The branch name. Default: the repository’s default branch' 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 caches contributor data to improve performance. GitHub 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/rest/repos/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: repos "/repos/{owner}/{repo}/dependabot/alerts": get: summary: List Dependabot alerts for a repository description: |- You must use an access token with the `security_events` scope to use this endpoint with private repositories. You can also use tokens with the `public_repo` scope for public repositories only. GitHub Apps must have **Dependabot alerts** read permission to use this endpoint. tags: - dependabot operationId: dependabot/list-alerts-for-repo externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-states" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-severities" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-ecosystems" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-packages" - "$ref": "#/components/parameters/dependabot-alert-comma-separated-manifests" - "$ref": "#/components/parameters/dependabot-alert-scope" - "$ref": "#/components/parameters/dependabot-alert-sort" - "$ref": "#/components/parameters/direction" - name: page description: "**Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead." deprecated: true in: query schema: type: integer default: 1 - name: per_page description: The number of results per page (max 100). deprecated: true in: query schema: type: integer default: 30 - "$ref": "#/components/parameters/pagination-before" - "$ref": "#/components/parameters/pagination-after" - "$ref": "#/components/parameters/pagination-first" - "$ref": "#/components/parameters/pagination-last" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/dependabot-alert" examples: default: "$ref": "#/components/examples/dependabot-alerts-for-repository" '304': "$ref": "#/components/responses/not_modified" '400': "$ref": "#/components/responses/bad_request" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: dependabot subcategory: alerts "/repos/{owner}/{repo}/dependabot/alerts/{alert_number}": get: summary: Get a Dependabot alert description: |- You must use an access token with the `security_events` scope to use this endpoint with private repositories. You can also use tokens with the `public_repo` scope for public repositories only. GitHub Apps must have **Dependabot alerts** read permission to use this endpoint. tags: - dependabot operationId: dependabot/get-alert externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/dependabot-alert-number" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/dependabot-alert" examples: default: "$ref": "#/components/examples/dependabot-alert-open" '304': "$ref": "#/components/responses/not_modified" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: dependabot subcategory: alerts patch: summary: Update a Dependabot alert description: |- You must use an access token with the `security_events` scope to use this endpoint with private repositories. You can also use tokens with the `public_repo` scope for public repositories only. GitHub Apps must have **Dependabot alerts** write permission to use this endpoint. To use this endpoint, you must have access to security alerts for the repository. For more information, see "[Granting access to security alerts](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)." tags: - dependabot operationId: dependabot/update-alert externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/dependabot-alert-number" requestBody: required: true content: application/json: schema: type: object properties: state: type: string description: |- The state of the Dependabot alert. A `dismissed_reason` must be provided when setting the state to `dismissed`. enum: - dismissed - open dismissed_reason: type: string description: "**Required when `state` is `dismissed`.** A reason for dismissing the alert." enum: - fix_started - inaccurate - no_bandwidth - not_used - tolerable_risk dismissed_comment: type: string description: An optional comment associated with dismissing the alert. maxLength: 280 required: - state additionalProperties: false examples: default: value: state: dismissed dismissed_reason: tolerable_risk dismissed_comment: This alert is accurate but we use a sanitizer. responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/dependabot-alert" examples: default: "$ref": "#/components/examples/dependabot-alert-dismissed" '400': "$ref": "#/components/responses/bad_request" '403': "$ref": "#/components/responses/forbidden" '404': "$ref": "#/components/responses/not_found" '409': "$ref": "#/components/responses/conflict" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true previews: [] category: dependabot subcategory: alerts "/repos/{owner}/{repo}/dependabot/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 `dependabot_secrets` repository permission to use this endpoint. tags: - dependabot operationId: dependabot/list-repo-secrets externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/dependabot-secret" examples: default: "$ref": "#/components/examples/dependabot-secret-paginated" headers: Link: "$ref": "#/components/headers/link" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot subcategory: secrets "/repos/{owner}/{repo}/dependabot/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 `dependabot_secrets` repository permission to use this endpoint. tags: - dependabot operationId: dependabot/get-repo-public-key externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/dependabot-public-key" examples: default: "$ref": "#/components/examples/dependabot-public-key" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot subcategory: secrets "/repos/{owner}/{repo}/dependabot/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 `dependabot_secrets` repository permission to use this endpoint. tags: - dependabot operationId: dependabot/get-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/dependabot-secret" examples: default: "$ref": "#/components/examples/dependabot-secret" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot 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 [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `dependabot_secrets` repository permission to use this endpoint. tags: - dependabot operationId: dependabot/create-or-update-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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/rest/dependabot/secrets#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: "$ref": "#/components/schemas/empty-object" examples: default: value: '204': description: Response when updating a secret x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependabot 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 `dependabot_secrets` repository permission to use this endpoint. tags: - dependabot operationId: dependabot/delete-repo-secret externalDocs: description: API method documentation url: https://docs.github.com/rest/dependabot/secrets#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: dependabot subcategory: secrets "/repos/{owner}/{repo}/dependency-graph/compare/{basehead}": get: summary: Get a diff of the dependencies between commits description: Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. tags: - dependency-graph operationId: dependency-graph/diff-range externalDocs: description: API method documentation url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - name: basehead description: The base and head Git revisions to compare. The Git revisions will be resolved to commit SHAs. Named revisions will be resolved to their corresponding HEAD commits, and an appropriate merge base will be determined. This parameter expects the format `{base}...{head}`. in: path required: true schema: type: string - "$ref": "#/components/parameters/manifest-path" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/dependency-graph-diff" examples: default: "$ref": "#/components/examples/diff-range-response" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/dependency_review_forbidden" x-github: githubCloudOnly: false category: dependency-graph subcategory: dependency-review "/repos/{owner}/{repo}/dependency-graph/sbom": get: summary: Export a software bill of materials (SBOM) for a repository. description: Exports the software bill of materials (SBOM) for a repository in SPDX JSON format. tags: - dependency-graph operationId: dependency-graph/export-sbom externalDocs: description: API method documentation url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/dependency-graph-spdx-sbom" examples: default: "$ref": "#/components/examples/dependency-graph-export-sbom-response" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" '403': "$ref": "#/components/responses/forbidden" x-github: githubCloudOnly: false category: dependency-graph subcategory: sboms "/repos/{owner}/{repo}/dependency-graph/snapshots": post: summary: Create a snapshot of dependencies for a repository description: Create a new snapshot of a repository's dependencies. You must authenticate using an access token with the `repo` scope to use this endpoint for a repository that the requesting user has access to. tags: - dependency-graph operationId: dependency-graph/create-repository-snapshot externalDocs: description: API method documentation url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/snapshot" examples: example-of-a-dependency-submission: "$ref": "#/components/examples/dependency-graph-create-snapshot-request" responses: '201': description: Response content: application/json: schema: type: object required: - id - created_at - result - message properties: id: type: integer description: ID of the created snapshot. created_at: type: string description: The time at which the snapshot was created. result: type: string description: Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. message: type: string description: A message providing further details about the result, such as why the dependencies were not updated. examples: example-of-a-dependency-submission: "$ref": "#/components/examples/dependency-graph-create-snapshot-success" x-github: githubCloudOnly: false enabledForGitHubApps: true category: dependency-graph subcategory: dependency-submission "/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/rest/deployments/deployments#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: deployments subcategory: deployments post: summary: Create a deployment description: |- Deployments offer a few configurable parameters with certain defaults. The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them before we merge a pull request. The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter makes it easier to track which environments have requested deployments. The default environment is `production`. The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will return a failure response. By default, [commit statuses](https://docs.github.com/rest/commits/statuses) for every submitted context must be in a `success` state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do not require any contexts or create any commit statuses, the deployment will always succeed. The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text field that will be passed on when a deployment event is dispatched. The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an application with debugging enabled. Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref. Merged branch response: You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating a deployment. This auto-merge happens when: * Auto-merge option is enabled in the repository * Topic branch does not include the latest changes on the base branch, which is `master` in the response example * There are no merge conflicts If there are no new commits in the base branch, a new request to create a deployment should give a successful response. Merge conflict response: This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts. Failed commit status checks: This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`. tags: - repos operationId: repos/create-deployment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/deployments#create-a-deployment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: type: object properties: ref: type: string description: The ref to deploy. This can be a branch, tag, or SHA. task: type: string description: Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). default: deploy auto_merge: type: boolean description: Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. default: true required_contexts: type: array description: The [status](https://docs.github.com/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. items: type: string payload: oneOf: - type: object additionalProperties: true - type: string description: JSON payload with extra information about the deployment. default: '' environment: type: string description: Name for the target deployment environment (e.g., `production`, `staging`, `qa`). default: production description: type: string description: Short description of the deployment. default: '' nullable: true transient_environment: type: boolean description: 'Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false`' default: false production_environment: type: boolean description: 'Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise.' required: - ref examples: simple-example: summary: Simple example value: ref: topic-branch payload: '{ "deploy": "migrate" }' description: Deploy request from hubot advanced-example: summary: Advanced example value: ref: topic-branch auto_merge: false payload: '{ "deploy": "migrate" }' description: Deploy request from hubot required_contexts: - ci/janky - security/brakeman responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment" examples: simple-example: "$ref": "#/components/examples/deployment-simple-example" '202': description: Merged branch response content: application/json: schema: type: object properties: message: type: string examples: merged-branch-response: value: message: Auto-merged master into topic-branch on deployment. '409': description: Conflict when there is a merge conflict or the commit's status checks failed '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: deployments "/repos/{owner}/{repo}/deployments/{deployment_id}": get: summary: Get a deployment description: '' tags: - repos operationId: repos/get-deployment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/deployments#get-a-deployment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/deployment-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment" examples: default: "$ref": "#/components/examples/deployment" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: deployments delete: summary: Delete a deployment description: |- If the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment. Anyone with `repo` or `repo_deployment` scopes can delete a deployment. To set a deployment as inactive, you must: * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * Mark the active deployment as inactive by adding any non-successful deployment status. For more information, see "[Create a deployment](https://docs.github.com/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/deployments/statuses#create-a-deployment-status)." tags: - repos operationId: repos/delete-deployment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/deployment-id" responses: '204': description: Response '404': "$ref": "#/components/responses/not_found" '422': "$ref": "#/components/responses/validation_failed_simple" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: deployments "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses": get: summary: List deployment statuses description: 'Users with pull access can view deployment statuses for a deployment:' tags: - repos operationId: repos/list-deployment-statuses externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/deployment-id" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: array items: "$ref": "#/components/schemas/deployment-status" examples: default: "$ref": "#/components/examples/deployment-status-items" headers: Link: "$ref": "#/components/headers/link" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: statuses post: summary: Create a deployment status description: |- Users with `push` access can create deployment statuses for a given deployment. GitHub Apps require `read & write` access to "Deployments" and `read-only` access to "Repo contents" (for private repos). OAuth apps require the `repo_deployment` scope. tags: - repos operationId: repos/create-deployment-status externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/deployment-id" requestBody: required: true content: application/json: schema: type: object properties: state: type: string description: The state of the status. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub. enum: - error - failure - inactive - in_progress - queued - pending - success target_url: type: string description: The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. default: '' log_url: type: string description: 'The full URL of the deployment''s output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""`' default: '' description: type: string description: A short description of the status. The maximum description length is 140 characters. default: '' environment: type: string description: Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. environment_url: type: string description: 'Sets the URL for accessing your environment. Default: `""`' default: '' auto_inactive: type: boolean description: 'Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status''s deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true`' required: - state examples: default: value: environment: production state: success log_url: https://example.com/deployment/42/output description: Deployment finished successfully. responses: '201': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment-status" examples: default: "$ref": "#/components/examples/deployment-status" headers: Location: example: https://api.github.com/repos/octocat/example/deployments/42/statuses/1 schema: type: string '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: statuses "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}": get: summary: Get a deployment status description: 'Users with pull access can view a deployment status for a deployment:' tags: - repos operationId: repos/get-deployment-status externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/deployment-id" - name: status_id in: path required: true schema: type: integer responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment-status" examples: default: "$ref": "#/components/examples/deployment-status" '404': "$ref": "#/components/responses/not_found" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: statuses "/repos/{owner}/{repo}/dispatches": post: summary: Create a repository dispatch event description: |- You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. This endpoint requires write access to the repository by providing either: - Personal access tokens with `repo` scope. 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)" in the GitHub Help documentation. - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. This input example shows how you can use the `client_payload` as a test to debug your workflow. tags: - repos operationId: repos/create-dispatch-event externalDocs: description: API method documentation url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" requestBody: required: true content: application/json: schema: type: object required: - event_type properties: event_type: type: string description: A custom webhook event name. Must be 100 characters or fewer. minLength: 1 maxLength: 100 client_payload: type: object description: JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. additionalProperties: true maxProperties: 10 examples: default: value: event_type: on-demand-test client_payload: unit: false integration: true responses: '204': description: Response '422': "$ref": "#/components/responses/validation_failed" x-github: githubCloudOnly: false enabledForGitHubApps: true category: repos subcategory: repos "/repos/{owner}/{repo}/environments": get: summary: List environments description: |- Lists the environments 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: - repos operationId: repos/get-all-environments externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/environments#list-environments 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 properties: total_count: description: The number of environments in this repository example: 5 type: integer environments: type: array items: "$ref": "#/components/schemas/environment" examples: default: "$ref": "#/components/examples/environments" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: environments "/repos/{owner}/{repo}/environments/{environment_name}": get: summary: Get an environment description: |- **Note:** To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)." 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: - repos operationId: repos/get-environment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/environments#get-an-environment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/environment" examples: default: "$ref": "#/components/examples/environment" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: environments put: summary: Create or update an environment description: |- Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." **Note:** To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)." **Note:** To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)." You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint. tags: - repos operationId: repos/create-or-update-environment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" requestBody: required: false content: application/json: schema: type: object nullable: true properties: wait_timer: "$ref": "#/components/schemas/wait-timer" reviewers: type: array nullable: true description: The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. items: type: object properties: type: "$ref": "#/components/schemas/deployment-reviewer-type" id: type: integer description: The id of the user or team who can review the deployment example: 4532992 deployment_branch_policy: "$ref": "#/components/schemas/deployment-branch-policy-settings" additionalProperties: false examples: default: value: wait_timer: 30 reviewers: - type: User id: 1 - type: Team id: 1 deployment_branch_policy: protected_branches: false custom_branch_policies: true responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/environment" examples: default: "$ref": "#/components/examples/environment" '422': description: Validation error when the environment name is invalid or when `protected_branches` and `custom_branch_policies` in `deployment_branch_policy` are set to the same value content: application/json: schema: "$ref": "#/components/schemas/basic-error" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: environments delete: summary: Delete an environment description: You must authenticate using an access token with the repo scope to use this endpoint. tags: - repos operationId: repos/delete-an-environment externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/environments#delete-an-environment parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" responses: '204': description: Default response x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: environments "/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies": get: summary: List deployment branch policies description: |- Lists the deployment branch policies for an environment. 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: - repos operationId: repos/list-deployment-branch-policies externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" - "$ref": "#/components/parameters/per-page" - "$ref": "#/components/parameters/page" responses: '200': description: Response content: application/json: schema: type: object properties: total_count: description: The number of deployment branch policies for the environment. type: integer example: 2 branch_policies: type: array items: "$ref": "#/components/schemas/deployment-branch-policy" required: - total_count - branch_policies examples: default: "$ref": "#/components/examples/deployment-branch-policies-list" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: branch-policies post: summary: Create a deployment branch policy description: |- Creates a deployment branch policy for an environment. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint. tags: - repos operationId: repos/create-deployment-branch-policy externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/deployment-branch-policy-name-pattern-with-type" examples: example-wildcard: summary: Example of a wildcard name pattern value: name: release/* example-single-branch: summary: Example of a single branch name pattern value: name: main responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment-branch-policy" examples: example-wildcard: "$ref": "#/components/examples/deployment-branch-policy-wildcard" example-single-branch: "$ref": "#/components/examples/deployment-branch-policy-single-branch" '404': description: Not Found or `deployment_branch_policy.custom_branch_policies` property for the environment is set to false '303': description: Response if the same branch name pattern already exists x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: branch-policies "/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}": get: summary: Get a deployment branch policy description: |- Gets a deployment branch policy for an environment. 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: - repos operationId: repos/get-deployment-branch-policy externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" - "$ref": "#/components/parameters/branch-policy-id" responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment-branch-policy" examples: default: "$ref": "#/components/examples/deployment-branch-policy-wildcard" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: branch-policies put: summary: Update a deployment branch policy description: |- Updates a deployment branch policy for an environment. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint. tags: - repos operationId: repos/update-deployment-branch-policy externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" - "$ref": "#/components/parameters/branch-policy-id" requestBody: required: true content: application/json: schema: "$ref": "#/components/schemas/deployment-branch-policy-name-pattern" examples: default: value: name: release/* responses: '200': description: Response content: application/json: schema: "$ref": "#/components/schemas/deployment-branch-policy" examples: default: "$ref": "#/components/examples/deployment-branch-policy-wildcard" x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: branch-policies delete: summary: Delete a deployment branch policy description: |- Deletes a deployment branch policy for an environment. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration:write` permission for the repository to use this endpoint. tags: - repos operationId: repos/delete-deployment-branch-policy externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy parameters: - "$ref": "#/components/parameters/owner" - "$ref": "#/components/parameters/repo" - "$ref": "#/components/parameters/environment-name" - "$ref": "#/components/parameters/branch-policy-id" responses: '204': description: Response x-github: githubCloudOnly: false enabledForGitHubApps: true category: deployments subcategory: branch-policies "/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules": get: summary: Get all deployment protection rules for an environment description: |- Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. If the repository is private and you want to use a personal access token (classic), you must use an access token with the `repo` scope. GitHub Apps and fine-grained personal access tokens must have the `actions:read` permission to use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)." For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/rest/apps/apps#get-an-app). tags: - repos operationId: repos/get-all-deployment-protection-rules externalDocs: description: API method documentation url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment parameters: - "$ref": "#/components/param