{ "openapi": "3.0.3", "servers": [ { "url": "https://api.github.com" } ], "info": { "contact": { "name": "Support", "url": "https://support.github.com/contact?tags=dotcom-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", "title": "GitHub v3 REST API", "version": "1.1.4", "x-apisguru-categories": [ "collaboration", "developer_tools" ], "x-github-plan": "api.github.com", "x-logo": { "url": "https://api.apis.guru/v2/cache/logo/https_twitter.com_github_profile_image.jpeg" }, "x-origin": [ { "format": "openapi", "url": "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json", "version": "3.0" } ], "x-providerName": "github.com", "x-serviceName": "api.github.com" }, "externalDocs": { "description": "GitHub v3 REST API", "url": "https://docs.github.com/rest/" }, "tags": [ { "description": "Endpoints to manage GitHub Actions using the REST API.", "name": "actions" }, { "description": "Activity APIs provide access to notifications, subscriptions, and timelines.", "name": "activity" }, { "description": "Information for integrations and installations.", "name": "apps" }, { "description": "Monitor charges and usage from Actions and Packages.", "name": "billing" }, { "description": "Rich interactions with checks run by your integrations.", "name": "checks" }, { "description": "Retrieve code scanning alerts from a repository.", "name": "code-scanning" }, { "description": "Insight into codes of conduct for your communities.", "name": "codes-of-conduct" }, { "description": "Endpoints to manage Codespaces using the REST API.", "name": "codespaces" }, { "description": "List emojis available to use on GitHub.", "name": "emojis" }, { "description": "Endpoints to manage Dependabot.", "name": "dependabot" }, { "description": "Endpoints to access Dependency Graph features.", "name": "dependency-graph" }, { "description": "View, modify your gists.", "name": "gists" }, { "description": "Raw Git functionality.", "name": "git" }, { "description": "View gitignore templates", "name": "gitignore" }, { "description": "Owner or admin management of users interactions.", "name": "interactions" }, { "description": "Interact with GitHub Issues.", "name": "issues" }, { "description": "View various OSS licenses.", "name": "licenses" }, { "description": "Render GitHub flavored markdown", "name": "markdown" }, { "description": "Interact with GitHub Merge Queues.", "name": "merge-queue" }, { "description": "Endpoints that give information about the API.", "name": "meta" }, { "description": "Move projects to or from GitHub.", "name": "migrations" }, { "description": "Endpoints to manage GitHub OIDC configuration using the REST API.", "name": "oidc" }, { "description": "Interact with GitHub Orgs.", "name": "orgs" }, { "description": "Manage packages for authenticated users and organizations.", "name": "packages" }, { "description": "Interact with GitHub Projects.", "name": "projects" }, { "description": "Interact with GitHub Pull Requests.", "name": "pulls" }, { "description": "Check your current rate limit status", "name": "rate-limit" }, { "description": "Interact with reactions to various GitHub entities.", "name": "reactions" }, { "description": "Interact with GitHub Repos.", "name": "repos" }, { "description": "Look for stuff on GitHub.", "name": "search" }, { "description": "Retrieve secret scanning alerts from a repository.", "name": "secret-scanning" }, { "description": "Interact with GitHub Teams.", "name": "teams" }, { "description": "Interact with and view information about users and also current user.", "name": "users" } ], "paths": { "/": { "get": { "description": "Get Hypermedia links to resources accessible in GitHub's REST API", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/overview/resources-in-the-rest-api#root-endpoint" }, "operationId": "meta/root", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/root" } }, "schema": { "$ref": "#/components/schemas/root" } } }, "description": "Response" } }, "summary": "GitHub API Root", "tags": [ "meta" ], "x-github": { "category": "meta", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/app": { "get": { "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/reference/apps#list-installations-for-the-authenticated-app)\" endpoint.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-the-authenticated-app" }, "operationId": "apps/get-authenticated", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration" } }, "schema": { "$ref": "#/components/schemas/integration" } } }, "description": "Response" } }, "summary": "Get the authenticated app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/app-manifests/{code}/conversions": { "post": { "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`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#create-a-github-app-from-a-manifest" }, "operationId": "apps/create-from-manifest", "parameters": [ { "in": "path", "name": "code", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration-from-manifest" } }, "schema": { "allOf": [ { "$ref": "#/components/schemas/integration" }, { "additionalProperties": true, "properties": { "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "pem": { "type": "string" }, "webhook_secret": { "nullable": true, "type": "string" } }, "required": [ "client_id", "client_secret", "webhook_secret", "pem" ], "type": "object" } ] } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Create a GitHub App from a manifest", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/app/hook/config": { "get": { "description": "Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-a-webhook-configuration-for-an-app" }, "operationId": "apps/get-webhook-config-for-app", "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/webhook-config" } }, "schema": { "$ref": "#/components/schemas/webhook-config" } } }, "description": "Response" } }, "summary": "Get a webhook configuration for an app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "webhooks" } }, "patch": { "description": "Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#update-a-webhook-configuration-for-an-app" }, "operationId": "apps/update-webhook-config-for-app", "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" } } }, "schema": { "properties": { "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "url": { "$ref": "#/components/schemas/webhook-config-url" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/webhook-config" } }, "schema": { "$ref": "#/components/schemas/webhook-config" } } }, "description": "Response" } }, "summary": "Update a webhook configuration for an app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/app/hook/deliveries": { "get": { "description": "Returns a list of webhook deliveries for the webhook configured for a GitHub App.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-deliveries-for-an-app-webhook" }, "operationId": "apps/list-webhook-deliveries", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/cursor" }, { "in": "query", "name": "redelivery", "required": false, "schema": { "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/hook-delivery-items" } }, "schema": { "items": { "$ref": "#/components/schemas/hook-delivery-item" }, "type": "array" } } }, "description": "Response" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List deliveries for an app webhook", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/app/hook/deliveries/{delivery_id}": { "get": { "description": "Returns a delivery for the webhook configured for a GitHub App.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-a-delivery-for-an-app-webhook" }, "operationId": "apps/get-webhook-delivery", "parameters": [ { "$ref": "#/components/parameters/delivery-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/hook-delivery" } }, "schema": { "$ref": "#/components/schemas/hook-delivery" } } }, "description": "Response" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Get a delivery for an app webhook", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/app/hook/deliveries/{delivery_id}/attempts": { "post": { "description": "Redeliver a delivery for the webhook configured for a GitHub App.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#redeliver-a-delivery-for-an-app-webhook" }, "operationId": "apps/redeliver-webhook-delivery", "parameters": [ { "$ref": "#/components/parameters/delivery-id" } ], "responses": { "202": { "$ref": "#/components/responses/accepted" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Redeliver a delivery for an app webhook", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/app/installations": { "get": { "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.\n\nThe permissions the installation has are included under the `permissions` key.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app" }, "operationId": "apps/list-installations", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/since" }, { "in": "query", "name": "outdated", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-installation-items" } }, "schema": { "items": { "$ref": "#/components/schemas/installation" }, "type": "array" } } }, "description": "The permissions the installation has are included under the `permissions` key.", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List installations for the authenticated app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/app/installations/{installation_id}": { "delete": { "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/reference/apps/#suspend-an-app-installation)\" endpoint.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#delete-an-installation-for-the-authenticated-app" }, "operationId": "apps/delete-installation", "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete an installation for the authenticated app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "Enables an authenticated GitHub App to find an installation's information using the installation id.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-an-installation-for-the-authenticated-app" }, "operationId": "apps/get-installation", "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-installation" } }, "schema": { "$ref": "#/components/schemas/installation" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an installation for the authenticated app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/app/installations/{installation_id}/access_tokens": { "post": { "description": "Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key.\n\nYou must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps/#create-an-installation-access-token-for-an-app" }, "operationId": "apps/create-installation-access-token", "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "permissions": { "contents": "read", "issues": "write" }, "repository": "Hello-World" } } }, "schema": { "properties": { "permissions": { "$ref": "#/components/schemas/app-permissions" }, "repositories": { "description": "List of repository names that the token should have access to", "items": { "example": "rails", "type": "string" }, "type": "array" }, "repository_ids": { "description": "List of repository IDs that the token should have access to", "example": [ 1 ], "items": { "type": "integer" }, "type": "array" } }, "type": "object" } } }, "required": false }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/installation-token" } }, "schema": { "$ref": "#/components/schemas/installation-token" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create an installation access token for an app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/app/installations/{installation_id}/suspended": { "delete": { "description": "Removes a GitHub App installation suspension.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#unsuspend-an-app-installation" }, "operationId": "apps/unsuspend-installation", "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Unsuspend an app installation", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "put": { "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.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#suspend-an-app-installation" }, "operationId": "apps/suspend-installation", "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Suspend an app installation", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/applications/{client_id}/grant": { "delete": { "description": "OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.\nDeleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#delete-an-app-authorization" }, "operationId": "apps/delete-authorization", "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } }, "schema": { "properties": { "access_token": { "description": "The OAuth access token used to authenticate to the GitHub API.", "type": "string" } }, "required": [ "access_token" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Delete an app authorization", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "oauth-applications" } } }, "/applications/{client_id}/token": { "delete": { "description": "OAuth application owners can revoke a single token for an OAuth application. 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#delete-an-app-token" }, "operationId": "apps/delete-token", "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } }, "schema": { "properties": { "access_token": { "description": "The OAuth access token used to authenticate to the GitHub API.", "type": "string" } }, "required": [ "access_token" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Delete an app token", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "oauth-applications" } }, "patch": { "description": "OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#reset-a-token" }, "operationId": "apps/reset-token", "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } }, "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } }, "schema": { "$ref": "#/components/schemas/authorization" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Reset a token", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "oauth-applications" } }, "post": { "description": "OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#check-a-token" }, "operationId": "apps/check-token", "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } }, "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } }, "schema": { "$ref": "#/components/schemas/authorization" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Check a token", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "oauth-applications" } } }, "/applications/{client_id}/token/scoped": { "post": { "description": "Use a non-scoped user-to-server access token to create a repository scoped and/or permission scoped user-to-server 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`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#create-a-scoped-access-token" }, "operationId": "apps/scope-token", "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a", "permissions": { "contents": "read", "issues": "write", "metadata": "read" }, "target": "octocat" } } }, "schema": { "properties": { "access_token": { "description": "The access token used to authenticate to the GitHub API.", "example": "e72e16c7e42f292c6912e7710c838347ae178b4a", "type": "string" }, "permissions": { "$ref": "#/components/schemas/app-permissions" }, "repositories": { "description": "The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified.", "items": { "example": "rails", "type": "string" }, "type": "array" }, "repository_ids": { "description": "The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified.", "example": [ 1 ], "items": { "type": "integer" }, "type": "array" }, "target": { "description": "The name of the user or organization to scope the user-to-server access token to. **Required** unless `target_id` is specified.", "example": "octocat", "type": "string" }, "target_id": { "description": "The ID of the user or organization to scope the user-to-server access token to. **Required** unless `target` is specified.", "example": 1, "type": "integer" } }, "required": [ "access_token" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/scope-token" } }, "schema": { "$ref": "#/components/schemas/authorization" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create a scoped access token", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "apps" } } }, "/apps/{app_slug}": { "get": { "description": "**Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).\n\nIf the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps/#get-an-app" }, "operationId": "apps/get-by-slug", "parameters": [ { "$ref": "#/components/parameters/app-slug" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration" } }, "schema": { "$ref": "#/components/schemas/integration" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/codes_of_conduct": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codes-of-conduct#get-all-codes-of-conduct" }, "operationId": "codes-of-conduct/get-all-codes-of-conduct", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-of-conduct-simple-items" } }, "schema": { "items": { "$ref": "#/components/schemas/code-of-conduct" }, "type": "array" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get all codes of conduct", "tags": [ "codes-of-conduct" ], "x-github": { "category": "codes-of-conduct", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/codes_of_conduct/{key}": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codes-of-conduct#get-a-code-of-conduct" }, "operationId": "codes-of-conduct/get-conduct-code", "parameters": [ { "in": "path", "name": "key", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-of-conduct" } }, "schema": { "$ref": "#/components/schemas/code-of-conduct" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a code of conduct", "tags": [ "codes-of-conduct" ], "x-github": { "category": "codes-of-conduct", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/emojis": { "get": { "description": "Lists all the emojis available to use on GitHub.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/emojis#get-emojis" }, "operationId": "emojis/get", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/emojis-get" } }, "schema": { "additionalProperties": { "type": "string" }, "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get emojis", "tags": [ "emojis" ], "x-github": { "category": "emojis", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/enterprises/{enterprise}/dependabot/alerts": { "get": { "description": "Lists Dependabot alerts for repositories that are owned by the specified enterprise.\nTo use this endpoint, you must be a member of the enterprise, and you must use an\naccess token with the `repo` scope or `security_events` scope.\nAlerts 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise" }, "operationId": "dependabot/list-alerts-for-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/dependabot-alerts-for-organization" } }, "schema": { "items": { "$ref": "#/components/schemas/dependabot-alert-with-repository" }, "type": "array" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "List Dependabot alerts for an enterprise", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": false, "githubCloudOnly": false, "previews": [], "subcategory": "alerts" } } }, "/enterprises/{enterprise}/secret-scanning/alerts": { "get": { "description": "Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.\nTo 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).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-an-enterprise" }, "operationId": "secret-scanning/list-alerts-for-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-secret-scanning-alert-list" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-secret-scanning-alert" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List secret scanning alerts for an enterprise", "tags": [ "secret-scanning" ], "x-github": { "category": "secret-scanning", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/events": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#list-public-events" }, "operationId": "activity/list-public-events", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-events-items" } }, "schema": { "items": { "$ref": "#/components/schemas/event" }, "type": "array" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List public events", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "events" } } }, "/feeds": { "get": { "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:\n\n* **Timeline**: The GitHub global public timeline\n* **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia)\n* **Current user public**: The public timeline for the authenticated user\n* **Current user**: The private timeline for the authenticated user\n* **Current user actor**: The private timeline for activity created by the authenticated user\n* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.\n* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.\n\n**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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#get-feeds" }, "operationId": "activity/get-feeds", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/feed" } }, "schema": { "$ref": "#/components/schemas/feed" } } }, "description": "Response" } }, "summary": "Get feeds", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "feeds" } } }, "/gists": { "get": { "description": "Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-gists-for-the-authenticated-user" }, "operationId": "gists/list", "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } }, "schema": { "items": { "$ref": "#/components/schemas/base-gist" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List gists for the authenticated user", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "Allows you to add a new gist with one or more files.\n\n**Note:** Don't name your files \"gistfile\" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#create-a-gist" }, "operationId": "gists/create", "parameters": [], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Creating a gist", "value": { "description": "Example of a gist", "files": { "README.md": { "content": "Hello World" } }, "public": false } } }, "schema": { "properties": { "description": { "description": "Description of the gist", "example": "Example Ruby script", "type": "string" }, "files": { "additionalProperties": { "properties": { "content": { "description": "Content of the file", "readOnly": false, "type": "string" } }, "required": [ "content" ], "type": "object" }, "description": "Names and content for the files that make up the gist", "example": { "hello.rb": { "content": "puts \"Hello, World!\"" } }, "type": "object" }, "public": { "oneOf": [ { "default": false, "description": "Flag indicating whether the gist is public", "example": true, "type": "boolean" }, { "default": "false", "enum": [ "true", "false" ], "example": "true", "type": "string" } ] } }, "required": [ "files" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist" } }, "schema": { "$ref": "#/components/schemas/gist-simple" } } }, "description": "Response", "headers": { "Location": { "example": "https://api.github.com/gists/aa5a315d61ae9438b18d", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/public": { "get": { "description": "List public gists sorted by most recently updated to least recently updated.\n\nNote: 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-public-gists" }, "operationId": "gists/list-public", "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } }, "schema": { "items": { "$ref": "#/components/schemas/base-gist" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List public gists", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/starred": { "get": { "description": "List the authenticated user's starred gists:", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-starred-gists" }, "operationId": "gists/list-starred", "parameters": [ { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-gist-items" } }, "schema": { "items": { "$ref": "#/components/schemas/base-gist" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List starred gists", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/{gist_id}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#delete-a-gist" }, "operationId": "gists/delete", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#get-a-gist" }, "operationId": "gists/get", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist" } }, "schema": { "$ref": "#/components/schemas/gist-simple" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden_gist" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "patch": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists/#update-a-gist" }, "operationId": "gists/update", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "requestBody": { "content": { "application/json": { "examples": { "deleteFile": { "summary": "Deleting a gist file", "value": { "files": { "hello.py": null } } }, "renameFile": { "summary": "Renaming a gist file", "value": { "files": { "hello.py": { "filename": "goodbye.py" } } } }, "updateGist": { "summary": "Updating a gist", "value": { "description": "An updated gist description", "files": { "README.md": { "content": "Hello World from GitHub" } } } } }, "schema": { "anyOf": [ { "required": [ "description" ] }, { "required": [ "files" ] } ], "nullable": true, "properties": { "description": { "description": "The description of the gist.", "example": "Example Ruby script", "type": "string" }, "files": { "additionalProperties": { "anyOf": [ { "required": [ "content" ] }, { "required": [ "filename" ] }, { "maxProperties": 0, "type": "object" } ], "nullable": true, "properties": { "content": { "description": "The new content of the file.", "type": "string" }, "filename": { "description": "The new filename for the file.", "nullable": true, "type": "string" } }, "type": "object" }, "description": "The gist files to be updated, renamed, or deleted. Each `key` must match the current filename\n(including extension) of the targeted gist file. For example: `hello.py`.\n\nTo delete a file, set the whole file to null. For example: `hello.py : null`.", "example": { "hello.rb": { "content": "blah", "filename": "goodbye.rb" } }, "type": "object" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "deleteFile": { "$ref": "#/components/examples/delete-gist-file" }, "renameFile": { "$ref": "#/components/examples/rename-gist-file" }, "updateGist": { "$ref": "#/components/examples/gist" } }, "schema": { "$ref": "#/components/schemas/gist-simple" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/{gist_id}/comments": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-gist-comments" }, "operationId": "gists/list-comments", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-comment-items" } }, "schema": { "items": { "$ref": "#/components/schemas/gist-comment" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List gist comments", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "comments" } }, "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#create-a-gist-comment" }, "operationId": "gists/create-comment", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Creating a comment in a gist", "value": { "body": "This is a comment to a gist" } } }, "schema": { "properties": { "body": { "description": "The comment text.", "example": "Body of the attachment", "maxLength": 65535, "type": "string" } }, "required": [ "body" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-comment" } }, "schema": { "$ref": "#/components/schemas/gist-comment" } } }, "description": "Response", "headers": { "Location": { "example": "https://api.github.com/gists/a6db0bec360bb87e9418/comments/1", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Create a gist comment", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "comments" } } }, "/gists/{gist_id}/comments/{comment_id}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#delete-a-gist-comment" }, "operationId": "gists/delete-comment", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete a gist comment", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "comments" } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#get-a-gist-comment" }, "operationId": "gists/get-comment", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-comment" } }, "schema": { "$ref": "#/components/schemas/gist-comment" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden_gist" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a gist comment", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "comments" } }, "patch": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#update-a-gist-comment" }, "operationId": "gists/update-comment", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/comment-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Updating a comment in a gist", "value": { "body": "This is an update to a comment in a gist" } } }, "schema": { "properties": { "body": { "description": "The comment text.", "example": "Body of the attachment", "maxLength": 65535, "type": "string" } }, "required": [ "body" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-comment" } }, "schema": { "$ref": "#/components/schemas/gist-comment" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Update a gist comment", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "comments" } } }, "/gists/{gist_id}/commits": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-gist-commits" }, "operationId": "gists/list-commits", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-commit-items" } }, "schema": { "items": { "$ref": "#/components/schemas/gist-commit" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "example": "; rel=\"next\"", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List gist commits", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/{gist_id}/forks": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#list-gist-forks" }, "operationId": "gists/list-forks", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist-fork-items" } }, "schema": { "items": { "$ref": "#/components/schemas/gist-simple" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List gist forks", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#fork-a-gist" }, "operationId": "gists/fork", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/base-gist" } }, "schema": { "$ref": "#/components/schemas/base-gist" } } }, "description": "Response", "headers": { "Location": { "example": "https://api.github.com/gists/aa5a315d61ae9438b18d", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Fork a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/{gist_id}/star": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#unstar-a-gist" }, "operationId": "gists/unstar", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Unstar a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#check-if-a-gist-is-starred" }, "operationId": "gists/check-is-starred", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response if gist is starred" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "content": { "application/json": { "schema": { "additionalProperties": false, "properties": {}, "type": "object" } } }, "description": "Not Found if gist is not starred" } }, "summary": "Check if a gist is starred", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "put": { "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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#star-a-gist" }, "operationId": "gists/star", "parameters": [ { "$ref": "#/components/parameters/gist-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Star a gist", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gists/{gist_id}/{sha}": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gists#get-a-gist-revision" }, "operationId": "gists/get-revision", "parameters": [ { "$ref": "#/components/parameters/gist-id" }, { "in": "path", "name": "sha", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gist" } }, "schema": { "$ref": "#/components/schemas/gist-simple" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Get a gist revision", "tags": [ "gists" ], "x-github": { "category": "gists", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/gitignore/templates": { "get": { "description": "List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gitignore#get-all-gitignore-templates" }, "operationId": "gitignore/get-all-templates", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": [ "Actionscript", "Android", "AppceleratorTitanium", "Autotools", "Bancha", "C", "C++" ] } }, "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get all gitignore templates", "tags": [ "gitignore" ], "x-github": { "category": "gitignore", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/gitignore/templates/{name}": { "get": { "description": "The API also allows fetching the source of a single template.\nUse the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/gitignore#get-a-gitignore-template" }, "operationId": "gitignore/get-template", "parameters": [ { "in": "path", "name": "name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/gitignore-template" } }, "schema": { "$ref": "#/components/schemas/gitignore-template" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get a gitignore template", "tags": [ "gitignore" ], "x-github": { "category": "gitignore", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/installation/repositories": { "get": { "description": "List repositories that an app installation can access.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-app-installation" }, "operationId": "apps/list-repos-accessible-to-installation", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repository-paginated-2" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/repository" }, "type": "array" }, "repository_selection": { "example": "selected", "type": "string" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List repositories accessible to the app installation", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "installations" } } }, "/installation/token": { "delete": { "description": "Revokes the installation token you're using to authenticate as an installation and access this endpoint.\n\nOnce an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \"[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)\" endpoint.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#revoke-an-installation-access-token" }, "operationId": "apps/revoke-installation-access-token", "parameters": [], "responses": { "204": { "description": "Response" } }, "summary": "Revoke an installation access token", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "installations" } } }, "/issues": { "get": { "description": "List issues assigned to the authenticated user across all visible repositories including owned repositories, member\nrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not\nnecessarily assigned to you.\n\n\n**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this\nreason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\nrequest id, use the \"[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)\" endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/issues#list-issues-assigned-to-the-authenticated-user" }, "operationId": "issues/list", "parameters": [ { "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", "name": "filter", "required": false, "schema": { "default": "assigned", "enum": [ "assigned", "created", "mentioned", "subscribed", "repos", "all" ], "type": "string" } }, { "description": "Indicates the state of the issues to return.", "in": "query", "name": "state", "required": false, "schema": { "default": "open", "enum": [ "open", "closed", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/labels" }, { "description": "What to sort results by.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created", "updated", "comments" ], "type": "string" } }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/since" }, { "in": "query", "name": "collab", "required": false, "schema": { "type": "boolean" } }, { "in": "query", "name": "orgs", "required": false, "schema": { "type": "boolean" } }, { "in": "query", "name": "owned", "required": false, "schema": { "type": "boolean" } }, { "in": "query", "name": "pulls", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/issue-with-repo-items" } }, "schema": { "items": { "$ref": "#/components/schemas/issue" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List issues assigned to the authenticated user", "tags": [ "issues" ], "x-github": { "category": "issues", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/licenses": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/licenses#get-all-commonly-used-licenses" }, "operationId": "licenses/get-all-commonly-used", "parameters": [ { "in": "query", "name": "featured", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/license-simple-items" } }, "schema": { "items": { "$ref": "#/components/schemas/license-simple" }, "type": "array" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get all commonly used licenses", "tags": [ "licenses" ], "x-github": { "category": "licenses", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/licenses/{license}": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/licenses#get-a-license" }, "operationId": "licenses/get", "parameters": [ { "in": "path", "name": "license", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/license" } }, "schema": { "$ref": "#/components/schemas/license" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a license", "tags": [ "licenses" ], "x-github": { "category": "licenses", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/markdown": { "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/markdown#render-a-markdown-document" }, "operationId": "markdown/render", "parameters": [], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Rendering markdown", "value": { "text": "Hello **world**" } } }, "schema": { "properties": { "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" }, "mode": { "default": "markdown", "description": "The rendering mode.", "enum": [ "markdown", "gfm" ], "example": "markdown", "type": "string" }, "text": { "description": "The Markdown text to render in HTML.", "type": "string" } }, "required": [ "text" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "text/html": { "examples": { "default": { "summary": "Example response", "value": "

Hello world

" } }, "schema": { "type": "string" } } }, "description": "Response", "headers": { "Content-Length": { "example": "279", "schema": { "type": "string" } }, "Content-Type": { "$ref": "#/components/headers/content-type" }, "X-CommonMarker-Version": { "$ref": "#/components/headers/x-common-marker-version" } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Render a Markdown document", "tags": [ "markdown" ], "x-github": { "category": "markdown", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/markdown/raw": { "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/markdown#render-a-markdown-document-in-raw-mode" }, "operationId": "markdown/render-raw", "parameters": [], "requestBody": { "content": { "text/plain": { "examples": { "default": { "value": { "text": "Hello **world**" } } }, "schema": { "type": "string" } }, "text/x-markdown": { "examples": { "default": { "summary": "Rendering markdown", "value": { "text": "Hello **world**" } } }, "schema": { "type": "string" } } }, "required": false }, "responses": { "200": { "content": { "text/html": { "examples": { "default": { "summary": "Example response", "value": "

Hello world

" } }, "schema": { "type": "string" } } }, "description": "Response", "headers": { "X-CommonMarker-Version": { "$ref": "#/components/headers/x-common-marker-version" } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Render a Markdown document in raw mode", "tags": [ "markdown" ], "x-github": { "category": "markdown", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/marketplace_listing/accounts/{account_id}": { "get": { "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.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account" }, "operationId": "apps/get-subscription-plan-for-account", "parameters": [ { "$ref": "#/components/parameters/account-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-purchase" } }, "schema": { "$ref": "#/components/schemas/marketplace-purchase" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } }, "description": "Not Found when the account has not purchased the listing" } }, "summary": "Get a subscription plan for an account", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/marketplace_listing/plans": { "get": { "description": "Lists all plans that are part of your GitHub Marketplace listing.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-plans" }, "operationId": "apps/list-plans", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-listing-plan-items" } }, "schema": { "items": { "$ref": "#/components/schemas/marketplace-listing-plan" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List plans", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/marketplace_listing/plans/{plan_id}/accounts": { "get": { "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.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan" }, "operationId": "apps/list-accounts-for-plan", "parameters": [ { "$ref": "#/components/parameters/plan-id" }, { "$ref": "#/components/parameters/sort" }, { "description": "To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter.", "in": "query", "name": "direction", "required": false, "schema": { "enum": [ "asc", "desc" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-purchase-items" } }, "schema": { "items": { "$ref": "#/components/schemas/marketplace-purchase" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List accounts for a plan", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/marketplace_listing/stubbed/accounts/{account_id}": { "get": { "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.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account-stubbed" }, "operationId": "apps/get-subscription-plan-for-account-stubbed", "parameters": [ { "$ref": "#/components/parameters/account-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-purchase" } }, "schema": { "$ref": "#/components/schemas/marketplace-purchase" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "description": "Not Found when the account has not purchased the listing" } }, "summary": "Get a subscription plan for an account (stubbed)", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/marketplace_listing/stubbed/plans": { "get": { "description": "Lists all plans that are part of your GitHub Marketplace listing.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-plans-stubbed" }, "operationId": "apps/list-plans-stubbed", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-listing-plan-items" } }, "schema": { "items": { "$ref": "#/components/schemas/marketplace-listing-plan" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "summary": "List plans (stubbed)", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/marketplace_listing/stubbed/plans/{plan_id}/accounts": { "get": { "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.\n\nGitHub 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan-stubbed" }, "operationId": "apps/list-accounts-for-plan-stubbed", "parameters": [ { "$ref": "#/components/parameters/plan-id" }, { "$ref": "#/components/parameters/sort" }, { "description": "To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter.", "in": "query", "name": "direction", "required": false, "schema": { "enum": [ "asc", "desc" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/marketplace-purchase-items" } }, "schema": { "items": { "$ref": "#/components/schemas/marketplace-purchase" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "summary": "List accounts for a plan (stubbed)", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "marketplace" } } }, "/meta": { "get": { "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/).\"\n\n**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.\n\n**Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/meta#get-github-meta-information" }, "operationId": "meta/get", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/api-overview" } }, "schema": { "$ref": "#/components/schemas/api-overview" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "Get GitHub meta information", "tags": [ "meta" ], "x-github": { "category": "meta", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/networks/{owner}/{repo}/events": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#list-public-events-for-a-network-of-repositories" }, "operationId": "activity/list-public-events-for-repo-network", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-repo-events-items" } }, "schema": { "items": { "$ref": "#/components/schemas/event" }, "type": "array" } } }, "description": "Response" }, "301": { "$ref": "#/components/responses/moved_permanently" }, "304": { "$ref": "#/components/responses/not_modified" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List public events for a network of repositories", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "events" } } }, "/notifications": { "get": { "description": "List all notifications for the current user, sorted by most recently updated.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user" }, "operationId": "activity/list-notifications-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/all" }, { "$ref": "#/components/parameters/participating" }, { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/before" }, { "$ref": "#/components/parameters/page" }, { "description": "The number of results per page (max 50).", "in": "query", "name": "per_page", "schema": { "default": 50, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/thread-items" } }, "schema": { "items": { "$ref": "#/components/schemas/thread" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List notifications for the authenticated user", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } }, "put": { "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/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#mark-notifications-as-read" }, "operationId": "activity/mark-notifications-as-read", "parameters": [], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "last_read_at": "2022-06-10T00:00:00Z", "read": true } } }, "schema": { "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.", "format": "date-time", "type": "string" }, "read": { "description": "Whether the notification has been read.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "202": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/notifications-mark-read" } }, "schema": { "properties": { "message": { "type": "string" } }, "type": "object" } } }, "description": "Response" }, "205": { "description": "Reset Content" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Mark notifications as read", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } } }, "/notifications/threads/{thread_id}": { "get": { "description": "Gets information about a notification thread.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#get-a-thread" }, "operationId": "activity/get-thread", "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/thread" } }, "schema": { "$ref": "#/components/schemas/thread" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Get a thread", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } }, "patch": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#mark-a-thread-as-read" }, "operationId": "activity/mark-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" } }, "summary": "Mark a thread as read", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } } }, "/notifications/threads/{thread_id}/subscription": { "delete": { "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/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#delete-a-thread-subscription" }, "operationId": "activity/delete-thread-subscription", "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Delete a thread subscription", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } }, "get": { "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/reference/activity#get-a-repository-subscription).\n\nNote that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#get-a-thread-subscription-for-the-authenticated-user" }, "operationId": "activity/get-thread-subscription-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/thread-subscription" } }, "schema": { "$ref": "#/components/schemas/thread-subscription" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Get a thread subscription for the authenticated user", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } }, "put": { "description": "If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.\n\nYou can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.\n\nUnsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#set-a-thread-subscription" }, "operationId": "activity/set-thread-subscription", "parameters": [ { "$ref": "#/components/parameters/thread-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "ignored": false } } }, "schema": { "properties": { "ignored": { "default": false, "description": "Whether to block all notifications from a thread.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/thread-subscription" } }, "schema": { "$ref": "#/components/schemas/thread-subscription" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Set a thread subscription", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "notifications" } } }, "/octocat": { "get": { "description": "Get the octocat as ASCII art", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/meta#get-octocat" }, "operationId": "meta/get-octocat", "parameters": [ { "description": "The words to show in Octocat's speech bubble", "in": "query", "name": "s", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/octocat-stream": { "examples": { "default": { "$ref": "#/components/examples/octocat" } }, "schema": { "type": "string" } } }, "description": "Response" } }, "summary": "Get Octocat", "tags": [ "meta" ], "x-github": { "category": "meta", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/organizations": { "get": { "description": "Lists all organizations, in the order that they were created on GitHub.\n\n**Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-organizations" }, "operationId": "orgs/list", "parameters": [ { "$ref": "#/components/parameters/since-org" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-simple-items" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-simple" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "example": "; rel=\"next\"", "schema": { "type": "string" } } } }, "304": { "$ref": "#/components/responses/not_modified" } }, "summary": "List organizations", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}": { "get": { "description": "To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).\n\nGitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub 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.\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#get-an-organization" }, "operationId": "orgs/get", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default-response": { "$ref": "#/components/examples/organization-full-default-response" } }, "schema": { "$ref": "#/components/schemas/organization-full" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "patch": { "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).\n\nEnables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#update-an-organization" }, "operationId": "orgs/update", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "billing_email": "mona@github.com", "company": "GitHub", "default_repository_permission": "read", "description": "GitHub, the company.", "email": "mona@github.com", "location": "San Francisco", "members_allowed_repository_creation_type": "all", "members_can_create_repositories": true, "name": "github", "twitter_username": "github" } } }, "schema": { "properties": { "advanced_security_enabled_for_new_repositories": { "description": "Whether GitHub Advanced Security is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "billing_email": { "description": "Billing email address. This address is not publicized.", "type": "string" }, "blog": { "example": "\"http://github.blog\"", "type": "string" }, "company": { "description": "The company name.", "type": "string" }, "default_repository_permission": { "default": "read", "description": "Default permission level members have for organization repositories.", "enum": [ "read", "write", "admin", "none" ], "type": "string" }, "dependabot_alerts_enabled_for_new_repositories": { "description": "Whether Dependabot alerts is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "dependabot_security_updates_enabled_for_new_repositories": { "description": "Whether Dependabot security updates is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "dependency_graph_enabled_for_new_repositories": { "description": "Whether dependency graph is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "description": { "description": "The description of the company.", "type": "string" }, "email": { "description": "The publicly visible email address.", "type": "string" }, "has_organization_projects": { "description": "Whether an organization can use organization projects.", "type": "boolean" }, "has_repository_projects": { "description": "Whether repositories that belong to the organization can use repository projects.", "type": "boolean" }, "location": { "description": "The location.", "type": "string" }, "members_allowed_repository_creation_type": { "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" ], "type": "string" }, "members_can_create_internal_repositories": { "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.", "type": "boolean" }, "members_can_create_pages": { "default": true, "description": "Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted.", "type": "boolean" }, "members_can_create_private_pages": { "default": true, "description": "Whether organization members can create private GitHub Pages sites. Existing published sites will not be impacted.", "type": "boolean" }, "members_can_create_private_repositories": { "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.", "type": "boolean" }, "members_can_create_public_pages": { "default": true, "description": "Whether organization members can create public GitHub Pages sites. Existing published sites will not be impacted.", "type": "boolean" }, "members_can_create_public_repositories": { "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.", "type": "boolean" }, "members_can_create_repositories": { "default": true, "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.", "type": "boolean" }, "members_can_fork_private_repositories": { "default": false, "description": "Whether organization members can fork private organization repositories.", "type": "boolean" }, "name": { "description": "The shorthand name of the company.", "type": "string" }, "secret_scanning_enabled_for_new_repositories": { "description": "Whether secret scanning is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "secret_scanning_push_protection_custom_link": { "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.", "type": "string" }, "secret_scanning_push_protection_custom_link_enabled": { "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", "type": "boolean" }, "secret_scanning_push_protection_enabled_for_new_repositories": { "description": "Whether secret scanning push protection is automatically enabled for new repositories.\n\nTo 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).\"\n\nYou can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.", "type": "boolean" }, "twitter_username": { "description": "The Twitter username of the company.", "type": "string" }, "web_commit_signoff_required": { "default": false, "description": "Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-full" } }, "schema": { "$ref": "#/components/schemas/organization-full" } } }, "description": "Response" }, "409": { "$ref": "#/components/responses/conflict" }, "422": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/validation-error" }, { "$ref": "#/components/schemas/validation-error-simple" } ] } } }, "description": "Validation failed" } }, "summary": "Update an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/actions/cache/usage": { "get": { "description": "Gets the total GitHub Actions cache usage for an organization.\nThe 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.\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-github-actions-cache-usage-for-an-organization" }, "operationId": "actions/get-actions-cache-usage-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-cache-usage-org-enterprise" } }, "schema": { "$ref": "#/components/schemas/actions-cache-usage-org-enterprise" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "Get GitHub Actions cache usage for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cache" } } }, "/orgs/{org}/actions/cache/usage-by-repository": { "get": { "description": "Lists repositories and their GitHub Actions cache usage for an organization.\nThe 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.\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-repositories-with-github-actions-cache-usage-for-an-organization" }, "operationId": "actions/get-actions-cache-usage-by-repo-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/org-actions-cache-usage-by-repo" } }, "schema": { "properties": { "repository_cache_usages": { "items": { "$ref": "#/components/schemas/actions-cache-usage-by-repository" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repository_cache_usages" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List repositories with GitHub Actions cache usage for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cache" } } }, "/orgs/{org}/actions/oidc/customization/sub": { "get": { "description": "Gets the customization template for an OpenID Connect (OIDC) subject claim.\nYou must authenticate using an access token with the `read:org` scope to use this endpoint.\nGitHub Apps must have the `organization_administration:write` permission to use this endpoint.", "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" }, "operationId": "oidc/get-oidc-custom-sub-template-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/oidc-custom-sub" } }, "schema": { "$ref": "#/components/schemas/oidc-custom-sub" } } }, "description": "A JSON serialized template for OIDC subject claim customization" } }, "summary": "Get the customization template for an OIDC subject claim for an organization", "tags": [ "oidc" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "subcategory": "oidc" } }, "put": { "description": "Creates or updates the customization template for an OpenID Connect (OIDC) subject claim.\nYou must authenticate using an access token with the `write:org` scope to use this endpoint.\nGitHub Apps must have the `admin:org` permission to use this endpoint.", "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" }, "operationId": "oidc/update-oidc-custom-sub-template-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/oidc-custom-sub" } }, "schema": { "$ref": "#/components/schemas/oidc-custom-sub" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Empty response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Set the customization template for an OIDC subject claim for an organization", "tags": [ "oidc" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "previews": [], "subcategory": "oidc" } } }, "/orgs/{org}/actions/permissions": { "get": { "description": "Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-github-actions-permissions-for-an-organization" }, "operationId": "actions/get-github-actions-permissions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-organization-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-organization-permissions" } } }, "description": "Response" } }, "summary": "Get GitHub Actions permissions for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-github-actions-permissions-for-an-organization" }, "operationId": "actions/set-github-actions-permissions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "allowed_actions": "selected", "enabled_repositories": "all" } } }, "schema": { "properties": { "allowed_actions": { "$ref": "#/components/schemas/allowed-actions" }, "enabled_repositories": { "$ref": "#/components/schemas/enabled-repositories" } }, "required": [ "enabled_repositories" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set GitHub Actions permissions for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/repositories": { "get": { "description": "Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization" }, "operationId": "actions/list-selected-repositories-enabled-github-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/repository" }, "type": "array" }, "total_count": { "type": "number" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response" } }, "summary": "List selected repositories enabled for GitHub Actions in an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization" }, "operationId": "actions/set-selected-repositories-enabled-github-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 32, 42 ] } } }, "schema": { "properties": { "selected_repository_ids": { "description": "List of repository IDs to enable for GitHub Actions.", "items": { "description": "Unique identifier of the repository.", "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set selected repositories enabled for GitHub Actions in an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/repositories/{repository_id}": { "delete": { "description": "Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization" }, "operationId": "actions/disable-selected-repository-github-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Disable a selected repository for GitHub Actions in an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization" }, "operationId": "actions/enable-selected-repository-github-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Enable a selected repository for GitHub Actions in an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/selected-actions": { "get": { "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).\"\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-allowed-actions-for-an-organization" }, "operationId": "actions/get-allowed-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/selected-actions" } }, "schema": { "$ref": "#/components/schemas/selected-actions" } } }, "description": "Response" } }, "summary": "Get allowed actions and reusable workflows for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "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).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-allowed-actions-for-an-organization" }, "operationId": "actions/set-allowed-actions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "selected_actions": { "$ref": "#/components/examples/selected-actions" } }, "schema": { "$ref": "#/components/schemas/selected-actions" } } }, "required": false }, "responses": { "204": { "description": "Response" } }, "summary": "Set allowed actions and reusable workflows for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/orgs/{org}/actions/permissions/workflow": { "get": { "description": "Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,\nas well as whether GitHub Actions can submit approving pull request reviews. For more information, see\n\"[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).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-default-workflow-permissions" }, "operationId": "actions/get-github-actions-default-workflow-permissions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-default-workflow-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-get-default-workflow-permissions" } } }, "description": "Response" } }, "summary": "Get default workflow permissions for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions\ncan submit approving pull request reviews. For more information, see\n\"[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).\"\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-default-workflow-permissions" }, "operationId": "actions/set-github-actions-default-workflow-permissions-organization", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-default-workflow-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-set-default-workflow-permissions" } } }, "required": false }, "responses": { "204": { "description": "Success response" } }, "summary": "Set default workflow permissions for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/orgs/{org}/actions/required_workflows": { "get": { "description": "List all required workflows in an organization.\n\nYou must authenticate using an access token with the `read:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-required-workflows" }, "operationId": "actions/list-required-workflows", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/required-workflows-paginated" } }, "schema": { "properties": { "required_workflows": { "items": { "$ref": "#/components/schemas/required-workflow" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "required_workflows" ], "type": "object" } } }, "description": "Response" } }, "summary": "List required workflows", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } }, "post": { "description": "Create a required workflow in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-required-workflow" }, "operationId": "actions/create-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "repository_id": 53, "scope": "selected", "selected_repository_ids": [ 32, 91 ], "workflow_file_path": ".github/workflows/ci.yaml" } } }, "schema": { "properties": { "repository_id": { "description": "The ID of the repository that contains the workflow file.", "type": "string" }, "scope": { "default": "all", "description": "Enable the required workflow for all repositories or selected repositories in the organization.", "enum": [ "selected", "all" ], "type": "string" }, "selected_repository_ids": { "description": "A list of repository IDs where you want to enable the required workflow. You can only provide a list of repository ids when the `scope` is set to `selected`.", "items": { "description": "Unique identifier of the repository.", "type": "integer" }, "type": "array" }, "workflow_file_path": { "description": "Path of the workflow file to be configured as a required workflow.", "type": "string" } }, "required": [ "workflow_file_path", "repository_id" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/required-workflow" } }, "schema": { "$ref": "#/components/schemas/required-workflow" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Create a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/orgs/{org}/actions/required_workflows/{required_workflow_id}": { "delete": { "description": "Deletes a required workflow configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-a-required-workflow" }, "operationId": "actions/delete-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } }, "get": { "description": "Get a required workflow configured in an organization.\n\nYou must authenticate using an access token with the `read:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-required-workflow" }, "operationId": "actions/get-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/required-workflow" } }, "schema": { "$ref": "#/components/schemas/required-workflow" } } }, "description": "Response" } }, "summary": "Get a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } }, "patch": { "description": "Update a required workflow in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#update-a-required-workflow" }, "operationId": "actions/update-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "repository_id": 53, "scope": "selected", "selected_repository_ids": [ 32, 91 ], "workflow_file_path": ".github/workflows/ci.yaml" } } }, "schema": { "properties": { "repository_id": { "description": "The ID of the repository that contains the workflow file.", "type": "string" }, "scope": { "default": "all", "description": "Enable the required workflow for all repositories or selected repositories in the organization.", "enum": [ "selected", "all" ], "type": "string" }, "selected_repository_ids": { "description": "A list of repository IDs where you want to enable the required workflow. A list of repository IDs where you want to enable the required workflow. You can only provide a list of repository ids when the `scope` is set to `selected`.", "items": { "description": "Unique identifier of the repository.", "type": "integer" }, "type": "array" }, "workflow_file_path": { "description": "Path of the workflow file to be configured as a required workflow.", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/required-workflow" } }, "schema": { "$ref": "#/components/schemas/required-workflow" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Update a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories": { "get": { "description": "Lists the selected repositories that are configured for a required workflow in an organization. To use this endpoint, the required workflow must be configured to run on selected repositories.\n\nYou must authenticate using an access token with the `read:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation https://docs.github.com/rest/reference/actions#list-selected-repositories-required-workflows", "url": "https://docs.github.com/rest/reference/actions#list-selected-repositories-required-workflows" }, "operationId": "actions/list-selected-repositories-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/repository" }, "type": "array" }, "total_count": { "type": "number" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Success" }, "404": { "description": "Resource Not Found" } }, "summary": "List selected repositories for a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } }, "put": { "description": "Sets the repositories for a required workflow that is required for selected repositories.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-selected-repositories-for-a-required-workflow" }, "operationId": "actions/set-selected-repos-to-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 32, 91 ] } } }, "schema": { "properties": { "selected_repository_ids": { "description": "The IDs of the repositories for which the workflow should be required.", "items": { "description": "Unique identifier of the repository.", "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Sets repositories for a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}": { "delete": { "description": "Removes a repository from a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-a-repository-from-selected-repositories-list-for-a-required-workflow" }, "operationId": "actions/remove-selected-repo-from-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Success" }, "404": { "description": "Resource Not Found" }, "422": { "description": "Validation Error" } }, "summary": "Remove a selected repository from required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } }, "put": { "description": "Adds a repository to a required workflow. To use this endpoint, the required workflow must be configured to run on selected repositories.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\nFor more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#add-a-repository-to-selected-repositories-list-for-a-required-workflow" }, "operationId": "actions/add-selected-repo-to-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/required-workflow-id" }, { "$ref": "#/components/parameters/repository-id" } ], "responses": { "204": { "description": "Success" }, "404": { "description": "Resource Not Found" }, "422": { "description": "Validation Error" } }, "summary": "Add a repository to a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/orgs/{org}/actions/runners": { "get": { "description": "Lists all self-hosted runners configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-an-organization" }, "operationId": "actions/list-self-hosted-runners-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } }, "schema": { "properties": { "runners": { "items": { "$ref": "#/components/schemas/runner" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "runners" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List self-hosted runners for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/downloads": { "get": { "description": "Lists binaries for the runner application that you can download and run.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-runner-applications-for-an-organization" }, "operationId": "actions/list-runner-applications-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner-application-items" } }, "schema": { "items": { "$ref": "#/components/schemas/runner-application" }, "type": "array" } } }, "description": "Response" } }, "summary": "List runner applications for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/registration-token": { "post": { "description": "Returns a token that you can pass to the `config` script. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n#### Example using registration token\n\nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/octo-org --token TOKEN\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-registration-token-for-an-organization" }, "operationId": "actions/create-registration-token-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authentication-token" } }, "schema": { "$ref": "#/components/schemas/authentication-token" } } }, "description": "Response" } }, "summary": "Create a registration token for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/remove-token": { "post": { "description": "Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\n\n#### Example using remove token\n\nTo remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this\nendpoint.\n\n```\n./config.sh remove --token TOKEN\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-remove-token-for-an-organization" }, "operationId": "actions/create-remove-token-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authentication-token-2" } }, "schema": { "$ref": "#/components/schemas/authentication-token" } } }, "description": "Response" } }, "summary": "Create a remove token for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/{runner_id}": { "delete": { "description": "Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization" }, "operationId": "actions/delete-self-hosted-runner-from-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a self-hosted runner from an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "get": { "description": "Gets a specific self-hosted runner configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/get-self-hosted-runner-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner" } }, "schema": { "$ref": "#/components/schemas/runner" } } }, "description": "Response" } }, "summary": "Get a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/{runner_id}/labels": { "delete": { "description": "Remove all custom labels from a self-hosted runner configured in an\norganization. Returns the remaining read-only labels from the runner.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/remove-all-custom-labels-from-self-hosted-runner-for-org", "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" } }, "summary": "Remove all custom labels from a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "get": { "description": "Lists all labels for a self-hosted runner configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-labels-for-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/list-labels-for-self-hosted-runner-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "$ref": "#/components/responses/actions_runner_labels" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List labels for a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "post": { "description": "Add custom labels to a self-hosted runner configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#add-custom-labels-to-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/add-custom-labels-to-self-hosted-runner-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "labels": [ "gpu", "accelerated" ] } } }, "schema": { "properties": { "labels": { "description": "The names of the custom labels to add to the runner.", "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" } }, "required": [ "labels" ], "type": "object" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/actions_runner_labels" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Add custom labels to a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "put": { "description": "Remove all previous custom labels and set the new custom labels for a specific\nself-hosted runner configured in an organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-custom-labels-for-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/set-custom-labels-for-self-hosted-runner-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/runner-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "labels": [ "gpu", "accelerated" ] } } }, "schema": { "properties": { "labels": { "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" }, "maxItems": 100, "minItems": 0, "type": "array" } }, "required": [ "labels" ], "type": "object" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/actions_runner_labels" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Set custom labels for a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/runners/{runner_id}/labels/{name}": { "delete": { "description": "Remove a custom label from a self-hosted runner configured\nin an organization. Returns the remaining labels from the runner.\n\nThis endpoint returns a `404 Not Found` status if the custom label is not\npresent on the runner.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization" }, "operationId": "actions/remove-custom-label-from-self-hosted-runner-for-org", "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" } }, "summary": "Remove a custom label from a self-hosted runner for an organization", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/orgs/{org}/actions/secrets": { "get": { "description": "Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-organization-secrets" }, "operationId": "actions/list-org-secrets", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-actions-secret-paginated" } }, "schema": { "properties": { "secrets": { "items": { "$ref": "#/components/schemas/organization-actions-secret" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "secrets" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization secrets", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/public-key": { "get": { "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-an-organization-public-key" }, "operationId": "actions/get-org-public-key", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-public-key" } }, "schema": { "$ref": "#/components/schemas/actions-public-key" } } }, "description": "Response" } }, "summary": "Get an organization public key", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}": { "delete": { "description": "Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-an-organization-secret" }, "operationId": "actions/delete-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "get": { "description": "Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-an-organization-secret" }, "operationId": "actions/get-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-actions-secret" } }, "schema": { "$ref": "#/components/schemas/organization-actions-secret" } } }, "description": "Response" } }, "summary": "Get an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "description": "Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to\nuse this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.\n\n```\nconst sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n```\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret" }, "operationId": "actions/create-or-update-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678", "selected_repository_ids": [ 1296269, 1296280 ], "visibility": "selected" } } }, "schema": { "properties": { "encrypted_value": { "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/reference/actions#get-an-organization-public-key) endpoint.", "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "key_id": { "description": "ID of the key you used to encrypt the secret.", "type": "string" }, "selected_repository_ids": { "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/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" }, "type": "array" }, "visibility": { "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" ], "type": "string" } }, "required": [ "visibility" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a secret" }, "204": { "description": "Response when updating a secret" } }, "summary": "Create or update an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}/repositories": { "get": { "description": "Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret" }, "operationId": "actions/list-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response" } }, "summary": "List selected repositories for an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "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/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret" }, "operationId": "actions/set-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 64780797 ] } } }, "schema": { "properties": { "selected_repository_ids": { "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/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set selected repositories for an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}": { "delete": { "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/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret" }, "operationId": "actions/remove-selected-repo-from-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Remove selected repository from an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "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/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#add-selected-repository-to-an-organization-secret" }, "operationId": "actions/add-selected-repo-to-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Add selected repository to an organization secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/actions/variables": { "get": { "description": "Lists all organization variables. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#list-organization-variables" }, "operationId": "actions/list-org-variables", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variables-per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-actions-variables-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "variables": { "items": { "$ref": "#/components/schemas/organization-actions-variable" }, "type": "array" } }, "required": [ "total_count", "variables" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization variables", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "post": { "description": "Creates an organization variable that you can reference in a GitHub Actions workflow.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\nGitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#create-an-organization-variable" }, "operationId": "actions/create-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "name": "USERNAME", "selected_repository_ids": [ 1296269, 1296280 ], "value": "octocat", "visibility": "selected" } } }, "schema": { "properties": { "name": { "description": "The name of the variable.", "type": "string" }, "selected_repository_ids": { "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" }, "type": "array" }, "value": { "description": "The value of the variable.", "type": "string" }, "visibility": { "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" ], "type": "string" } }, "required": [ "name", "value", "visibility" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a variable" } }, "summary": "Create an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/orgs/{org}/actions/variables/{name}": { "delete": { "description": "Deletes an organization variable using the variable name.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\nGitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#delete-an-organization-variable" }, "operationId": "actions/delete-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "get": { "description": "Gets a specific variable in an organization. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#get-an-organization-variable" }, "operationId": "actions/get-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-actions-variable" } }, "schema": { "$ref": "#/components/schemas/organization-actions-variable" } } }, "description": "Response" } }, "summary": "Get an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "patch": { "description": "Updates an organization variable that you can reference in a GitHub Actions workflow.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.\nGitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#update-an-organization-variable" }, "operationId": "actions/update-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "name": "USERNAME", "selected_repository_ids": [ 1296269, 1296280 ], "value": "octocat", "visibility": "selected" } } }, "schema": { "properties": { "name": { "description": "The name of the variable.", "type": "string" }, "selected_repository_ids": { "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" }, "type": "array" }, "value": { "description": "The value of the variable.", "type": "string" }, "visibility": { "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" ], "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Update an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/orgs/{org}/actions/variables/{name}/repositories": { "get": { "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. GitHub Apps must have the `organization_actions_variables:read` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable" }, "operationId": "actions/list-selected-repos-for-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response" }, "409": { "description": "Response when the visibility of the variable is not set to `selected`" } }, "summary": "List selected repositories for an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "put": { "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. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable" }, "operationId": "actions/set-selected-repos-for-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 64780797 ] } } }, "schema": { "properties": { "selected_repository_ids": { "description": "The IDs of the repositories that can access the organization variable.", "items": { "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" }, "409": { "description": "Response when the visibility of the variable is not set to `selected`" } }, "summary": "Set selected repositories for an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/orgs/{org}/actions/variables/{name}/repositories/{repository_id}": { "delete": { "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. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable" }, "operationId": "actions/remove-selected-repo-from-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" }, { "in": "path", "name": "repository_id", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Response" }, "409": { "description": "Response when the visibility of the variable is not set to `selected`" } }, "summary": "Remove selected repository from an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "put": { "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. GitHub Apps must have the `organization_actions_variables:write` organization permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable" }, "operationId": "actions/add-selected-repo-to-org-variable", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/variable-name" }, { "in": "path", "name": "repository_id", "required": true, "schema": { "type": "integer" } } ], "responses": { "204": { "description": "Response" }, "409": { "description": "Response when the visibility of the variable is not set to `selected`" } }, "summary": "Add selected repository to an organization variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/orgs/{org}/blocks": { "get": { "description": "List the users blocked by an organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-users-blocked-by-an-organization" }, "operationId": "orgs/list-blocked-users", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response" } }, "summary": "List users blocked by an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "blocking" } } }, "/orgs/{org}/blocks/{username}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#unblock-a-user-from-an-organization" }, "operationId": "orgs/unblock-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "summary": "Unblock a user from an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "blocking" } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#check-if-a-user-is-blocked-by-an-organization" }, "operationId": "orgs/check-blocked-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "If the user is blocked" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } }, "description": "If the user is not blocked" } }, "summary": "Check if a user is blocked by an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "blocking" } }, "put": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#block-a-user-from-an-organization" }, "operationId": "orgs/block-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Block a user from an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "blocking" } } }, "/orgs/{org}/code-scanning/alerts": { "get": { "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).\"\n\nTo 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.\n\nFor public repositories, you may instead use the `public_repo` scope.\n\nGitHub Apps must have the `security_events` read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-by-organization" }, "operationId": "code-scanning/list-alerts-for-org", "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" }, { "description": "If specified, only code scanning alerts with this state will be returned.", "in": "query", "name": "state", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-alert-state" } }, { "description": "The property by which to sort the results.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created", "updated" ], "type": "string" } }, { "description": "If specified, only code scanning alerts with this severity will be returned.", "in": "query", "name": "severity", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-alert-severity" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-organization-alert-items" } }, "schema": { "items": { "$ref": "#/components/schemas/code-scanning-organization-alert-items" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List code scanning alerts for an organization", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/codespaces": { "get": { "description": "Lists the codespaces associated to a specified organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-in-organization" }, "operationId": "codespaces/list-in-organization", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-list" } }, "schema": { "properties": { "codespaces": { "items": { "$ref": "#/components/schemas/codespace" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "codespaces" ], "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "List codespaces for the organization", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/codespaces/billing": { "put": { "description": "Sets which users can access codespaces in an organization. This is synonymous with granting or revoking codespaces billing permissions for users according to the visibility.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#set-codespaces-billing" }, "operationId": "codespaces/set-codespaces-billing", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_usernames": [ "johnDoe", "atomIO" ], "visibility": "selected_members" } } }, "schema": { "properties": { "selected_usernames": { "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, "type": "array" }, "visibility": { "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" ], "type": "string" } }, "required": [ "visibility" ], "type": "object" } } }, "required": true }, "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" } }, "summary": "Manage access control for organization codespaces", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/codespaces/billing/selected_users": { "delete": { "description": "Codespaces for the specified users will no longer be billed to the organization.\nTo use this endpoint, the billing settings for the organization must be set to `selected_members`. For information on how to change this setting please see [these docs].(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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#delete-codespaces-billing-users" }, "operationId": "codespaces/delete-codespaces-billing-users", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_usernames": [ "johnDoe", "atomIO" ] } } }, "schema": { "properties": { "selected_usernames": { "description": "The usernames of the organization members whose codespaces should not be billed to the organization.", "items": { "type": "string" }, "maxItems": 100, "type": "array" } }, "required": [ "selected_usernames" ], "type": "object" } } }, "required": true }, "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" } }, "summary": "Removes users from Codespaces billing for an organization", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } }, "post": { "description": "Codespaces for the specified users will be billed to the organization.\nTo use this endpoint, the billing settings for the organization must be set to `selected_members`. For information on how to change this setting please see [these docs].(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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#set-codespaces-billing-users" }, "operationId": "codespaces/set-codespaces-billing-users", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_usernames": [ "johnDoe", "atomIO" ] } } }, "schema": { "properties": { "selected_usernames": { "description": "The usernames of the organization members whose codespaces be billed to the organization.", "items": { "type": "string" }, "maxItems": 100, "type": "array" } }, "required": [ "selected_usernames" ], "type": "object" } } }, "required": true }, "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" } }, "summary": "Add users to Codespaces billing for an organization", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/codespaces/secrets": { "get": { "description": "Lists all Codespaces secrets available at the organization-level without revealing their encrypted values.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-organization-secrets" }, "operationId": "codespaces/list-org-secrets", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-codespaces-secret-paginated" } }, "schema": { "properties": { "secrets": { "items": { "$ref": "#/components/schemas/codespaces-org-secret" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "secrets" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization secrets", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } } }, "/orgs/{org}/codespaces/secrets/public-key": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#get-an-organization-public-key" }, "operationId": "codespaces/get-org-public-key", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-public-key" } }, "schema": { "$ref": "#/components/schemas/codespaces-public-key" } } }, "description": "Response" } }, "summary": "Get an organization public key", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } } }, "/orgs/{org}/codespaces/secrets/{secret_name}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#delete-an-organization-secret" }, "operationId": "codespaces/delete-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } }, "get": { "description": "Gets an organization secret without revealing its encrypted value.\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#get-an-organization-secret" }, "operationId": "codespaces/get-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-codespaces-secret" } }, "schema": { "$ref": "#/components/schemas/codespaces-org-secret" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "Get an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } }, "put": { "description": "Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `admin:org` scope to use this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.\n\n```\nconst sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n```\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#create-or-update-an-organization-secret" }, "operationId": "codespaces/create-or-update-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678", "selected_repository_ids": [ 1296269, 1296280 ], "visibility": "selected" } } }, "schema": { "properties": { "encrypted_value": { "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/reference/codespaces#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})$", "type": "string" }, "key_id": { "description": "The ID of the key you used to encrypt the secret.", "type": "string" }, "selected_repository_ids": { "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/reference/codespaces#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/codespaces#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/codespaces#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" }, "type": "array" }, "visibility": { "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" ], "type": "string" } }, "required": [ "visibility" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a secret" }, "204": { "description": "Response when updating a secret" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create or update an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } } }, "/orgs/{org}/codespaces/secrets/{secret_name}/repositories": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-selected-repositories-for-an-organization-secret" }, "operationId": "codespaces/list-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List selected repositories for an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } }, "put": { "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/reference/codespaces#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#set-selected-repositories-for-an-organization-secret" }, "operationId": "codespaces/set-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 64780797 ] } } }, "schema": { "properties": { "selected_repository_ids": { "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/reference/codespaces#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/codespaces#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "409": { "description": "Conflict when visibility type not set to selected" } }, "summary": "Set selected repositories for an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } } }, "/orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}": { "delete": { "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/reference/codespaces#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#remove-selected-repository-from-an-organization-secret" }, "operationId": "codespaces/remove-selected-repo-from-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Remove selected repository from an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } }, "put": { "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/reference/codespaces#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#add-selected-repository-to-an-organization-secret" }, "operationId": "codespaces/add-selected-repo-to-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Add selected repository to an organization secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organization-secrets" } } }, "/orgs/{org}/dependabot/alerts": { "get": { "description": "Lists Dependabot alerts for an organization.\n\nTo 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.\n\nFor public repositories, you may instead use the `public_repo` scope.\n\nGitHub Apps must have **Dependabot alerts** read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization" }, "operationId": "dependabot/list-alerts-for-org", "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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/dependabot-alerts-for-organization" } }, "schema": { "items": { "$ref": "#/components/schemas/dependabot-alert-with-repository" }, "type": "array" } } }, "description": "Response" }, "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" } }, "summary": "List Dependabot alerts for an organization", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "alerts" } } }, "/orgs/{org}/dependabot/secrets": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#list-organization-secrets" }, "operationId": "dependabot/list-org-secrets", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-dependabot-secret-paginated" } }, "schema": { "properties": { "secrets": { "items": { "$ref": "#/components/schemas/organization-dependabot-secret" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "secrets" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization secrets", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/dependabot/secrets/public-key": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#get-an-organization-public-key" }, "operationId": "dependabot/get-org-public-key", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/dependabot-public-key" } }, "schema": { "$ref": "#/components/schemas/dependabot-public-key" } } }, "description": "Response" } }, "summary": "Get an organization public key", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/dependabot/secrets/{secret_name}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#delete-an-organization-secret" }, "operationId": "dependabot/delete-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#get-an-organization-secret" }, "operationId": "dependabot/get-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-dependabot-secret" } }, "schema": { "$ref": "#/components/schemas/organization-dependabot-secret" } } }, "description": "Response" } }, "summary": "Get an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "description": "Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `admin:org` scope to use this endpoint. GitHub Apps must have the `dependabot_secrets` organization\npermission to use this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.\n\n```\nconst sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n```\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#create-or-update-an-organization-secret" }, "operationId": "dependabot/create-or-update-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678", "selected_repository_ids": [ "1296269", "1296280" ], "visibility": "selected" } } }, "schema": { "properties": { "encrypted_value": { "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/reference/dependabot#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})$", "type": "string" }, "key_id": { "description": "ID of the key you used to encrypt the secret.", "type": "string" }, "selected_repository_ids": { "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/reference/dependabot#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/dependabot#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/dependabot#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "string" }, "type": "array" }, "visibility": { "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" ], "type": "string" } }, "required": [ "visibility" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a secret" }, "204": { "description": "Response when updating a secret" } }, "summary": "Create or update an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/dependabot/secrets/{secret_name}/repositories": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#list-selected-repositories-for-an-organization-secret" }, "operationId": "dependabot/list-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/public-repository-paginated" } }, "schema": { "properties": { "repositories": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "repositories" ], "type": "object" } } }, "description": "Response" } }, "summary": "List selected repositories for an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "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/reference/dependabot#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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#set-selected-repositories-for-an-organization-secret" }, "operationId": "dependabot/set-selected-repos-for-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "selected_repository_ids": [ 64780797 ] } } }, "schema": { "properties": { "selected_repository_ids": { "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/reference/dependabot#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/dependabot#remove-selected-repository-from-an-organization-secret) endpoints.", "items": { "type": "integer" }, "type": "array" } }, "required": [ "selected_repository_ids" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set selected repositories for an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}": { "delete": { "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/reference/dependabot#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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#remove-selected-repository-from-an-organization-secret" }, "operationId": "dependabot/remove-selected-repo-from-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Remove selected repository from an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "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/reference/dependabot#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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/dependabot#add-selected-repository-to-an-organization-secret" }, "operationId": "dependabot/add-selected-repo-to-org-secret", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/secret-name" }, { "in": "path", "name": "repository_id", "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" } }, "summary": "Add selected repository to an organization secret", "tags": [ "dependabot" ], "x-github": { "category": "dependabot", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/orgs/{org}/events": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/activity#list-public-organization-events" }, "operationId": "activity/list-public-org-events", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "200-response": { "$ref": "#/components/examples/public-org-events-items" } }, "schema": { "items": { "$ref": "#/components/schemas/event" }, "type": "array" } } }, "description": "Response" } }, "summary": "List public organization events", "tags": [ "activity" ], "x-github": { "category": "activity", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "events" } } }, "/orgs/{org}/failed_invitations": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-failed-organization-invitations" }, "operationId": "orgs/list-failed-invitations", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-invitation-items" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-invitation" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List failed organization invitations", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/hooks": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-organization-webhooks" }, "operationId": "orgs/list-webhooks", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/org-hook-items" } }, "schema": { "items": { "$ref": "#/components/schemas/org-hook" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List organization webhooks", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } }, "post": { "description": "Here's how you can create a hook that posts payloads in JSON format:", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#create-an-organization-webhook" }, "operationId": "orgs/create-webhook", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "active": true, "config": { "content_type": "json", "url": "http://example.com/webhook" }, "events": [ "push", "pull_request" ], "name": "web" } } }, "schema": { "properties": { "active": { "default": true, "description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.", "type": "boolean" }, "config": { "description": "Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params).", "properties": { "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" }, "password": { "example": "\"password\"", "type": "string" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "url": { "$ref": "#/components/schemas/webhook-config-url" }, "username": { "example": "\"kdaigle\"", "type": "string" } }, "required": [ "url" ], "type": "object" }, "events": { "default": [ "push" ], "description": "Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `[\"*\"]` to receive all possible events.", "items": { "type": "string" }, "type": "array" }, "name": { "description": "Must be passed as \"web\".", "type": "string" } }, "required": [ "name", "config" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/org-hook" } }, "schema": { "$ref": "#/components/schemas/org-hook" } } }, "description": "Response", "headers": { "Location": { "example": "https://api.github.com/orgs/octocat/hooks/1", "schema": { "type": "string" } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#delete-an-organization-webhook" }, "operationId": "orgs/delete-webhook", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } }, "get": { "description": "Returns a webhook configured in an organization. To get only the webhook `config` properties, see \"[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#get-an-organization-webhook" }, "operationId": "orgs/get-webhook", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/org-hook" } }, "schema": { "$ref": "#/components/schemas/org-hook" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } }, "patch": { "description": "Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use \"[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#update-an-organization-webhook" }, "operationId": "orgs/update-webhook", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "active": true, "events": [ "pull_request" ] } } }, "schema": { "properties": { "active": { "default": true, "description": "Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.", "type": "boolean" }, "config": { "description": "Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params).", "properties": { "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "url": { "$ref": "#/components/schemas/webhook-config-url" } }, "required": [ "url" ], "type": "object" }, "events": { "default": [ "push" ], "description": "Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for.", "items": { "type": "string" }, "type": "array" }, "name": { "example": "\"web\"", "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/org-hook-2" } }, "schema": { "$ref": "#/components/schemas/org-hook" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/config": { "get": { "description": "Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use \"[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook).\"\n\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#get-a-webhook-configuration-for-an-organization" }, "operationId": "orgs/get-webhook-config-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/webhook-config" } }, "schema": { "$ref": "#/components/schemas/webhook-config" } } }, "description": "Response" } }, "summary": "Get a webhook configuration for an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } }, "patch": { "description": "Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use \"[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook).\"\n\nAccess tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#update-a-webhook-configuration-for-an-organization" }, "operationId": "orgs/update-webhook-config-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Update an existing webhook", "value": { "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "http://example.com/webhook" } } }, "schema": { "properties": { "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "url": { "$ref": "#/components/schemas/webhook-config-url" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/webhook-config" } }, "schema": { "$ref": "#/components/schemas/webhook-config" } } }, "description": "Response" } }, "summary": "Update a webhook configuration for an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/deliveries": { "get": { "description": "Returns a list of webhook deliveries for a webhook configured in an organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-deliveries-for-an-organization-webhook" }, "operationId": "orgs/list-webhook-deliveries", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/cursor" }, { "in": "query", "name": "redelivery", "required": false, "schema": { "type": "boolean" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/hook-delivery-items" } }, "schema": { "items": { "$ref": "#/components/schemas/hook-delivery-item" }, "type": "array" } } }, "description": "Response" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List deliveries for an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}": { "get": { "description": "Returns a delivery for a webhook configured in an organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#get-a-webhook-delivery-for-an-organization-webhook" }, "operationId": "orgs/get-webhook-delivery", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" }, { "$ref": "#/components/parameters/delivery-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/hook-delivery" } }, "schema": { "$ref": "#/components/schemas/hook-delivery" } } }, "description": "Response" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Get a webhook delivery for an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": { "post": { "description": "Redeliver a delivery for a webhook configured in an organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#redeliver-a-delivery-for-an-organization-webhook" }, "operationId": "orgs/redeliver-webhook-delivery", "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" } }, "summary": "Redeliver a delivery for an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/hooks/{hook_id}/pings": { "post": { "description": "This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#ping-an-organization-webhook" }, "operationId": "orgs/ping-webhook", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/hook-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Ping an organization webhook", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "webhooks" } } }, "/orgs/{org}/installation": { "get": { "description": "Enables an authenticated GitHub App to find the organization's installation information.\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app" }, "operationId": "apps/get-org-installation", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/installation" } }, "schema": { "$ref": "#/components/schemas/installation" } } }, "description": "Response" } }, "summary": "Get an organization installation for the authenticated app", "tags": [ "apps" ], "x-github": { "category": "apps", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/installations": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-app-installations-for-an-organization" }, "operationId": "orgs/list-app-installations", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/installation-paginated" } }, "schema": { "properties": { "installations": { "items": { "$ref": "#/components/schemas/installation" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "installations" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List app installations for an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/interaction-limits": { "delete": { "description": "Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-for-an-organization" }, "operationId": "interactions/remove-restrictions-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove interaction restrictions for an organization", "tags": [ "interactions" ], "x-github": { "category": "interactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "orgs" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-an-organization" }, "operationId": "interactions/get-restrictions-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/interaction-limit-response" } }, "schema": { "anyOf": [ { "$ref": "#/components/schemas/interaction-limit-response" }, { "additionalProperties": false, "properties": {}, "type": "object" } ] } } }, "description": "Response" } }, "summary": "Get interaction restrictions for an organization", "tags": [ "interactions" ], "x-github": { "category": "interactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "orgs" } }, "put": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-an-organization" }, "operationId": "interactions/set-restrictions-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "expiry": "one_month", "limit": "collaborators_only" } } }, "schema": { "$ref": "#/components/schemas/interaction-limit" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/interaction-limit-response" } }, "schema": { "$ref": "#/components/schemas/interaction-limit-response" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set interaction restrictions for an organization", "tags": [ "interactions" ], "x-github": { "category": "interactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/invitations": { "get": { "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`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-pending-organization-invitations" }, "operationId": "orgs/list-pending-invitations", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "description": "Filter invitations by their member role.", "in": "query", "name": "role", "required": false, "schema": { "default": "all", "enum": [ "all", "admin", "direct_member", "billing_manager", "hiring_manager" ], "type": "string" } }, { "description": "Filter invitations by their invitation source.", "in": "query", "name": "invitation_source", "required": false, "schema": { "default": "all", "enum": [ "all", "member", "scim" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-invitation-items" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-invitation" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List pending organization invitations", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "post": { "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.\n\nThis 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#create-an-organization-invitation" }, "operationId": "orgs/create-invitation", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "email": "octocat@github.com", "role": "direct_member", "team_ids": [ 12, 26 ] } } }, "schema": { "properties": { "email": { "description": "**Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user.", "type": "string" }, "invitee_id": { "description": "**Required unless you provide `email`**. GitHub user ID for the person you are inviting.", "type": "integer" }, "role": { "default": "direct_member", "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" ], "type": "string" }, "team_ids": { "description": "Specify IDs for the teams you want to invite new members to.", "items": { "type": "integer" }, "type": "array" } }, "type": "object" } } }, "required": false }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-invitation" } }, "schema": { "$ref": "#/components/schemas/organization-invitation" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create an organization invitation", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members", "triggersNotification": true } } }, "/orgs/{org}/invitations/{invitation_id}": { "delete": { "description": "Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.\n\nThis endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#cancel-an-organization-invitation" }, "operationId": "orgs/cancel-invitation", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/invitation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Cancel an organization invitation", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members", "triggersNotification": true } } }, "/orgs/{org}/invitations/{invitation_id}/teams": { "get": { "description": "List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-organization-invitation-teams" }, "operationId": "orgs/list-invitation-teams", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/invitation-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List organization invitation teams", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/issues": { "get": { "description": "List issues in an organization assigned to the authenticated user.\n\n**Note**: GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this\nreason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by\nthe `pull_request` key. Be aware that the `id` of a pull request returned from \"Issues\" endpoints will be an _issue id_. To find out the pull\nrequest id, use the \"[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)\" endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user" }, "operationId": "issues/list-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "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", "name": "filter", "required": false, "schema": { "default": "assigned", "enum": [ "assigned", "created", "mentioned", "subscribed", "repos", "all" ], "type": "string" } }, { "description": "Indicates the state of the issues to return.", "in": "query", "name": "state", "required": false, "schema": { "default": "open", "enum": [ "open", "closed", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/labels" }, { "description": "What to sort results by.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created", "updated", "comments" ], "type": "string" } }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/since" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/issue-with-repo-items" } }, "schema": { "items": { "$ref": "#/components/schemas/issue" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List organization issues assigned to the authenticated user", "tags": [ "issues" ], "x-github": { "category": "issues", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/members": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-organization-members" }, "operationId": "orgs/list-members", "parameters": [ { "$ref": "#/components/parameters/org" }, { "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", "name": "filter", "required": false, "schema": { "default": "all", "enum": [ "2fa_disabled", "all" ], "type": "string" } }, { "description": "Filter members returned by their role.", "in": "query", "name": "role", "required": false, "schema": { "default": "all", "enum": [ "all", "admin", "member" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List organization members", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/members/{username}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#remove-an-organization-member" }, "operationId": "orgs/remove-member", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Remove an organization member", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "get": { "description": "Check if a user is, publicly or privately, a member of the organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user" }, "operationId": "orgs/check-membership-for-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" } }, "summary": "Check organization membership for a user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/members/{username}/codespaces": { "get": { "description": "Lists the codespaces that a member of an organization has for repositories in that organization.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#get-codespaces-for-user-in-org" }, "operationId": "codespaces/get-codespaces-for-user-in-org", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-list" } }, "schema": { "properties": { "codespaces": { "items": { "$ref": "#/components/schemas/codespace" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "codespaces" ], "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "List codespaces for a user in organization", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/members/{username}/codespaces/{codespace_name}": { "delete": { "description": "Deletes a user's codespace.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces" }, "operationId": "codespaces/delete-from-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" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "Delete a codespace from the organization", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/members/{username}/codespaces/{codespace_name}/stop": { "post": { "description": "Stops a user's codespace.\n\nYou must authenticate using an access token with the `admin:org` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces" }, "operationId": "codespaces/stop-in-organization", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" }, { "$ref": "#/components/parameters/codespace-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespace" } }, "schema": { "$ref": "#/components/schemas/codespace" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "Stop a codespace for an organization user", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "organizations" } } }, "/orgs/{org}/memberships/{username}": { "delete": { "description": "In order to remove a user's membership with an organization, the authenticated user must be an organization owner.\n\nIf the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#remove-organization-membership-for-a-user" }, "operationId": "orgs/remove-membership-for-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" } }, "summary": "Remove organization membership for a user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user" }, "operationId": "orgs/get-membership-for-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "content": { "application/json": { "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" } }, "schema": { "$ref": "#/components/schemas/org-membership" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get organization membership for a user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "put": { "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/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.\n \n* Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.\n\n**Rate limits**\n\nTo prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#set-organization-membership-for-a-user" }, "operationId": "orgs/set-membership-for-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Set an organization membership role for a user", "value": { "role": "member" } } }, "schema": { "properties": { "role": { "default": "member", "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" ], "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "response-if-user-already-had-membership-with-organization": { "$ref": "#/components/examples/org-membership-response-if-user-has-an-active-admin-membership-with-organization" } }, "schema": { "$ref": "#/components/schemas/org-membership" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set organization membership for a user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/migrations": { "get": { "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).\n\nA list of `repositories` is only returned for export migrations.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#list-organization-migrations" }, "operationId": "migrations/list-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "description": "Exclude attributes from the API response to improve performance", "in": "query", "name": "exclude", "schema": { "items": { "description": "Allowed values that can be passed to the exclude param.", "enum": [ "repositories" ], "example": "repositories", "type": "string" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/migration-with-short-org-items" } }, "schema": { "items": { "$ref": "#/components/schemas/migration" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization migrations", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } }, "post": { "description": "Initiates the generation of a migration archive.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#start-an-organization-migration" }, "operationId": "migrations/start-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "lock_repositories": true, "repositories": [ "github/Hello-World" ] } } }, "schema": { "properties": { "exclude": { "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": { "enum": [ "repositories" ], "type": "string" }, "type": "array" }, "exclude_attachments": { "default": false, "description": "Indicates whether attachments should be excluded from the migration (to reduce migration archive file size).", "example": true, "type": "boolean" }, "exclude_git_data": { "default": false, "description": "Indicates whether the repository git data should be excluded from the migration.", "type": "boolean" }, "exclude_metadata": { "default": false, "description": "Indicates whether metadata should be excluded and only git source should be included for the migration.", "type": "boolean" }, "exclude_owner_projects": { "default": false, "description": "Indicates whether projects owned by the organization or users should be excluded. from the migration.", "example": true, "type": "boolean" }, "exclude_releases": { "default": false, "description": "Indicates whether releases should be excluded from the migration (to reduce migration archive file size).", "example": true, "type": "boolean" }, "lock_repositories": { "default": false, "description": "Indicates whether repositories should be locked (to prevent manipulation) while migrating data.", "example": true, "type": "boolean" }, "org_metadata_only": { "default": false, "description": "Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags).", "example": true, "type": "boolean" }, "repositories": { "description": "A list of arrays indicating which repositories should be migrated.", "items": { "type": "string" }, "type": "array" } }, "required": [ "repositories" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/migration-with-short-org-2" } }, "schema": { "$ref": "#/components/schemas/migration" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Start an organization migration", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/migrations/{migration_id}": { "get": { "description": "Fetches the status of a migration.\n\nThe `state` of a migration can be one of the following values:\n\n* `pending`, which means the migration hasn't started yet.\n* `exporting`, which means the migration is in progress.\n* `exported`, which means the migration finished successfully.\n* `failed`, which means the migration failed.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status" }, "operationId": "migrations/get-status-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/migration-id" }, { "description": "Exclude attributes from the API response to improve performance", "in": "query", "name": "exclude", "schema": { "items": { "description": "Allowed values that can be passed to the exclude param.", "enum": [ "repositories" ], "example": "repositories", "type": "string" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/migration-with-short-org" } }, "schema": { "$ref": "#/components/schemas/migration" } } }, "description": "* `pending`, which means the migration hasn't started yet.\n* `exporting`, which means the migration is in progress.\n* `exported`, which means the migration finished successfully.\n* `failed`, which means the migration failed." }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an organization migration status", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/migrations/{migration_id}/archive": { "delete": { "description": "Deletes a previous migration archive. Migration archives are automatically deleted after seven days.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive" }, "operationId": "migrations/delete-archive-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/migration-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete an organization migration archive", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } }, "get": { "description": "Fetches the URL to a migration archive.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive" }, "operationId": "migrations/download-archive-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/migration-id" } ], "responses": { "302": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Download an organization migration archive", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository" }, "operationId": "migrations/unlock-repo-for-org", "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" } }, "summary": "Unlock an organization repository", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/migrations/{migration_id}/repositories": { "get": { "description": "List all the repositories for this organization migration.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration" }, "operationId": "migrations/list-repos-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/migration-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/minimal-repository-items" } }, "schema": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List repositories in an organization migration", "tags": [ "migrations" ], "x-github": { "category": "migrations", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "orgs" } } }, "/orgs/{org}/outside_collaborators": { "get": { "description": "List all users who are outside collaborators of an organization.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-outside-collaborators-for-an-organization" }, "operationId": "orgs/list-outside-collaborators", "parameters": [ { "$ref": "#/components/parameters/org" }, { "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", "name": "filter", "required": false, "schema": { "default": "all", "enum": [ "2fa_disabled", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List outside collaborators for an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "outside-collaborators" } } }, "/orgs/{org}/outside_collaborators/{username}": { "delete": { "description": "Removing a user from this list will remove them from all the organization's repositories.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#remove-outside-collaborator-from-an-organization" }, "operationId": "orgs/remove-outside-collaborator", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "422": { "content": { "application/json": { "examples": { "response-if-user-is-a-member-of-the-organization": { "value": { "documentation_url": "https://docs.github.com/rest/reference/orgs#remove-outside-collaborator", "message": "You cannot specify an organization member to remove as an outside collaborator." } } }, "schema": { "properties": { "documentation_url": { "type": "string" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Unprocessable Entity if user is a member of the organization" } }, "summary": "Remove outside collaborator from an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "outside-collaborators" } }, "put": { "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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator" }, "operationId": "orgs/convert-member-to-outside-collaborator", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "content": { "application/json": { "examples": { "202": { "summary": "Status code 202, asynchronous request", "value": { "async": true } }, "204": { "summary": "Status code 204, synchronous request", "value": null } }, "schema": { "properties": { "async": { "default": false, "description": "When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "202": { "content": { "application/json": { "examples": { "202": { "value": null } }, "schema": { "additionalProperties": false, "properties": {}, "type": "object" } } }, "description": "User is getting converted asynchronously" }, "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" } }, "summary": "Convert an organization member to outside collaborator", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "outside-collaborators" } } }, "/orgs/{org}/packages": { "get": { "description": "Lists packages in an organization readable by the user.\n\nTo 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#list-packages-for-an-organization" }, "operationId": "packages/list-packages-for-organization", "parameters": [ { "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", "name": "package_type", "required": true, "schema": { "enum": [ "npm", "maven", "rubygems", "docker", "nuget", "container" ], "type": "string" } }, { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/package-visibility" }, { "description": "Page number of the results to fetch.", "in": "query", "name": "page", "schema": { "default": 1, "type": "integer" } }, { "description": "The number of results per page (max 100).", "in": "query", "name": "per_page", "schema": { "default": 30, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/packages-for-org" } }, "schema": { "items": { "$ref": "#/components/schemas/package" }, "type": "array" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List packages for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/packages/{package_type}/{package_name}": { "delete": { "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.\n\nTo 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:\n- 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).\"\n- 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#delete-a-package-for-an-organization" }, "operationId": "packages/delete-package-for-org", "parameters": [ { "$ref": "#/components/parameters/package-type" }, { "$ref": "#/components/parameters/package-name" }, { "$ref": "#/components/parameters/org" } ], "responses": { "204": { "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete a package for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "Gets a specific package in an organization.\n\nTo 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#get-a-package-for-an-organization" }, "operationId": "packages/get-package-for-organization", "parameters": [ { "$ref": "#/components/parameters/package-type" }, { "$ref": "#/components/parameters/package-name" }, { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/package-org" } }, "schema": { "$ref": "#/components/schemas/package" } } }, "description": "Response" } }, "summary": "Get a package for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/packages/{package_type}/{package_name}/restore": { "post": { "description": "Restores an entire package in an organization.\n\nYou can restore a deleted package under the following conditions:\n - The package was deleted within the last 30 days.\n - 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.\n\nTo 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:\n- 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).\"\n- 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#restore-a-package-for-an-organization" }, "operationId": "packages/restore-package-for-org", "parameters": [ { "$ref": "#/components/parameters/package-type" }, { "$ref": "#/components/parameters/package-name" }, { "$ref": "#/components/parameters/org" }, { "description": "package token", "in": "query", "name": "token", "required": false, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Restore a package for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/packages/{package_type}/{package_name}/versions": { "get": { "description": "Lists package versions for a package owned by an organization.\n\nIf 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/packages#get-all-package-versions-for-a-package-owned-by-an-organization" }, "operationId": "packages/get-all-package-versions-for-package-owned-by-org", "parameters": [ { "$ref": "#/components/parameters/package-type" }, { "$ref": "#/components/parameters/package-name" }, { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/per-page" }, { "description": "The state of the package, either active or deleted.", "in": "query", "name": "state", "required": false, "schema": { "default": "active", "enum": [ "active", "deleted" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/package-versions-for-org" } }, "schema": { "items": { "$ref": "#/components/schemas/package-version" }, "type": "array" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List package versions for a package owned by an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": { "delete": { "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.\n\nTo 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:\n- 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).\"\n- 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#delete-a-package-version-for-an-organization" }, "operationId": "packages/delete-package-version-for-org", "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" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete package version for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "Gets a specific package version in an organization.\n\nYou 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#get-a-package-version-for-an-organization" }, "operationId": "packages/get-package-version-for-organization", "parameters": [ { "$ref": "#/components/parameters/package-type" }, { "$ref": "#/components/parameters/package-name" }, { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/package-version-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/package-version-org" } }, "schema": { "$ref": "#/components/schemas/package-version" } } }, "description": "Response" } }, "summary": "Get a package version for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": { "post": { "description": "Restores a specific package version in an organization.\n\nYou can restore a deleted package under the following conditions:\n - The package was deleted within the last 30 days.\n - 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.\n\nTo 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:\n- 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).\"\n- 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/packages#restore-a-package-version-for-an-organization" }, "operationId": "packages/restore-package-version-for-org", "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" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Restore package version for an organization", "tags": [ "packages" ], "x-github": { "category": "packages", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/projects": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#list-organization-projects" }, "operationId": "projects/list-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "description": "Indicates the state of the projects to return.", "in": "query", "name": "state", "required": false, "schema": { "default": "open", "enum": [ "open", "closed", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-items" } }, "schema": { "items": { "$ref": "#/components/schemas/project" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "List organization projects", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#create-an-organization-project" }, "operationId": "projects/create-for-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "body": "High-level roadmap for the upcoming year.", "name": "Organization Roadmap" } } }, "schema": { "properties": { "body": { "description": "The description of the project.", "type": "string" }, "name": { "description": "The name of the project.", "type": "string" } }, "required": [ "name" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-2" } }, "schema": { "$ref": "#/components/schemas/project" } } }, "description": "Response" }, "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" } }, "summary": "Create an organization project", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/public_members": { "get": { "description": "Members of an organization can choose to have their membership publicized or not.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-public-organization-members" }, "operationId": "orgs/list-public-members", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List public organization members", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/public_members/{username}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user" }, "operationId": "orgs/remove-public-membership-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove public organization membership for the authenticated user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "members" } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#check-public-organization-membership-for-a-user" }, "operationId": "orgs/check-public-membership-for-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" } }, "summary": "Check public organization membership for a user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "put": { "description": "The user can publicize their own membership. (A user cannot publicize the membership for another user.)\n\nNote that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user" }, "operationId": "orgs/set-public-membership-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Set public organization membership for the authenticated user", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/repos": { "get": { "description": "Lists repositories for the specified organization.\n\n**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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#list-organization-repositories" }, "operationId": "repos/list-for-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "description": "Specifies the types of repositories you want returned.", "in": "query", "name": "type", "required": false, "schema": { "enum": [ "all", "public", "private", "forks", "sources", "member" ], "type": "string" } }, { "description": "The property to sort the results by.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created", "updated", "pushed", "full_name" ], "type": "string" } }, { "description": "The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`.", "in": "query", "name": "direction", "required": false, "schema": { "enum": [ "asc", "desc" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/minimal-repository-items" } }, "schema": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List organization repositories", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "Creates a new repository in the specified organization. The authenticated user must be a member of the organization.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#create-an-organization-repository" }, "operationId": "repos/create-in-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "description": "This is your first repository", "has_issues": true, "has_projects": true, "has_wiki": true, "homepage": "https://github.com", "name": "Hello-World", "private": false } } }, "schema": { "properties": { "allow_auto_merge": { "default": false, "description": "Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge.", "type": "boolean" }, "allow_merge_commit": { "default": true, "description": "Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.", "type": "boolean" }, "allow_rebase_merge": { "default": true, "description": "Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.", "type": "boolean" }, "allow_squash_merge": { "default": true, "description": "Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.", "type": "boolean" }, "auto_init": { "default": false, "description": "Pass `true` to create an initial commit with empty README.", "type": "boolean" }, "delete_branch_on_merge": { "default": false, "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`.**", "type": "boolean" }, "description": { "description": "A short description of the repository.", "type": "string" }, "gitignore_template": { "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\".", "type": "string" }, "has_downloads": { "default": true, "description": "Whether downloads are enabled.", "example": true, "type": "boolean" }, "has_issues": { "default": true, "description": "Either `true` to enable issues for this repository or `false` to disable them.", "type": "boolean" }, "has_projects": { "default": true, "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.", "type": "boolean" }, "has_wiki": { "default": true, "description": "Either `true` to enable the wiki for this repository or `false` to disable it.", "type": "boolean" }, "homepage": { "description": "A URL with more information about the repository.", "type": "string" }, "is_template": { "default": false, "description": "Either `true` to make this repo available as a template repository or `false` to prevent it.", "type": "boolean" }, "license_template": { "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\".", "type": "string" }, "merge_commit_message": { "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message.", "enum": [ "PR_BODY", "PR_TITLE", "BLANK" ], "type": "string" }, "merge_commit_title": { "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).", "enum": [ "PR_TITLE", "MERGE_MESSAGE" ], "type": "string" }, "name": { "description": "The name of the repository.", "type": "string" }, "private": { "default": false, "description": "Whether the repository is private.", "type": "boolean" }, "squash_merge_commit_message": { "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message.", "enum": [ "PR_BODY", "COMMIT_MESSAGES", "BLANK" ], "type": "string" }, "squash_merge_commit_title": { "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `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).", "enum": [ "PR_TITLE", "COMMIT_OR_PR_TITLE" ], "type": "string" }, "team_id": { "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.", "type": "integer" }, "use_squash_pr_title_as_default": { "default": false, "deprecated": true, "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.", "type": "boolean" }, "visibility": { "description": "The visibility of the repository.", "enum": [ "public", "private" ], "type": "string" } }, "required": [ "name" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repository" } }, "schema": { "$ref": "#/components/schemas/repository" } } }, "description": "Response", "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" } }, "summary": "Create an organization repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/secret-scanning/alerts": { "get": { "description": "Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.\nTo 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.\nFor public repositories, you may instead use the `public_repo` scope.\n\nGitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-an-organization" }, "operationId": "secret-scanning/list-alerts-for-org", "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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-secret-scanning-alert-list" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-secret-scanning-alert" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List secret scanning alerts for an organization", "tags": [ "secret-scanning" ], "x-github": { "category": "secret-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/security-managers": { "get": { "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).\"\n\nTo 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.\n\nGitHub Apps must have the `administration` organization read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#list-security-manager-teams" }, "operationId": "orgs/list-security-manager-teams", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team-simple" }, "type": "array" } } }, "description": "Response" } }, "summary": "List security manager teams", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "security-managers" } } }, "/orgs/{org}/security-managers/teams/{team_slug}": { "delete": { "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.\"\n\nTo use this endpoint, you must be an administrator for the organization, and you must use an access token with the `admin:org` scope.\n\nGitHub Apps must have the `administration` organization read-write permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#remove-a-security-manager-team" }, "operationId": "orgs/remove-security-manager-team", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove a security manager team", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "security-managers" } }, "put": { "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.\"\n\nTo use this endpoint, you must be an administrator for the organization, and you must use an access token with the `write:org` scope.\n\nGitHub Apps must have the `administration` organization read-write permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#add-a-security-manager-team" }, "operationId": "orgs/add-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." } }, "summary": "Add a security manager team", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "security-managers" } } }, "/orgs/{org}/settings/billing/actions": { "get": { "description": "Gets the summary of the free and paid GitHub Actions minutes used.\n\nPaid 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)\".\n\nAccess tokens must have the `repo` or `admin:org` scope.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/billing#get-github-actions-billing-for-an-organization" }, "operationId": "billing/get-github-actions-billing-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-billing-usage" } }, "schema": { "$ref": "#/components/schemas/actions-billing-usage" } } }, "description": "Response" } }, "summary": "Get GitHub Actions billing for an organization", "tags": [ "billing" ], "x-github": { "category": "billing", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/settings/billing/packages": { "get": { "description": "Gets the free and paid storage used for GitHub Packages in gigabytes.\n\nPaid 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).\"\n\nAccess tokens must have the `repo` or `admin:org` scope.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/billing#get-github-packages-billing-for-an-organization" }, "operationId": "billing/get-github-packages-billing-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/packages-billing-usage" } }, "schema": { "$ref": "#/components/schemas/packages-billing-usage" } } }, "description": "Response" } }, "summary": "Get GitHub Packages billing for an organization", "tags": [ "billing" ], "x-github": { "category": "billing", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/settings/billing/shared-storage": { "get": { "description": "Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.\n\nPaid 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).\"\n\nAccess tokens must have the `repo` or `admin:org` scope.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/billing#get-shared-storage-billing-for-an-organization" }, "operationId": "billing/get-shared-storage-billing-org", "parameters": [ { "$ref": "#/components/parameters/org" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/combined-billing-usage" } }, "schema": { "$ref": "#/components/schemas/combined-billing-usage" } } }, "description": "Response" } }, "summary": "Get shared storage billing for an organization", "tags": [ "billing" ], "x-github": { "category": "billing", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams": { "get": { "description": "Lists all teams in an organization that are visible to the authenticated user.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-teams" }, "operationId": "teams/list", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List teams", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "post": { "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).\"\n\nWhen you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see \"[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)\".", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#create-a-team" }, "operationId": "teams/create", "parameters": [ { "$ref": "#/components/parameters/org" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "description": "A great team", "name": "Justice League", "permission": "push", "privacy": "closed" } } }, "schema": { "properties": { "description": { "description": "The description of the team.", "type": "string" }, "maintainers": { "description": "List GitHub IDs for organization members who will become team maintainers.", "items": { "type": "string" }, "type": "array" }, "name": { "description": "The name of the team.", "type": "string" }, "parent_team_id": { "description": "The ID of a team to set as the parent team.", "type": "integer" }, "permission": { "default": "pull", "description": "**Deprecated**. The permission that new repositories will be added to the team with when none is specified.", "enum": [ "pull", "push" ], "type": "string" }, "privacy": { "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" ], "type": "string" }, "repo_names": { "description": "The full name (e.g., \"organization-name/repository-name\") of repositories to add the team to.", "items": { "type": "string" }, "type": "array" } }, "required": [ "name" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-full" } }, "schema": { "$ref": "#/components/schemas/team-full" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create a team", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}": { "delete": { "description": "To delete a team, the authenticated user must be an organization owner or team maintainer.\n\nIf you are an organization owner, deleting a parent team will delete all of its child teams as well.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#delete-a-team" }, "operationId": "teams/delete-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a team", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "get": { "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`.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#get-a-team-by-name" }, "operationId": "teams/get-by-name", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-full" } }, "schema": { "$ref": "#/components/schemas/team-full" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a team by name", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "patch": { "description": "To edit a team, the authenticated user must either be an organization owner or a team maintainer.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#update-a-team" }, "operationId": "teams/update-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "description": "new team description", "name": "new team name", "privacy": "closed" } } }, "schema": { "properties": { "description": { "description": "The description of the team.", "type": "string" }, "name": { "description": "The name of the team.", "type": "string" }, "parent_team_id": { "description": "The ID of a team to set as the parent team.", "nullable": true, "type": "integer" }, "permission": { "default": "pull", "description": "**Deprecated**. The permission that new repositories will be added to the team with when none is specified.", "enum": [ "pull", "push", "admin" ], "type": "string" }, "privacy": { "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" ], "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-full" } }, "schema": { "$ref": "#/components/schemas/team-full" } } }, "description": "Response when the updated information already exists" }, "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-full" } }, "schema": { "$ref": "#/components/schemas/team-full" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update a team", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/discussions": { "get": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-discussions" }, "operationId": "teams/list-discussions-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/direction" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "description": "Pinned discussions only filter", "in": "query", "name": "pinned", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team-discussion" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List discussions", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussions" } }, "post": { "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/).\n\nThis 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.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#create-a-discussion" }, "operationId": "teams/create-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "body": "Hi! This is an area for us to collaborate as a team.", "title": "Our first team post" } } }, "schema": { "properties": { "body": { "description": "The discussion post's body text.", "type": "string" }, "private": { "default": false, "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.", "type": "boolean" }, "title": { "description": "The discussion post's title.", "type": "string" } }, "required": [ "title", "body" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion" } }, "schema": { "$ref": "#/components/schemas/team-discussion" } } }, "description": "Response" } }, "summary": "Create a discussion", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussions", "triggersNotification": true } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": { "delete": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#delete-a-discussion" }, "operationId": "teams/delete-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a discussion", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussions" } }, "get": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#get-a-discussion" }, "operationId": "teams/get-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion" } }, "schema": { "$ref": "#/components/schemas/team-discussion" } } }, "description": "Response" } }, "summary": "Get a discussion", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussions" } }, "patch": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#update-a-discussion" }, "operationId": "teams/update-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "title": "Welcome to our first team post" } } }, "schema": { "properties": { "body": { "description": "The discussion post's body text.", "type": "string" }, "title": { "description": "The discussion post's title.", "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-2" } }, "schema": { "$ref": "#/components/schemas/team-discussion" } } }, "description": "Response" } }, "summary": "Update a discussion", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussions" } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": { "get": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-discussion-comments" }, "operationId": "teams/list-discussion-comments-in-org", "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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team-discussion-comment" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List discussion comments", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussion-comments" } }, "post": { "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/).\n\nThis 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.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#create-a-discussion-comment" }, "operationId": "teams/create-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "body": "Do you like apples?" } } }, "schema": { "properties": { "body": { "description": "The discussion comment's body text.", "type": "string" } }, "required": [ "body" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment" } }, "schema": { "$ref": "#/components/schemas/team-discussion-comment" } } }, "description": "Response" } }, "summary": "Create a discussion comment", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussion-comments", "triggersNotification": true } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": { "delete": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#delete-a-discussion-comment" }, "operationId": "teams/delete-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a discussion comment", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussion-comments" } }, "get": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#get-a-discussion-comment" }, "operationId": "teams/get-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment" } }, "schema": { "$ref": "#/components/schemas/team-discussion-comment" } } }, "description": "Response" } }, "summary": "Get a discussion comment", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussion-comments" } }, "patch": { "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/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#update-a-discussion-comment" }, "operationId": "teams/update-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "body": "Do you like pineapples?" } } }, "schema": { "properties": { "body": { "description": "The discussion comment's body text.", "type": "string" } }, "required": [ "body" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-discussion-comment-2" } }, "schema": { "$ref": "#/components/schemas/team-discussion-comment" } } }, "description": "Response" } }, "summary": "Update a discussion comment", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "discussion-comments" } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": { "get": { "description": "List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment" }, "operationId": "reactions/list-for-team-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" }, { "description": "Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment.", "in": "query", "name": "content", "required": false, "schema": { "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction-items" } }, "schema": { "items": { "$ref": "#/components/schemas/reaction" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List reactions for a team discussion comment", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). 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.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment" }, "operationId": "reactions/create-for-team-discussion-comment-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/comment-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "content": "heart" } } }, "schema": { "properties": { "content": { "description": "The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment.", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ], "type": "string" } }, "required": [ "content" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction" } }, "schema": { "$ref": "#/components/schemas/reaction" } } }, "description": "Response when the reaction type has already been added to this team discussion comment" }, "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction" } }, "schema": { "$ref": "#/components/schemas/reaction" } } }, "description": "Response" } }, "summary": "Create reaction for a team discussion comment", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}": { "delete": { "description": "**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.\n\nDelete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#delete-team-discussion-comment-reaction" }, "operationId": "reactions/delete-for-team-discussion-comment", "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" } }, "summary": "Delete team discussion comment reaction", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": { "get": { "description": "List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion" }, "operationId": "reactions/list-for-team-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "description": "Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion.", "in": "query", "name": "content", "required": false, "schema": { "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction-items" } }, "schema": { "items": { "$ref": "#/components/schemas/reaction" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List reactions for a team discussion", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). 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.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion" }, "operationId": "reactions/create-for-team-discussion-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "content": "heart" } } }, "schema": { "properties": { "content": { "description": "The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion.", "enum": [ "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes" ], "type": "string" } }, "required": [ "content" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction" } }, "schema": { "$ref": "#/components/schemas/reaction" } } }, "description": "Response" }, "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/reaction" } }, "schema": { "$ref": "#/components/schemas/reaction" } } }, "description": "Response" } }, "summary": "Create reaction for a team discussion", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}": { "delete": { "description": "**Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.\n\nDelete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/reactions#delete-team-discussion-reaction" }, "operationId": "reactions/delete-for-team-discussion", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/discussion-number" }, { "$ref": "#/components/parameters/reaction-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete team discussion reaction", "tags": [ "reactions" ], "x-github": { "category": "reactions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/invitations": { "get": { "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`.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-pending-team-invitations" }, "operationId": "teams/list-pending-invitations-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/organization-invitation-items" } }, "schema": { "items": { "$ref": "#/components/schemas/organization-invitation" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List pending team invitations", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/teams/{team_slug}/members": { "get": { "description": "Team members will include the members of child teams.\n\nTo list members in a team, the team must be visible to the authenticated user.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-team-members" }, "operationId": "teams/list-members-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "description": "Filters members returned by their role in the team.", "in": "query", "name": "role", "required": false, "schema": { "default": "all", "enum": [ "member", "maintainer", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List team members", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/teams/{team_slug}/memberships/{username}": { "delete": { "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.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub 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/).\"\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user" }, "operationId": "teams/remove-membership-for-user-in-org", "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" } }, "summary": "Remove team membership for a user", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "get": { "description": "Team members will include the members of child teams.\n\nTo get a user's membership with a team, the team must be visible to the authenticated user.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.\n\n**Note:**\nThe response contains the `state` of the membership and the member's `role`.\n\nThe `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user" }, "operationId": "teams/get-membership-for-user-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "content": { "application/json": { "examples": { "response-if-user-is-a-team-maintainer": { "$ref": "#/components/examples/team-membership-response-if-user-is-a-team-maintainer" } }, "schema": { "$ref": "#/components/schemas/team-membership" } } }, "description": "Response" }, "404": { "description": "if user has no team membership" } }, "summary": "Get team membership for a user", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } }, "put": { "description": "Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.\n\nTeam synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\n**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub 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/).\"\n\nAn organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the \"pending\" state until the person accepts the invitation, at which point the membership will transition to the \"active\" state and the user will be added as a member of the team.\n\nIf the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user" }, "operationId": "teams/add-or-update-membership-for-user-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Add or update team membership for an organization member", "value": { "role": "maintainer" } } }, "schema": { "properties": { "role": { "default": "member", "description": "The role that this user should have in the team.", "enum": [ "member", "maintainer" ], "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "response-if-users-membership-with-team-is-now-pending": { "$ref": "#/components/examples/team-membership-response-if-users-membership-with-team-is-now-pending" } }, "schema": { "$ref": "#/components/schemas/team-membership" } } }, "description": "Response" }, "403": { "description": "Forbidden if team synchronization is set up" }, "422": { "description": "Unprocessable Entity if you attempt to add an organization to a team" } }, "summary": "Add or update team membership for a user", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "members" } } }, "/orgs/{org}/teams/{team_slug}/projects": { "get": { "description": "Lists the organization projects for a team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-team-projects" }, "operationId": "teams/list-projects-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-project-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team-project" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List team projects", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/projects/{project_id}": { "delete": { "description": "Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team" }, "operationId": "teams/remove-project-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove a project from a team", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project" }, "operationId": "teams/check-permissions-for-project-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-project" } }, "schema": { "$ref": "#/components/schemas/team-project" } } }, "description": "Response" }, "404": { "description": "Not Found if project is not managed by this team" } }, "summary": "Check team permissions for a project", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "put": { "description": "Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions" }, "operationId": "teams/add-or-update-project-permissions-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Updates the permissions for the team to write for the project", "value": { "permission": "write" } } }, "schema": { "nullable": true, "properties": { "permission": { "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" ], "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "204": { "description": "Response" }, "403": { "content": { "application/json": { "examples": { "response-if-the-project-is-not-owned-by-the-organization": { "value": { "documentation_url": "https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions", "message": "Must have admin rights to Repository." } } }, "schema": { "properties": { "documentation_url": { "type": "string" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Forbidden if the project is not owned by the organization" } }, "summary": "Add or update team project permissions", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/repos": { "get": { "description": "Lists a team's repositories visible to the authenticated user.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-team-repositories" }, "operationId": "teams/list-repos-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/minimal-repository-items" } }, "schema": { "items": { "$ref": "#/components/schemas/minimal-repository" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List team repositories", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": { "delete": { "description": "If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams/#remove-a-repository-from-a-team" }, "operationId": "teams/remove-repo-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove a repository from a team", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "get": { "description": "Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.\n\nYou can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header.\n\nIf a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams/#check-team-permissions-for-a-repository" }, "operationId": "teams/check-permissions-for-repo-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "alternative-response-with-repository-permissions": { "$ref": "#/components/examples/team-repository-alternative-response-with-repository-permissions" } }, "schema": { "$ref": "#/components/schemas/team-repository" } } }, "description": "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" } }, "summary": "Check team permissions for a repository", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "put": { "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).\"\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.\n\nFor more information about the permission levels, see \"[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)\".", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams/#add-or-update-team-repository-permissions" }, "operationId": "teams/add-or-update-repo-permissions-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Adding a team to an organization repository with the write role", "value": { "permission": "push" } } }, "schema": { "properties": { "permission": { "default": "push", "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.", "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "204": { "description": "Response" } }, "summary": "Add or update team repository permissions", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/teams/{team_slug}/teams": { "get": { "description": "Lists the child teams of the team specified by `{team_slug}`.\n\n**Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/teams#list-child-teams" }, "operationId": "teams/list-child-in-org", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/team-slug" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "response-if-child-teams-exist": { "$ref": "#/components/examples/team-items-response-if-child-teams-exist" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "if child teams exist", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List child teams", "tags": [ "teams" ], "x-github": { "category": "teams", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/orgs/{org}/{security_product}/{enablement}": { "post": { "description": "Enables or disables the specified security feature for all repositories in an organization.\n\nTo use this endpoint, you must be an organization owner or be member of a team with the security manager role.\nA token with the 'write:org' scope is also required.\n\nGitHub Apps must have the `organization_administration:write` permission to use this endpoint.\n\nFor 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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/orgs#enable-or-disable-security-product-on-all-org-repos" }, "operationId": "orgs/enable-or-disable-security-product-on-all-org-repos", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/security-product" }, { "$ref": "#/components/parameters/org-security-product-enablement" } ], "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" } }, "summary": "Enable or disable a security feature for an organization", "tags": [ "orgs" ], "x-github": { "category": "orgs", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "orgs" } } }, "/projects/columns/cards/{card_id}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#delete-a-project-card" }, "operationId": "projects/delete-card", "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "content": { "application/json": { "schema": { "properties": { "documentation_url": { "type": "string" }, "errors": { "items": { "type": "string" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete a project card", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#get-a-project-card" }, "operationId": "projects/get-card", "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-card" } }, "schema": { "$ref": "#/components/schemas/project-card" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a project card", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } }, "patch": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#update-a-project-card" }, "operationId": "projects/update-card", "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Change the note on the card", "value": { "note": "Add payload for delete Project column" } } }, "schema": { "properties": { "archived": { "description": "Whether or not the card is archived", "example": false, "type": "boolean" }, "note": { "description": "The project card's note", "example": "Update all gems", "nullable": true, "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-card" } }, "schema": { "$ref": "#/components/schemas/project-card" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Update an existing project card", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } } }, "/projects/columns/cards/{card_id}/moves": { "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#move-a-project-card" }, "operationId": "projects/move-card", "parameters": [ { "$ref": "#/components/parameters/card-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Move the card to the bottom of the column", "value": { "column_id": 42, "position": "bottom" } } }, "schema": { "properties": { "column_id": { "description": "The unique identifier of the column the card should be moved to", "example": 42, "type": "integer" }, "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", "pattern": "^(?:top|bottom|after:\\d+)$", "type": "string" } }, "required": [ "position" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "additionalProperties": false, "properties": {}, "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "content": { "application/json": { "schema": { "properties": { "documentation_url": { "type": "string" }, "errors": { "items": { "properties": { "code": { "type": "string" }, "field": { "type": "string" }, "message": { "type": "string" }, "resource": { "type": "string" } }, "type": "object" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Forbidden" }, "422": { "$ref": "#/components/responses/validation_failed" }, "503": { "content": { "application/json": { "schema": { "properties": { "code": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "items": { "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "type": "object" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Response" } }, "summary": "Move a project card", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } } }, "/projects/columns/{column_id}": { "delete": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#delete-a-project-column" }, "operationId": "projects/delete-column", "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Delete a project column", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } }, "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#get-a-project-column" }, "operationId": "projects/get-column", "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-column" } }, "schema": { "$ref": "#/components/schemas/project-column" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a project column", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } }, "patch": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#update-a-project-column" }, "operationId": "projects/update-column", "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Rename the project column", "value": { "name": "To Do" } } }, "schema": { "properties": { "name": { "description": "Name of the project column", "example": "Remaining tasks", "type": "string" } }, "required": [ "name" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-column" } }, "schema": { "$ref": "#/components/schemas/project-column" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Update an existing project column", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } } }, "/projects/columns/{column_id}/cards": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#list-project-cards" }, "operationId": "projects/list-cards", "parameters": [ { "$ref": "#/components/parameters/column-id" }, { "description": "Filters the project cards that are returned by the card's state.", "in": "query", "name": "archived_state", "required": false, "schema": { "default": "not_archived", "enum": [ "all", "archived", "not_archived" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-card-items" } }, "schema": { "items": { "$ref": "#/components/schemas/project-card" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List project cards", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } }, "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#create-a-project-card" }, "operationId": "projects/create-card", "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Create a new card", "value": { "note": "Add payload for delete Project column" } } }, "schema": { "oneOf": [ { "properties": { "note": { "description": "The project card's note", "example": "Update all gems", "nullable": true, "type": "string" } }, "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" ], "type": "object" } ] } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-card" } }, "schema": { "$ref": "#/components/schemas/project-card" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "content": { "application/json": { "schema": { "oneOf": [ { "$ref": "#/components/schemas/validation-error" }, { "$ref": "#/components/schemas/validation-error-simple" } ] } } }, "description": "Validation failed" }, "503": { "content": { "application/json": { "schema": { "properties": { "code": { "type": "string" }, "documentation_url": { "type": "string" }, "errors": { "items": { "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "type": "object" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Response" } }, "summary": "Create a project card", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cards" } } }, "/projects/columns/{column_id}/moves": { "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#move-a-project-column" }, "operationId": "projects/move-column", "parameters": [ { "$ref": "#/components/parameters/column-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Move the column to the end of the board", "value": { "position": "last" } } }, "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", "pattern": "^(?:first|last|after:\\d+)$", "type": "string" } }, "required": [ "position" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "additionalProperties": false, "properties": {}, "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Move a project column", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } } }, "/projects/{project_id}": { "delete": { "description": "Deletes a project board. Returns a `404 Not Found` status if projects are disabled.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#delete-a-project" }, "operationId": "projects/delete", "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "responses": { "204": { "description": "Delete Success" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "content": { "application/json": { "schema": { "properties": { "documentation_url": { "type": "string" }, "errors": { "items": { "type": "string" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "410": { "$ref": "#/components/responses/gone" } }, "summary": "Delete a project", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#get-a-project" }, "operationId": "projects/get", "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-3" } }, "schema": { "$ref": "#/components/schemas/project" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Get a project", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "patch": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#update-a-project" }, "operationId": "projects/update", "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Change the name, state, and permissions for a project", "value": { "name": "Week One Sprint", "organization_permission": "write", "state": "open" } } }, "schema": { "properties": { "body": { "description": "Body of the project", "example": "This project represents the sprint of the first week in January", "nullable": true, "type": "string" }, "name": { "description": "Name of the project", "example": "Week One Sprint", "type": "string" }, "organization_permission": { "description": "The baseline permission that all organization members have on this project", "enum": [ "read", "write", "admin", "none" ], "type": "string" }, "private": { "description": "Whether or not this project can be seen by everyone.", "type": "boolean" }, "state": { "description": "State of the project; either 'open' or 'closed'", "example": "open", "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-3" } }, "schema": { "$ref": "#/components/schemas/project" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "content": { "application/json": { "schema": { "properties": { "documentation_url": { "type": "string" }, "errors": { "items": { "type": "string" }, "type": "array" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "Forbidden" }, "404": { "description": "Not Found if the authenticated user does not have access to the project" }, "410": { "$ref": "#/components/responses/gone" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Update a project", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/projects/{project_id}/collaborators": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#list-project-collaborators" }, "operationId": "projects/list-collaborators", "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "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", "name": "affiliation", "required": false, "schema": { "default": "all", "enum": [ "outside", "direct", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "List project collaborators", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "collaborators" } } }, "/projects/{project_id}/collaborators/{username}": { "delete": { "description": "Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#remove-project-collaborator" }, "operationId": "projects/remove-collaborator", "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Remove user as a collaborator", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "collaborators" } }, "put": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#add-project-collaborator" }, "operationId": "projects/add-collaborator", "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Applying write permissions for the new collaborator", "value": { "permission": "write" } } }, "schema": { "nullable": true, "properties": { "permission": { "default": "write", "description": "The permission to grant the collaborator.", "enum": [ "read", "write", "admin" ], "example": "write", "type": "string" } }, "type": "object" } } }, "required": false }, "responses": { "204": { "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Add project collaborator", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "collaborators" } } }, "/projects/{project_id}/collaborators/{username}/permission": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#get-project-permission-for-a-user" }, "operationId": "projects/get-permission-for-user", "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/username" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-collaborator-permission" } }, "schema": { "$ref": "#/components/schemas/project-collaborator-permission" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Get project permission for a user", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "collaborators" } } }, "/projects/{project_id}/columns": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#list-project-columns" }, "operationId": "projects/list-columns", "parameters": [ { "$ref": "#/components/parameters/project-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/project-column-items" } }, "schema": { "items": { "$ref": "#/components/schemas/project-column" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "List project columns", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } }, "post": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/projects#create-a-project-column" }, "operationId": "projects/create-column", "parameters": [ { "$ref": "#/components/parameters/project-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "name": "Remaining tasks" } } }, "schema": { "properties": { "name": { "description": "Name of the project column", "example": "Remaining tasks", "type": "string" } }, "required": [ "name" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": { "cards_url": "https://api.github.com/projects/columns/367/cards", "created_at": "2016-09-05T14:18:44Z", "id": 367, "name": "To Do", "node_id": "MDEzOlByb2plY3RDb2x1bW4zNjc=", "project_url": "https://api.github.com/projects/120", "updated_at": "2016-09-05T14:22:28Z", "url": "https://api.github.com/projects/columns/367" } } }, "schema": { "$ref": "#/components/schemas/project-column" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Create a project column", "tags": [ "projects" ], "x-github": { "category": "projects", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "columns" } } }, "/rate_limit": { "get": { "description": "**Note:** Accessing this endpoint does not count against your REST API rate limit.\n\n**Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user" }, "operationId": "rate-limit/get", "parameters": [], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/rate-limit-overview" } }, "schema": { "$ref": "#/components/schemas/rate-limit-overview" } } }, "description": "Response", "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" } }, "summary": "Get rate limit status for the authenticated user", "tags": [ "rate-limit" ], "x-github": { "category": "rate-limit", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{org}/{repo}/actions/required_workflows": { "get": { "description": "Lists the required 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. For more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-repository-required-workflows" }, "operationId": "actions/list-repo-required-workflows", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-required-workflow-paginated" } }, "schema": { "properties": { "required_workflows": { "items": { "$ref": "#/components/schemas/repo-required-workflow" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "required_workflows" ], "type": "object" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List repository required workflows", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}": { "get": { "description": "Gets a specific required workflow present 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. For more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-repository-required-workflow" }, "operationId": "actions/get-repo-required-workflow", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/repo-required-workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-required-workflow" } }, "schema": { "$ref": "#/components/schemas/repo-required-workflow" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a required workflow entity for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/repos/{org}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/timing": { "get": { "description": "Gets the number of billable minutes used by a specific required workflow during the current billing cycle.\n\nBillable minutes only apply to required workflows running 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).\"\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-repository-required-workflow-usage" }, "operationId": "actions/get-repo-required-workflow-usage", "parameters": [ { "$ref": "#/components/parameters/org" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/repo-required-workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-usage" } }, "schema": { "$ref": "#/components/schemas/workflow-usage" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get required workflow usage", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "required-workflows" } } }, "/repos/{owner}/{repo}": { "delete": { "description": "Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required.\n\nIf an organization owner has configured the organization to prevent members from deleting organization-owned\nrepositories, you will get a `403 Forbidden` response.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#delete-a-repository" }, "operationId": "repos/delete", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" }, "307": { "$ref": "#/components/responses/temporary_redirect" }, "403": { "content": { "application/json": { "examples": { "default": { "value": { "documentation_url": "https://docs.github.com/rest/reference/repos#delete-a-repository", "message": "Organization members cannot delete repositories." } } }, "schema": { "properties": { "documentation_url": { "type": "string" }, "message": { "type": "string" } }, "type": "object" } } }, "description": "If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response:" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "get": { "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.\n\n**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).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#get-a-repository" }, "operationId": "repos/get", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default-response": { "$ref": "#/components/examples/full-repository-default-response" } }, "schema": { "$ref": "#/components/schemas/full-repository" } } }, "description": "Response" }, "301": { "$ref": "#/components/responses/moved_permanently" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "patch": { "description": "**Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/repos/repos#update-a-repository" }, "operationId": "repos/update", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "description": "This is your first repository", "has_issues": true, "has_projects": true, "has_wiki": true, "homepage": "https://github.com", "name": "Hello-World", "private": true } } }, "schema": { "properties": { "allow_auto_merge": { "default": false, "description": "Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge.", "type": "boolean" }, "allow_forking": { "default": false, "description": "Either `true` to allow private forks, or `false` to prevent private forks.", "type": "boolean" }, "allow_merge_commit": { "default": true, "description": "Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.", "type": "boolean" }, "allow_rebase_merge": { "default": true, "description": "Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.", "type": "boolean" }, "allow_squash_merge": { "default": true, "description": "Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.", "type": "boolean" }, "allow_update_branch": { "default": false, "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.", "type": "boolean" }, "archived": { "default": false, "description": "Whether to archive this repository. `false` will unarchive a previously archived repository.", "type": "boolean" }, "default_branch": { "description": "Updates the default branch for this repository.", "type": "string" }, "delete_branch_on_merge": { "default": false, "description": "Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion.", "type": "boolean" }, "description": { "description": "A short description of the repository.", "type": "string" }, "has_issues": { "default": true, "description": "Either `true` to enable issues for this repository or `false` to disable them.", "type": "boolean" }, "has_projects": { "default": true, "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.", "type": "boolean" }, "has_wiki": { "default": true, "description": "Either `true` to enable the wiki for this repository or `false` to disable it.", "type": "boolean" }, "homepage": { "description": "A URL with more information about the repository.", "type": "string" }, "is_template": { "default": false, "description": "Either `true` to make this repo available as a template repository or `false` to prevent it.", "type": "boolean" }, "merge_commit_message": { "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message.", "enum": [ "PR_BODY", "PR_TITLE", "BLANK" ], "type": "string" }, "merge_commit_title": { "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).", "enum": [ "PR_TITLE", "MERGE_MESSAGE" ], "type": "string" }, "name": { "description": "The name of the repository.", "type": "string" }, "private": { "default": false, "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.", "type": "boolean" }, "security_and_analysis": { "description": "Specify which security and analysis features to enable or disable for the repository.\n\nTo 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).\"\n\nFor example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:\n`{ \"security_and_analysis\": {\"advanced_security\": { \"status\": \"enabled\" } } }`.\n\nYou can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request.", "nullable": true, "properties": { "advanced_security": { "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": { "description": "Can be `enabled` or `disabled`.", "type": "string" } }, "type": "object" }, "secret_scanning": { "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": { "description": "Can be `enabled` or `disabled`.", "type": "string" } }, "type": "object" }, "secret_scanning_push_protection": { "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": { "description": "Can be `enabled` or `disabled`.", "type": "string" } }, "type": "object" } }, "type": "object" }, "squash_merge_commit_message": { "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message.", "enum": [ "PR_BODY", "COMMIT_MESSAGES", "BLANK" ], "type": "string" }, "squash_merge_commit_title": { "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `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).", "enum": [ "PR_TITLE", "COMMIT_OR_PR_TITLE" ], "type": "string" }, "use_squash_pr_title_as_default": { "default": false, "deprecated": true, "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.", "type": "boolean" }, "visibility": { "description": "The visibility of the repository.", "enum": [ "public", "private" ], "type": "string" }, "web_commit_signoff_required": { "default": false, "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.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/full-repository" } }, "schema": { "$ref": "#/components/schemas/full-repository" } } }, "description": "Response" }, "307": { "$ref": "#/components/responses/temporary_redirect" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/actions/artifacts": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-artifacts-for-a-repository" }, "operationId": "actions/list-artifacts-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "description": "Filters artifacts by exact match on their name field.", "in": "query", "name": "name", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/artifact-paginated" } }, "schema": { "properties": { "artifacts": { "items": { "$ref": "#/components/schemas/artifact" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "artifacts" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List artifacts for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-an-artifact" }, "operationId": "actions/delete-artifact", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete an artifact", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "artifacts" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-an-artifact" }, "operationId": "actions/get-artifact", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/artifact" } }, "schema": { "$ref": "#/components/schemas/artifact" } } }, "description": "Response" } }, "summary": "Get an artifact", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}": { "get": { "description": "Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in\nthe response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to\nthe repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\nGitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#download-an-artifact" }, "operationId": "actions/download-artifact", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/artifact-id" }, { "in": "path", "name": "archive_format", "required": true, "schema": { "type": "string" } } ], "responses": { "302": { "description": "Response", "headers": { "Location": { "$ref": "#/components/headers/location" } } }, "410": { "$ref": "#/components/responses/gone" } }, "summary": "Download an artifact", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/cache/usage": { "get": { "description": "Gets GitHub Actions cache usage for a repository.\nThe 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.\nAnyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-github-actions-cache-usage-for-a-repository" }, "operationId": "actions/get-actions-cache-usage", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-cache-usage" } }, "schema": { "$ref": "#/components/schemas/actions-cache-usage-by-repository" } } }, "description": "Response" } }, "summary": "Get GitHub Actions cache usage for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cache" } } }, "/repos/{owner}/{repo}/actions/caches": { "delete": { "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.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\n\nGitHub Apps must have the `actions:write` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key" }, "operationId": "actions/delete-actions-cache-by-key", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/actions-cache-key-required" }, { "$ref": "#/components/parameters/git-ref" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-cache-list" } }, "schema": { "$ref": "#/components/schemas/actions-cache-list" } } }, "description": "Response" } }, "summary": "Delete GitHub Actions caches for a repository (using a cache key)", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cache" } }, "get": { "description": "Lists the GitHub Actions caches for a repository.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\nGitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository" }, "operationId": "actions/get-actions-cache-list", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/git-ref" }, { "$ref": "#/components/parameters/actions-cache-key" }, { "$ref": "#/components/parameters/actions-cache-list-sort" }, { "$ref": "#/components/parameters/direction" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-cache-list" } }, "schema": { "$ref": "#/components/schemas/actions-cache-list" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List GitHub Actions caches for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "cache" } } }, "/repos/{owner}/{repo}/actions/caches/{cache_id}": { "delete": { "description": "Deletes a GitHub Actions cache for a repository, using a cache ID.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\n\nGitHub Apps must have the `actions:write` permission to use this endpoint.", "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" }, "operationId": "actions/delete-actions-cache-by-id", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/cache-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a GitHub Actions cache for a repository (using a cache ID)", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "cache" } } }, "/repos/{owner}/{repo}/actions/jobs/{job_id}": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-job-for-a-workflow-run" }, "operationId": "actions/get-job-for-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/job-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/job" } }, "schema": { "$ref": "#/components/schemas/job" } } }, "description": "Response" } }, "summary": "Get a job for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": { "get": { "description": "Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\nfor `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can\nuse this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must\nhave the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#download-job-logs-for-a-workflow-run" }, "operationId": "actions/download-job-logs-for-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" } } } } }, "summary": "Download job logs for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun": { "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#re-run-job-for-workflow-run" }, "operationId": "actions/re-run-job-for-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/job-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "nullable": true, "properties": { "enable_debug_logging": { "default": false, "description": "Whether to enable debug logging for the re-run.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Re-run a job from a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/oidc/customization/sub": { "get": { "description": "Gets the customization template for an OpenID Connect (OIDC) subject claim.\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint. GitHub Apps must have the `organization_administration:read` permission to use this endpoint.", "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" }, "operationId": "actions/get-custom-oidc-sub-claim-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/oidc-custom-sub-repo" } }, "schema": { "$ref": "#/components/schemas/oidc-custom-sub-repo" } } }, "description": "Status response" }, "400": { "$ref": "#/components/responses/bad_request" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get the customization template for an OIDC subject claim for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "previews": [], "subcategory": "oidc" } }, "put": { "description": "Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "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" }, "operationId": "actions/set-custom-oidc-sub-claim-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "include_claim_keys": [ "repo", "context" ], "use_default": false } } }, "schema": { "description": "Actions OIDC subject customization for a repository", "properties": { "include_claim_keys": { "description": "Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.", "items": { "type": "string" }, "type": "array" }, "use_default": { "description": "Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored.", "type": "boolean" } }, "required": [ "use_default" ], "title": "Actions OIDC subject customization for a repository", "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Empty response" }, "400": { "$ref": "#/components/responses/bad_request" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Set the customization template for an OIDC subject claim for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "previews": [], "subcategory": "oidc" } } }, "/repos/{owner}/{repo}/actions/permissions": { "get": { "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.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-github-actions-permissions-for-a-repository" }, "operationId": "actions/get-github-actions-permissions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-repository-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-repository-permissions" } } }, "description": "Response" } }, "summary": "Get GitHub Actions permissions for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-github-actions-permissions-for-a-repository" }, "operationId": "actions/set-github-actions-permissions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "allowed_actions": "selected", "enabled": true } } }, "schema": { "properties": { "allowed_actions": { "$ref": "#/components/schemas/allowed-actions" }, "enabled": { "$ref": "#/components/schemas/actions-enabled" } }, "required": [ "enabled" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set GitHub Actions permissions for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/permissions/access": { "get": { "description": "Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.\nThis endpoint only applies to private repositories.\nFor 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).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the\nrepository `administration` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-workflow-access-level-to-a-repository" }, "operationId": "actions/get-workflow-access-to-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-workflow-access-to-repository" } }, "schema": { "$ref": "#/components/schemas/actions-workflow-access-to-repository" } } }, "description": "Response" } }, "summary": "Get the level of access for workflows outside of the repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "permissions" } }, "put": { "description": "Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.\nThis endpoint only applies to private repositories.\nFor 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)\".\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the\nrepository `administration` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-workflow-access-to-a-repository" }, "operationId": "actions/set-workflow-access-to-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-workflow-access-to-repository" } }, "schema": { "$ref": "#/components/schemas/actions-workflow-access-to-repository" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Set the level of access for workflows outside of the repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/permissions/selected-actions": { "get": { "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).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-allowed-actions-for-a-repository" }, "operationId": "actions/get-allowed-actions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/selected-actions" } }, "schema": { "$ref": "#/components/schemas/selected-actions" } } }, "description": "Response" } }, "summary": "Get allowed actions and reusable workflows for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "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).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-allowed-actions-for-a-repository" }, "operationId": "actions/set-allowed-actions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "selected_actions": { "$ref": "#/components/examples/selected-actions" } }, "schema": { "$ref": "#/components/schemas/selected-actions" } } }, "required": false }, "responses": { "204": { "description": "Response" } }, "summary": "Set allowed actions and reusable workflows for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/permissions/workflow": { "get": { "description": "Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,\nas well as if GitHub Actions can submit approving pull request reviews.\nFor 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).\"\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-default-workflow-permissions-for-a-repository" }, "operationId": "actions/get-github-actions-default-workflow-permissions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-default-workflow-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-get-default-workflow-permissions" } } }, "description": "Response" } }, "summary": "Get default workflow permissions for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } }, "put": { "description": "Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions\ncan submit approving pull request reviews.\nFor 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).\"\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-default-workflow-permissions-for-a-repository" }, "operationId": "actions/set-github-actions-default-workflow-permissions-repository", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-default-workflow-permissions" } }, "schema": { "$ref": "#/components/schemas/actions-set-default-workflow-permissions" } } }, "required": true }, "responses": { "204": { "description": "Success response" }, "409": { "description": "Conflict response when changing a setting is prevented by the owning organization" } }, "summary": "Set default workflow permissions for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "permissions" } } }, "/repos/{owner}/{repo}/actions/required_workflows/{required_workflow_id_for_repo}/runs": { "get": { "description": "List all workflow runs for a required workflow. 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).\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. For more information, see \"[Required Workflows](https://docs.github.com/actions/using-workflows/required-workflows).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-required-workflow-runs" }, "operationId": "actions/list-required-workflow-runs", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/repo-required-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "workflow_runs": { "items": { "$ref": "#/components/schemas/workflow-run" }, "type": "array" } }, "required": [ "total_count", "workflow_runs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List workflow runs for a required workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runners": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-a-repository" }, "operationId": "actions/list-self-hosted-runners-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner-paginated" } }, "schema": { "properties": { "runners": { "items": { "$ref": "#/components/schemas/runner" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "runners" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List self-hosted runners for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/downloads": { "get": { "description": "Lists binaries for the runner application that you can download and run.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-runner-applications-for-a-repository" }, "operationId": "actions/list-runner-applications-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner-application-items" } }, "schema": { "items": { "$ref": "#/components/schemas/runner-application" }, "type": "array" } } }, "description": "Response" } }, "summary": "List runner applications for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/registration-token": { "post": { "description": "Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate\nusing an access token with the `repo` scope to use this endpoint.\n\n#### Example using registration token\n \nConfigure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.\n\n```\n./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-registration-token-for-a-repository" }, "operationId": "actions/create-registration-token-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authentication-token" } }, "schema": { "$ref": "#/components/schemas/authentication-token" } } }, "description": "Response" } }, "summary": "Create a registration token for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/remove-token": { "post": { "description": "Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\n\n#### Example using remove token\n \nTo remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint.\n\n```\n./config.sh remove --token TOKEN\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-remove-token-for-a-repository" }, "operationId": "actions/create-remove-token-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/authentication-token-2" } }, "schema": { "$ref": "#/components/schemas/authentication-token" } } }, "description": "Response" } }, "summary": "Create a remove token for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/{runner_id}": { "delete": { "description": "Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.\n\nYou must authenticate using an access token with the `repo`\nscope to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository" }, "operationId": "actions/delete-self-hosted-runner-from-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a self-hosted runner from a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "get": { "description": "Gets a specific self-hosted runner configured in a repository.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/get-self-hosted-runner-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/runner" } }, "schema": { "$ref": "#/components/schemas/runner" } } }, "description": "Response" } }, "summary": "Get a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/{runner_id}/labels": { "delete": { "description": "Remove all custom labels from a self-hosted runner configured in a\nrepository. Returns the remaining read-only labels from the runner.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/remove-all-custom-labels-from-self-hosted-runner-for-repo", "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" } }, "summary": "Remove all custom labels from a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "get": { "description": "Lists all labels for a self-hosted runner configured in a repository.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-labels-for-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/list-labels-for-self-hosted-runner-for-repo", "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" } }, "summary": "List labels for a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "post": { "description": "Add custom labels to a self-hosted runner configured in a repository.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#add-custom-labels-to-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/add-custom-labels-to-self-hosted-runner-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "labels": [ "gpu", "accelerated" ] } } }, "schema": { "properties": { "labels": { "description": "The names of the custom labels to add to the runner.", "items": { "type": "string" }, "maxItems": 100, "minItems": 1, "type": "array" } }, "required": [ "labels" ], "type": "object" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/actions_runner_labels" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Add custom labels to a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } }, "put": { "description": "Remove all previous custom labels and set the new custom labels for a specific\nself-hosted runner configured in a repository.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#set-custom-labels-for-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/set-custom-labels-for-self-hosted-runner-for-repo", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/runner-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "labels": [ "gpu", "accelerated" ] } } }, "schema": { "properties": { "labels": { "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" }, "maxItems": 100, "minItems": 0, "type": "array" } }, "required": [ "labels" ], "type": "object" } } }, "required": true }, "responses": { "200": { "$ref": "#/components/responses/actions_runner_labels" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Set custom labels for a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}": { "delete": { "description": "Remove a custom label from a self-hosted runner configured\nin a repository. Returns the remaining labels from the runner.\n\nThis endpoint returns a `404 Not Found` status if the custom label is not\npresent on the runner.\n\nYou must authenticate using an access token with the `repo` scope to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository" }, "operationId": "actions/remove-custom-label-from-self-hosted-runner-for-repo", "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" } }, "summary": "Remove a custom label from a self-hosted runner for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "self-hosted-runners" } } }, "/repos/{owner}/{repo}/actions/runs": { "get": { "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).\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-workflow-runs-for-a-repository" }, "operationId": "actions/list-workflow-runs-for-repo", "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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "workflow_runs": { "items": { "$ref": "#/components/schemas/workflow-run" }, "type": "array" } }, "required": [ "total_count", "workflow_runs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List workflow runs for a repository", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}": { "delete": { "description": "Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is\nprivate you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use\nthis endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-a-workflow-run" }, "operationId": "actions/delete-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-workflow-run" }, "operationId": "actions/get-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "$ref": "#/components/parameters/exclude-pull-requests" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run" } }, "schema": { "$ref": "#/components/schemas/workflow-run" } } }, "description": "Response" } }, "summary": "Get a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/approvals": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-the-review-history-for-a-workflow-run" }, "operationId": "actions/get-reviews-for-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/environment-approvals-items" } }, "schema": { "items": { "$ref": "#/components/schemas/environment-approvals" }, "type": "array" } } }, "description": "Response" } }, "summary": "Get the review history for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/approve": { "post": { "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).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request" }, "operationId": "actions/approve-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Approve a workflow run for a fork pull request", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-workflow-run-artifacts" }, "operationId": "actions/list-workflow-run-artifacts", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/artifact-paginated" } }, "schema": { "properties": { "artifacts": { "items": { "$ref": "#/components/schemas/artifact" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "artifacts" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List workflow run artifacts", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "artifacts" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}": { "get": { "description": "Gets a specific workflow run attempt. Anyone with read access to the repository\ncan use this endpoint. If the repository is private you must use an access token\nwith the `repo` scope. GitHub Apps must have the `actions:read` permission to\nuse this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-workflow-run-attempt" }, "operationId": "actions/get-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run" } }, "schema": { "$ref": "#/components/schemas/workflow-run" } } }, "description": "Response" } }, "summary": "Get a workflow run attempt", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs": { "get": { "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).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run-attempt" }, "operationId": "actions/list-jobs-for-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/job-paginated" } }, "schema": { "properties": { "jobs": { "items": { "$ref": "#/components/schemas/job" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "jobs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List jobs for a workflow run attempt", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs": { "get": { "description": "Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after\n1 minute. Look for `Location:` in the response header to find the URL for the download. Anyone with read access to\nthe repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.\nGitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#download-workflow-run-attempt-logs" }, "operationId": "actions/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" } } } } }, "summary": "Download workflow run attempt logs", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/cancel": { "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#cancel-a-workflow-run" }, "operationId": "actions/cancel-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "202": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" }, "409": { "$ref": "#/components/responses/conflict" } }, "summary": "Cancel a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/jobs": { "get": { "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).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run" }, "operationId": "actions/list-jobs-for-workflow-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" }, { "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", "name": "filter", "required": false, "schema": { "default": "latest", "enum": [ "latest", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/job-paginated" } }, "schema": { "properties": { "jobs": { "items": { "$ref": "#/components/schemas/job" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "jobs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List jobs for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-jobs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/logs": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-workflow-run-logs" }, "operationId": "actions/delete-workflow-run-logs", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "Delete workflow run logs", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } }, "get": { "description": "Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\n`Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use\nthis endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have\nthe `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#download-workflow-run-logs" }, "operationId": "actions/download-workflow-run-logs", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "302": { "description": "Response", "headers": { "Location": { "example": "https://pipelines.actions.githubusercontent.com/ab1f3cCFPB34Nd6imvFxpGZH5hNlDp2wijMwl2gDoO0bcrrlJj/_apis/pipelines/1/runs/19/signedlogcontent?urlExpires=2020-01-22T22%3A44%3A54.1389777Z&urlSigningMethod=HMACV1&urlSignature=2TUDfIg4fm36OJmfPy6km5QD5DLCOkBVzvhWZM8B%2BUY%3D", "schema": { "type": "string" } } } } }, "summary": "Download workflow run logs", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments": { "get": { "description": "Get all deployment environments for a workflow run that are waiting for protection rules to pass.\n\nAnyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-pending-deployments-for-a-workflow-run" }, "operationId": "actions/get-pending-deployments-for-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/pending-deployment-items" } }, "schema": { "items": { "$ref": "#/components/schemas/pending-deployment" }, "type": "array" } } }, "description": "Response" } }, "summary": "Get pending deployments for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } }, "post": { "description": "Approve or reject pending deployments that are waiting on approval by a required reviewer.\n\nRequired 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#review-pending-deployments-for-a-workflow-run" }, "operationId": "actions/review-pending-deployments-for-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "comment": "Ship it!", "environment_ids": [ 161171787 ], "state": "approved" } } }, "schema": { "properties": { "comment": { "description": "A comment to accompany the deployment review", "example": "Ship it!", "type": "string" }, "environment_ids": { "description": "The list of environment ids to approve or reject", "example": [ 161171787, 161171795 ], "items": { "example": 161171787, "type": "integer" }, "type": "array" }, "state": { "description": "Whether to approve or reject deployment to the specified environments.", "enum": [ "approved", "rejected" ], "example": "approved", "type": "string" } }, "required": [ "environment_ids", "state", "comment" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/deployment-items" } }, "schema": { "items": { "$ref": "#/components/schemas/deployment" }, "type": "array" } } }, "description": "Response" } }, "summary": "Review pending deployments for a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/rerun": { "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#re-run-a-workflow" }, "operationId": "actions/re-run-workflow", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "nullable": true, "properties": { "enable_debug_logging": { "default": false, "description": "Whether to enable debug logging for the re-run.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" } }, "summary": "Re-run a workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs": { "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#re-run-workflow-failed-jobs" }, "operationId": "actions/re-run-workflow-failed-jobs", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "nullable": true, "properties": { "enable_debug_logging": { "default": false, "description": "Whether to enable debug logging for the re-run.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" } }, "summary": "Re-run failed jobs from a workflow run", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/runs/{run_id}/timing": { "get": { "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)\".\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-workflow-run-usage" }, "operationId": "actions/get-workflow-run-usage", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/run-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run-usage" } }, "schema": { "$ref": "#/components/schemas/workflow-run-usage" } } }, "description": "Response" } }, "summary": "Get workflow run usage", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/secrets": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-repository-secrets" }, "operationId": "actions/list-repo-secrets", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-secret-paginated" } }, "schema": { "properties": { "secrets": { "items": { "$ref": "#/components/schemas/actions-secret" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "secrets" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List repository secrets", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/secrets/public-key": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-repository-public-key" }, "operationId": "actions/get-repo-public-key", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-public-key" } }, "schema": { "$ref": "#/components/schemas/actions-public-key" } } }, "description": "Response" } }, "summary": "Get a repository public key", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/secrets/{secret_name}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#delete-a-repository-secret" }, "operationId": "actions/delete-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a repository secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-repository-secret" }, "operationId": "actions/get-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-secret" } }, "schema": { "$ref": "#/components/schemas/actions-secret" } } }, "description": "Response" } }, "summary": "Get a repository secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } }, "put": { "description": "Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use\nthis endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.\n\n```\nconst sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n```\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-or-update-a-repository-secret" }, "operationId": "actions/create-or-update-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678" } } }, "schema": { "properties": { "encrypted_value": { "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/reference/actions#get-a-repository-public-key) endpoint.", "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$", "type": "string" }, "key_id": { "description": "ID of the key you used to encrypt the secret.", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a secret" }, "204": { "description": "Response when updating a secret" } }, "summary": "Create or update a repository secret", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "secrets" } } }, "/repos/{owner}/{repo}/actions/variables": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#list-repository-variables" }, "operationId": "actions/list-repo-variables", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/variables-per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-variables-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "variables": { "items": { "$ref": "#/components/schemas/actions-variable" }, "type": "array" } }, "required": [ "total_count", "variables" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List repository variables", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "post": { "description": "Creates a repository variable that you can reference in a GitHub Actions workflow.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\nGitHub Apps must have the `actions_variables:write` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#create-a-repository-variable" }, "operationId": "actions/create-repo-variable", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "name": "USERNAME", "value": "octocat" } } }, "schema": { "properties": { "name": { "description": "The name of the variable.", "type": "string" }, "value": { "description": "The value of the variable.", "type": "string" } }, "required": [ "name", "value" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" } }, "summary": "Create a repository variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/repos/{owner}/{repo}/actions/variables/{name}": { "delete": { "description": "Deletes a repository variable using the variable name.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\nGitHub Apps must have the `actions_variables:write` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#delete-a-repository-variable" }, "operationId": "actions/delete-repo-variable", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/variable-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a repository variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#get-a-repository-variable" }, "operationId": "actions/get-repo-variable", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/variable-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/actions-variable" } }, "schema": { "$ref": "#/components/schemas/actions-variable" } } }, "description": "Response" } }, "summary": "Get a repository variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } }, "patch": { "description": "Updates a repository variable that you can reference in a GitHub Actions workflow.\nYou must authenticate using an access token with the `repo` scope to use this endpoint.\nGitHub Apps must have the `actions_variables:write` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/actions/variables#update-a-repository-variable" }, "operationId": "actions/update-repo-variable", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/variable-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "name": "USERNAME", "value": "octocat" } } }, "schema": { "properties": { "name": { "description": "The name of the variable.", "type": "string" }, "value": { "description": "The value of the variable.", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Update a repository variable", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "variables" } } }, "/repos/{owner}/{repo}/actions/workflows": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-repository-workflows" }, "operationId": "actions/list-repo-workflows", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "workflows": { "items": { "$ref": "#/components/schemas/workflow" }, "type": "array" } }, "required": [ "total_count", "workflows" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List repository workflows", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-a-workflow" }, "operationId": "actions/get-workflow", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow" } }, "schema": { "$ref": "#/components/schemas/workflow" } } }, "description": "Response" } }, "summary": "Get a workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": { "put": { "description": "Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#disable-a-workflow" }, "operationId": "actions/disable-workflow", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Disable a workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { "post": { "description": "You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see \"[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).\"\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see \"[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event" }, "operationId": "actions/create-workflow-dispatch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "inputs": { "home": "San Francisco, CA", "name": "Mona the Octocat" }, "ref": "topic-branch" } } }, "schema": { "properties": { "inputs": { "additionalProperties": { "type": "string" }, "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.", "maxProperties": 10, "type": "object" }, "ref": { "description": "The git reference for the workflow. The reference can be a branch or tag name.", "type": "string" } }, "required": [ "ref" ], "type": "object" } } }, "required": true }, "responses": { "204": { "description": "Response" } }, "summary": "Create a workflow dispatch event", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": { "put": { "description": "Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.\n\nYou must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#enable-a-workflow" }, "operationId": "actions/enable-workflow", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "204": { "description": "Response" } }, "summary": "Enable a workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs": { "get": { "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).\n\nAnyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#list-workflow-runs" }, "operationId": "actions/list-workflow-runs", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" }, { "$ref": "#/components/parameters/actor" }, { "$ref": "#/components/parameters/workflow-run-branch" }, { "$ref": "#/components/parameters/event" }, { "$ref": "#/components/parameters/workflow-run-status" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/created" }, { "$ref": "#/components/parameters/exclude-pull-requests" }, { "$ref": "#/components/parameters/workflow-run-check-suite-id" }, { "$ref": "#/components/parameters/workflow-run-head-sha" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-run-paginated" } }, "schema": { "properties": { "total_count": { "type": "integer" }, "workflow_runs": { "items": { "$ref": "#/components/schemas/workflow-run" }, "type": "array" } }, "required": [ "total_count", "workflow_runs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List workflow runs for a workflow", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "workflow-runs" } } }, "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing": { "get": { "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)\".\n\nYou 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/actions#get-workflow-usage" }, "operationId": "actions/get-workflow-usage", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/workflow-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/workflow-usage" } }, "schema": { "$ref": "#/components/schemas/workflow-usage" } } }, "description": "Response" } }, "summary": "Get workflow usage", "tags": [ "actions" ], "x-github": { "category": "actions", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "workflows" } } }, "/repos/{owner}/{repo}/assignees": { "get": { "description": "Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/issues#list-assignees" }, "operationId": "issues/list-assignees", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List assignees", "tags": [ "issues" ], "x-github": { "category": "issues", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "assignees" } } }, "/repos/{owner}/{repo}/assignees/{assignee}": { "get": { "description": "Checks if a user has permission to be assigned to an issue in this repository.\n\nIf the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.\n\nOtherwise a `404` status code is returned.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/issues#check-if-a-user-can-be-assigned" }, "operationId": "issues/check-user-can-be-assigned", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "in": "path", "name": "assignee", "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": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } }, "description": "Otherwise a `404` status code is returned." } }, "summary": "Check if a user can be assigned", "tags": [ "issues" ], "x-github": { "category": "issues", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "assignees" } } }, "/repos/{owner}/{repo}/autolinks": { "get": { "description": "This returns a list of autolinks configured for the given repository.\n\nInformation about autolinks are only available to repository administrators.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository" }, "operationId": "repos/list-autolinks", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/autolink-items" } }, "schema": { "items": { "$ref": "#/components/schemas/autolink" }, "type": "array" } } }, "description": "Response" } }, "summary": "List all autolinks of a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "autolinks" } }, "post": { "description": "Users with admin access to the repository can create an autolink.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository" }, "operationId": "repos/create-autolink", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "is_alphanumeric": true, "key_prefix": "TICKET-", "url_template": "https://example.com/TICKET?query=" } } }, "schema": { "properties": { "is_alphanumeric": { "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.", "type": "boolean" }, "key_prefix": { "description": "This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit.", "type": "string" }, "url_template": { "description": "The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`.", "type": "string" } }, "required": [ "key_prefix", "url_template" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/autolink" } }, "schema": { "$ref": "#/components/schemas/autolink" } } }, "description": "response", "headers": { "Location": { "example": "https://api.github.com/repos/octocat/Hello-World/autolinks/1", "schema": { "type": "string" } } } }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Create an autolink reference for a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "autolinks" } } }, "/repos/{owner}/{repo}/autolinks/{autolink_id}": { "delete": { "description": "This deletes a single autolink reference by ID that was configured for the given repository.\n\nInformation about autolinks are only available to repository administrators.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository" }, "operationId": "repos/delete-autolink", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/autolink-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete an autolink reference from a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "autolinks" } }, "get": { "description": "This returns a single autolink reference by ID that was configured for the given repository.\n\nInformation about autolinks are only available to repository administrators.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository" }, "operationId": "repos/get-autolink", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/autolink-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/autolink" } }, "schema": { "$ref": "#/components/schemas/autolink" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get an autolink reference of a repository", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "autolinks" } } }, "/repos/{owner}/{repo}/automated-security-fixes": { "delete": { "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)\".", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#disable-automated-security-fixes" }, "operationId": "repos/disable-automated-security-fixes", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "summary": "Disable automated security fixes", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "put": { "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)\".", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#enable-automated-security-fixes" }, "operationId": "repos/enable-automated-security-fixes", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "204": { "description": "Response" } }, "summary": "Enable automated security fixes", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/branches": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branches#list-branches" }, "operationId": "repos/list-branches", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "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", "name": "protected", "required": false, "schema": { "type": "boolean" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/short-branch-with-protection-items" } }, "schema": { "items": { "$ref": "#/components/schemas/short-branch" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "List branches", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/branches/{branch}": { "get": { "description": "", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branches#get-a-branch" }, "operationId": "repos/get-branch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/branch-get" } }, "schema": { "$ref": "#/components/schemas/branch-with-protection" } } }, "description": "Response" }, "301": { "$ref": "#/components/responses/moved_permanently" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get a branch", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/branches/{branch}/protection": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#delete-branch-protection" }, "operationId": "repos/delete-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" } }, "summary": "Delete branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-branch-protection" }, "operationId": "repos/get-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/branch-protection" } }, "schema": { "$ref": "#/components/schemas/branch-protection" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "put": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nProtecting a branch requires admin or owner permissions to the repository.\n\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.\n\n**Note**: The list of users, apps, and teams in total is limited to 100 items.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#update-branch-protection" }, "operationId": "repos/update-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "allow_deletions": true, "allow_force_pushes": true, "allow_fork_syncing": true, "block_creations": true, "enforce_admins": true, "lock_branch": true, "required_conversation_resolution": true, "required_linear_history": true, "required_pull_request_reviews": { "bypass_pull_request_allowances": { "teams": [ "justice-league" ], "users": [ "octocat" ] }, "dismiss_stale_reviews": true, "dismissal_restrictions": { "teams": [ "justice-league" ], "users": [ "octocat" ] }, "require_code_owner_reviews": true, "require_last_push_approval": true, "required_approving_review_count": 2 }, "required_status_checks": { "contexts": [ "continuous-integration/travis-ci" ], "strict": true }, "restrictions": { "apps": [ "super-ci" ], "teams": [ "justice-league" ], "users": [ "octocat" ] } } } }, "schema": { "properties": { "allow_deletions": { "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.", "type": "boolean" }, "allow_force_pushes": { "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, "type": "boolean" }, "allow_fork_syncing": { "default": false, "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`.", "type": "boolean" }, "block_creations": { "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`.", "type": "boolean" }, "enforce_admins": { "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, "type": "boolean" }, "lock_branch": { "default": false, "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`.", "type": "boolean" }, "required_conversation_resolution": { "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`.", "type": "boolean" }, "required_linear_history": { "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.", "type": "boolean" }, "required_pull_request_reviews": { "description": "Require at least one approving review on a pull request, before merging. Set to `null` to disable.", "nullable": true, "properties": { "bypass_pull_request_allowances": { "description": "Allow specific users, teams, or apps to bypass pull request requirements.", "properties": { "apps": { "description": "The list of app `slug`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" }, "teams": { "description": "The list of team `slug`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" }, "users": { "description": "The list of user `login`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "dismiss_stale_reviews": { "description": "Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit.", "type": "boolean" }, "dismissal_restrictions": { "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": { "apps": { "description": "The list of app `slug`s with dismissal access", "items": { "type": "string" }, "type": "array" }, "teams": { "description": "The list of team `slug`s with dismissal access", "items": { "type": "string" }, "type": "array" }, "users": { "description": "The list of user `login`s with dismissal access", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "require_code_owner_reviews": { "description": "Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) review them.", "type": "boolean" }, "require_last_push_approval": { "default": false, "description": "Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`.", "type": "boolean" }, "required_approving_review_count": { "description": "Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers.", "type": "integer" } }, "type": "object" }, "required_status_checks": { "description": "Require status checks to pass before merging. Set to `null` to disable.", "nullable": true, "properties": { "checks": { "description": "The list of status checks to require in order to merge into this branch.", "items": { "properties": { "app_id": { "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.", "type": "integer" }, "context": { "description": "The name of the required check", "type": "string" } }, "required": [ "context" ], "type": "object" }, "type": "array" }, "contexts": { "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" }, "type": "array" }, "strict": { "description": "Require branches to be up to date before merging.", "type": "boolean" } }, "required": [ "strict", "contexts" ], "type": "object" }, "restrictions": { "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": { "apps": { "description": "The list of app `slug`s with push access", "items": { "type": "string" }, "type": "array" }, "teams": { "description": "The list of team `slug`s with push access", "items": { "type": "string" }, "type": "array" }, "users": { "description": "The list of user `login`s with push access", "items": { "type": "string" }, "type": "array" } }, "required": [ "users", "teams" ], "type": "object" } }, "required": [ "required_status_checks", "enforce_admins", "required_pull_request_reviews", "restrictions" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/branch-protection-update" } }, "schema": { "$ref": "#/components/schemas/protected-branch" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "summary": "Update branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoving admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection" }, "operationId": "repos/delete-admin-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete admin branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection" }, "operationId": "repos/get-admin-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced-2" } }, "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" } } }, "description": "Response" } }, "summary": "Get admin branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nAdding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection" }, "operationId": "repos/set-admin-branch-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced-2" } }, "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" } } }, "description": "Response" } }, "summary": "Set admin branch protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection" }, "operationId": "repos/delete-pull-request-review-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete pull request review protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection" }, "operationId": "repos/get-pull-request-review-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-pull-request-review" } }, "schema": { "$ref": "#/components/schemas/protected-branch-pull-request-review" } } }, "description": "Response" } }, "summary": "Get pull request review protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "patch": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nUpdating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.\n\n**Note**: Passing new arrays of `users` and `teams` replaces their previous values.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection" }, "operationId": "repos/update-pull-request-review-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "bypass_pull_request_allowances": { "apps": [ "octoapp" ], "teams": [ "justice-league" ], "users": [ "octocat" ] }, "dismiss_stale_reviews": true, "dismissal_restrictions": { "apps": [ "octoapp" ], "teams": [ "justice-league" ], "users": [ "octocat" ] }, "require_code_owner_reviews": true, "require_last_push_approval": true, "required_approving_review_count": 2 } } }, "schema": { "properties": { "bypass_pull_request_allowances": { "description": "Allow specific users, teams, or apps to bypass pull request requirements.", "properties": { "apps": { "description": "The list of app `slug`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" }, "teams": { "description": "The list of team `slug`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" }, "users": { "description": "The list of user `login`s allowed to bypass pull request requirements.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "dismiss_stale_reviews": { "description": "Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit.", "type": "boolean" }, "dismissal_restrictions": { "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": { "apps": { "description": "The list of app `slug`s with dismissal access", "items": { "type": "string" }, "type": "array" }, "teams": { "description": "The list of team `slug`s with dismissal access", "items": { "type": "string" }, "type": "array" }, "users": { "description": "The list of user `login`s with dismissal access", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "require_code_owner_reviews": { "description": "Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed.", "type": "boolean" }, "require_last_push_approval": { "default": false, "description": "Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`", "type": "boolean" }, "required_approving_review_count": { "description": "Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers.", "type": "integer" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-pull-request-review" } }, "schema": { "$ref": "#/components/schemas/protected-branch-pull-request-review" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update pull request review protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection" }, "operationId": "repos/delete-commit-signature-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Delete commit signature protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help.\n\n**Note**: You must enable branch protection to require signed commits.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection" }, "operationId": "repos/get-commit-signature-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced" } }, "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get commit signature protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nWhen authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection" }, "operationId": "repos/create-commit-signature-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/protected-branch-admin-enforced" } }, "schema": { "$ref": "#/components/schemas/protected-branch-admin-enforced" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Create commit signature protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection" }, "operationId": "repos/remove-status-check-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" } }, "summary": "Remove status check protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection" }, "operationId": "repos/get-status-checks-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/status-check-policy" } }, "schema": { "$ref": "#/components/schemas/status-check-policy" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get status checks protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "patch": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nUpdating required status checks requires admin or owner permissions to the repository and branch protection to be enabled.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#update-status-check-protection" }, "operationId": "repos/update-status-check-protection", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "contexts": [ "continuous-integration/travis-ci" ], "strict": true } } }, "schema": { "properties": { "checks": { "description": "The list of status checks to require in order to merge into this branch.", "items": { "properties": { "app_id": { "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.", "type": "integer" }, "context": { "description": "The name of the required check", "type": "string" } }, "required": [ "context" ], "type": "object" }, "type": "array" }, "contexts": { "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" }, "type": "array" }, "strict": { "description": "Require branches to be up to date before merging.", "type": "boolean" } }, "type": "object" } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/status-check-policy" } }, "schema": { "$ref": "#/components/schemas/status-check-policy" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Update status check protection", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts" }, "operationId": "repos/remove-status-check-contexts", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example removing status checks from a branch protection rule", "value": { "contexts": [ "continuous-integration/jenkins" ] } } }, "schema": { "oneOf": [ { "example": { "contexts": [ "contexts" ] }, "properties": { "contexts": { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } }, "required": [ "contexts" ], "type": "object" }, { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } }, "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Remove status check contexts", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "contexts", "subcategory": "branch-protection" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts" }, "operationId": "repos/get-all-status-check-contexts", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } }, "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get all status check contexts", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts" }, "operationId": "repos/add-status-check-contexts", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example adding status checks to a branch protection rule", "value": { "contexts": [ "continuous-integration/travis-ci", "continuous-integration/jenkins" ] } } }, "schema": { "oneOf": [ { "example": { "contexts": [ "contexts" ] }, "properties": { "contexts": { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } }, "required": [ "contexts" ], "type": "object" }, { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": [ "continuous-integration/travis-ci", "continuous-integration/jenkins" ] } }, "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Add status check contexts", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "contexts", "subcategory": "branch-protection" } }, "put": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts" }, "operationId": "repos/set-status-check-contexts", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example updating status checks for a branch protection rule", "value": { "contexts": [ "continuous-integration/travis-ci" ] } } }, "schema": { "oneOf": [ { "example": { "contexts": [ "contexts" ] }, "properties": { "contexts": { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } }, "required": [ "contexts" ], "type": "object" }, { "description": "The name of the status checks", "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "value": [ "continuous-integration/travis-ci" ] } }, "schema": { "items": { "type": "string" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set status check contexts", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "contexts", "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nDisables the ability to restrict who can push to this branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions" }, "operationId": "repos/delete-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "get": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists who has access to this protected branch.\n\n**Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#get-access-restrictions" }, "operationId": "repos/get-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/branch-restriction-policy" } }, "schema": { "$ref": "#/components/schemas/branch-restriction-policy" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions" }, "operationId": "repos/remove-app-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "apps": [ "my-app" ] } } }, "schema": { "oneOf": [ { "example": { "apps": [ "my-app" ] }, "properties": { "apps": { "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" }, "type": "array" } }, "required": [ "apps" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration-items" } }, "schema": { "items": { "$ref": "#/components/schemas/integration" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Remove app access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "apps", "subcategory": "branch-protection" } }, "get": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#list-apps-with-access-to-the-protected-branch" }, "operationId": "repos/get-apps-with-access-to-protected-branch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration-items" } }, "schema": { "items": { "$ref": "#/components/schemas/integration" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get apps with access to the protected branch", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions" }, "operationId": "repos/add-app-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "apps": [ "octoapp" ] } } }, "schema": { "oneOf": [ { "example": { "apps": [ "my-app" ] }, "properties": { "apps": { "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" }, "type": "array" } }, "required": [ "apps" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration-items" } }, "schema": { "items": { "$ref": "#/components/schemas/integration" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Add app access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "apps", "subcategory": "branch-protection" } }, "put": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions" }, "operationId": "repos/set-app-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "apps": [ "octoapp" ] } } }, "schema": { "oneOf": [ { "example": { "apps": [ "my-app" ] }, "properties": { "apps": { "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" }, "type": "array" } }, "required": [ "apps" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/integration-items" } }, "schema": { "items": { "$ref": "#/components/schemas/integration" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set app access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "apps", "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of a team to push to this branch. You can also remove push access for child teams.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions" }, "operationId": "repos/remove-team-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example removing a team in a branch protection rule", "value": { "teams": [ "octocats" ] } } }, "schema": { "oneOf": [ { "example": { "teams": [ "my-team" ] }, "properties": { "teams": { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } }, "required": [ "teams" ], "type": "object" }, { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Remove team access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "teams", "subcategory": "branch-protection" } }, "get": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the teams who have push access to this branch. The list includes child teams.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#list-teams-with-access-to-the-protected-branch" }, "operationId": "repos/get-teams-with-access-to-protected-branch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get teams with access to the protected branch", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified teams push access for this branch. You can also give push access to child teams.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions" }, "operationId": "repos/add-team-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example adding a team in a branch protection rule", "value": { "teams": [ "justice-league" ] } } }, "schema": { "oneOf": [ { "example": { "teams": [ "my-team" ] }, "properties": { "teams": { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } }, "required": [ "teams" ], "type": "object" }, { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Add team access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "teams", "subcategory": "branch-protection" } }, "put": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions" }, "operationId": "repos/set-team-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example replacing a team in a branch protection rule", "value": { "teams": [ "justice-league" ] } } }, "schema": { "oneOf": [ { "example": { "teams": [ "justice-league" ] }, "properties": { "teams": { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } }, "required": [ "teams" ], "type": "object" }, { "description": "The slug values for teams", "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/team-items" } }, "schema": { "items": { "$ref": "#/components/schemas/team" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set team access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "teams", "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": { "delete": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nRemoves the ability of a user to push to this branch.\n\n| Type | Description |\n| ------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions" }, "operationId": "repos/remove-user-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example removing a user in a branch protection rule", "value": { "users": [ "octocat" ] } } }, "schema": { "oneOf": [ { "example": { "users": [ "mona" ] }, "properties": { "users": { "description": "The username for users", "items": { "type": "string" }, "type": "array" } }, "required": [ "users" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } } }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Remove user access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "users", "subcategory": "branch-protection" } }, "get": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nLists the people who have push access to this branch.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#list-users-with-access-to-the-protected-branch" }, "operationId": "repos/get-users-with-access-to-protected-branch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get users with access to the protected branch", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "branch-protection" } }, "post": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nGrants the specified people push access for this branch.\n\n| Type | Description |\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions" }, "operationId": "repos/add-user-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example adding a user in a branch protection rule", "value": { "users": [ "octocat" ] } } }, "schema": { "oneOf": [ { "example": { "users": [ "mona" ] }, "properties": { "users": { "description": "The username for users", "items": { "type": "string" }, "type": "array" } }, "required": [ "users" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Add user access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "users", "subcategory": "branch-protection" } }, "put": { "description": "Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.\n\nReplaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.\n\n| Type | Description |\n| ------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. |", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions" }, "operationId": "repos/set-user-access-restrictions", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "summary": "Example replacing a user in a branch protection rule", "value": { "users": [ "octocat" ] } } }, "schema": { "oneOf": [ { "example": { "users": [ "mona" ] }, "properties": { "users": { "description": "The username for users", "items": { "type": "string" }, "type": "array" } }, "required": [ "users" ], "type": "object" }, { "items": { "type": "string" }, "type": "array" } ] } } }, "required": false }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/simple-user-items" } }, "schema": { "items": { "$ref": "#/components/schemas/simple-user" }, "type": "array" } } }, "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Set user access restrictions", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false, "requestBodyParameterName": "users", "subcategory": "branch-protection" } } }, "/repos/{owner}/{repo}/branches/{branch}/rename": { "post": { "description": "Renames a branch in a repository.\n\n**Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see \"[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)\".\n\nThe permissions required to use this endpoint depends on whether you are renaming the default branch.\n\nTo rename a non-default branch:\n\n* Users must have push access.\n* GitHub Apps must have the `contents:write` repository permission.\n\nTo rename the default branch:\n\n* Users must have admin or owner permissions.\n* GitHub Apps must have the `administration:write` repository permission.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/branches/branches#rename-a-branch" }, "operationId": "repos/rename-branch", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/branch" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "new_name": "my_renamed_branch" } } }, "schema": { "properties": { "new_name": { "description": "The new name of the branch.", "type": "string" } }, "required": [ "new_name" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/branch-with-protection" } }, "schema": { "$ref": "#/components/schemas/branch-with-protection" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "summary": "Rename a branch", "tags": [ "repos" ], "x-github": { "category": "branches", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/check-runs": { "post": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nCreates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs.\n\nIn a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#create-a-check-run" }, "operationId": "checks/create", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "example-of-completed-conclusion": { "summary": "Example of a completed conclusion", "value": { "actions": [ { "description": "Allow us to fix these errors for you", "identifier": "fix_errors", "label": "Fix" } ], "completed_at": "2017-11-30T19:49:10Z", "conclusion": "success", "head_sha": "ce587453ced02b1526dfb4cb910479d431683101", "name": "mighty_readme", "output": { "annotations": [ { "annotation_level": "warning", "end_line": 2, "message": "Check your spelling for 'banaas'.", "path": "README.md", "raw_details": "Do you mean 'bananas' or 'banana'?", "start_line": 2, "title": "Spell Checker" }, { "annotation_level": "warning", "end_line": 4, "message": "Check your spelling for 'aples'", "path": "README.md", "raw_details": "Do you mean 'apples' or 'Naples'", "start_line": 4, "title": "Spell Checker" } ], "images": [ { "alt": "Super bananas", "image_url": "http://example.com/images/42" } ], "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.", "title": "Mighty Readme report" }, "started_at": "2017-11-30T19:39:10Z", "status": "completed" } }, "example-of-in-progress-conclusion": { "summary": "Example of an in_progress conclusion", "value": { "external_id": "42", "head_sha": "ce587453ced02b1526dfb4cb910479d431683101", "name": "mighty_readme", "output": { "summary": "", "text": "", "title": "Mighty Readme report" }, "started_at": "2018-05-04T01:14:52Z", "status": "in_progress" } } }, "schema": { "oneOf": [ { "additionalProperties": true, "properties": { "status": { "enum": [ "completed" ] } }, "required": [ "status", "conclusion" ] }, { "additionalProperties": true, "properties": { "status": { "enum": [ "queued", "in_progress" ] } } } ], "properties": { "actions": { "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/reference/checks#check-runs-and-requested-actions).\"", "items": { "properties": { "description": { "description": "A short explanation of what this action would do. The maximum size is 40 characters.", "maxLength": 40, "type": "string" }, "identifier": { "description": "A reference for the action on the integrator's system. The maximum size is 20 characters.", "maxLength": 20, "type": "string" }, "label": { "description": "The text to be displayed on a button in the web UI. The maximum size is 20 characters.", "maxLength": 20, "type": "string" } }, "required": [ "label", "description", "identifier" ], "type": "object" }, "maxItems": 3, "type": "array" }, "completed_at": { "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`.", "format": "date-time", "type": "string" }, "conclusion": { "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" ], "type": "string" }, "details_url": { "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.", "type": "string" }, "external_id": { "description": "A reference for the run on the integrator's system.", "type": "string" }, "head_sha": { "description": "The SHA of the commit.", "type": "string" }, "name": { "description": "The name of the check. For example, \"code-coverage\".", "type": "string" }, "output": { "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": { "annotations": { "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/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\".", "items": { "properties": { "annotation_level": { "description": "The level of the annotation.", "enum": [ "notice", "warning", "failure" ], "type": "string" }, "end_column": { "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.", "type": "integer" }, "end_line": { "description": "The end line of the annotation.", "type": "integer" }, "message": { "description": "A short description of the feedback for these lines of code. The maximum size is 64 KB.", "type": "string" }, "path": { "description": "The path of the file to add an annotation to. For example, `assets/css/main.css`.", "type": "string" }, "raw_details": { "description": "Details about this annotation. The maximum size is 64 KB.", "type": "string" }, "start_column": { "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.", "type": "integer" }, "start_line": { "description": "The start line of the annotation. Line numbers start at 1.", "type": "integer" }, "title": { "description": "The title that represents the annotation. The maximum size is 255 characters.", "type": "string" } }, "required": [ "path", "start_line", "end_line", "annotation_level", "message" ], "type": "object" }, "maxItems": 50, "type": "array" }, "images": { "description": "Adds images to the output displayed in the GitHub pull request UI.", "items": { "properties": { "alt": { "description": "The alternative text for the image.", "type": "string" }, "caption": { "description": "A short image description.", "type": "string" }, "image_url": { "description": "The full URL of the image.", "type": "string" } }, "required": [ "alt", "image_url" ], "type": "object" }, "type": "array" }, "summary": { "description": "The summary of the check run. This parameter supports Markdown. **Maximum length**: 65535 characters.", "maxLength": 65535, "type": "string" }, "text": { "description": "The details of the check run. This parameter supports Markdown. **Maximum length**: 65535 characters.", "maxLength": 65535, "type": "string" }, "title": { "description": "The title of the check run.", "type": "string" } }, "required": [ "title", "summary" ], "type": "object" }, "started_at": { "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`.", "format": "date-time", "type": "string" }, "status": { "default": "queued", "description": "The current status.", "enum": [ "queued", "in_progress", "completed" ], "type": "string" } }, "required": [ "name", "head_sha" ], "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "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" } }, "schema": { "$ref": "#/components/schemas/check-run" } } }, "description": "Response" } }, "summary": "Create a check run", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-runs/{check_run_id}": { "get": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nGets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#get-a-check-run" }, "operationId": "checks/get", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-run" } }, "schema": { "$ref": "#/components/schemas/check-run" } } }, "description": "Response" } }, "summary": "Get a check run", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } }, "patch": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nUpdates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#update-a-check-run" }, "operationId": "checks/update", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "completed_at": "2018-05-04T01:14:52Z", "conclusion": "success", "name": "mighty_readme", "output": { "annotations": [ { "annotation_level": "warning", "end_line": 2, "message": "Check your spelling for 'banaas'.", "path": "README.md", "raw_details": "Do you mean 'bananas' or 'banana'?", "start_line": 2, "title": "Spell Checker" }, { "annotation_level": "warning", "end_line": 4, "message": "Check your spelling for 'aples'", "path": "README.md", "raw_details": "Do you mean 'apples' or 'Naples'", "start_line": 4, "title": "Spell Checker" } ], "images": [ { "alt": "Super bananas", "image_url": "http://example.com/images/42" } ], "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.", "title": "Mighty Readme report" }, "started_at": "2018-05-04T01:14:52Z", "status": "completed" } } }, "schema": { "anyOf": [ { "additionalProperties": true, "properties": { "status": { "enum": [ "completed" ] } }, "required": [ "conclusion" ] }, { "additionalProperties": true, "properties": { "status": { "enum": [ "queued", "in_progress" ] } } } ], "properties": { "actions": { "description": "Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions).\"", "items": { "properties": { "description": { "description": "A short explanation of what this action would do. The maximum size is 40 characters.", "maxLength": 40, "type": "string" }, "identifier": { "description": "A reference for the action on the integrator's system. The maximum size is 20 characters.", "maxLength": 20, "type": "string" }, "label": { "description": "The text to be displayed on a button in the web UI. The maximum size is 20 characters.", "maxLength": 20, "type": "string" } }, "required": [ "label", "description", "identifier" ], "type": "object" }, "maxItems": 3, "type": "array" }, "completed_at": { "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`.", "format": "date-time", "type": "string" }, "conclusion": { "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" ], "type": "string" }, "details_url": { "description": "The URL of the integrator's site that has the full details of the check.", "type": "string" }, "external_id": { "description": "A reference for the run on the integrator's system.", "type": "string" }, "name": { "description": "The name of the check. For example, \"code-coverage\".", "type": "string" }, "output": { "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": { "annotations": { "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/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see \"[About status checks](https://docs.github.com/articles/about-status-checks#checks)\".", "items": { "properties": { "annotation_level": { "description": "The level of the annotation.", "enum": [ "notice", "warning", "failure" ], "type": "string" }, "end_column": { "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.", "type": "integer" }, "end_line": { "description": "The end line of the annotation.", "type": "integer" }, "message": { "description": "A short description of the feedback for these lines of code. The maximum size is 64 KB.", "type": "string" }, "path": { "description": "The path of the file to add an annotation to. For example, `assets/css/main.css`.", "type": "string" }, "raw_details": { "description": "Details about this annotation. The maximum size is 64 KB.", "type": "string" }, "start_column": { "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.", "type": "integer" }, "start_line": { "description": "The start line of the annotation. Line numbers start at 1.", "type": "integer" }, "title": { "description": "The title that represents the annotation. The maximum size is 255 characters.", "type": "string" } }, "required": [ "path", "start_line", "end_line", "annotation_level", "message" ], "type": "object" }, "maxItems": 50, "type": "array" }, "images": { "description": "Adds images to the output displayed in the GitHub pull request UI.", "items": { "properties": { "alt": { "description": "The alternative text for the image.", "type": "string" }, "caption": { "description": "A short image description.", "type": "string" }, "image_url": { "description": "The full URL of the image.", "type": "string" } }, "required": [ "alt", "image_url" ], "type": "object" }, "type": "array" }, "summary": { "description": "Can contain Markdown.", "maxLength": 65535, "type": "string" }, "text": { "description": "Can contain Markdown.", "maxLength": 65535, "type": "string" }, "title": { "description": "**Required**.", "type": "string" } }, "required": [ "summary" ], "type": "object" }, "started_at": { "description": "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" }, "status": { "description": "The current status.", "enum": [ "queued", "in_progress", "completed" ], "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-run" } }, "schema": { "$ref": "#/components/schemas/check-run" } } }, "description": "Response" } }, "summary": "Update a check run", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#list-check-run-annotations" }, "operationId": "checks/list-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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-annotation-items" } }, "schema": { "items": { "$ref": "#/components/schemas/check-annotation" }, "type": "array" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List check run annotations", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest": { "post": { "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.\n\nTo rerequest a check run, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#rerequest-a-check-run" }, "operationId": "checks/rerequest-run", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-run-id" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } }, "description": "Forbidden if the check run is not rerequestable or doesn't belong to the authenticated GitHub App" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } }, "description": "Validation error if the check run is not rerequestable" } }, "summary": "Rerequest a check run", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-suites": { "post": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\nBy default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using \"[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)\". Your GitHub App must have the `checks:write` permission to create check suites.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#create-a-check-suite" }, "operationId": "checks/create-suite", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "head_sha": "d6fde92930d4715a2b49857d24b940956b26d2d3" } } }, "schema": { "properties": { "head_sha": { "description": "The sha of the head commit.", "type": "string" } }, "required": [ "head_sha" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-suite" } }, "schema": { "$ref": "#/components/schemas/check-suite" } } }, "description": "Response when the suite already exists" }, "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-suite" } }, "schema": { "$ref": "#/components/schemas/check-suite" } } }, "description": "Response when the suite was created" } }, "summary": "Create a check suite", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/preferences": { "patch": { "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/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites" }, "operationId": "checks/set-suites-preferences", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "auto_trigger_checks": [ { "app_id": 4, "setting": false } ] } } }, "schema": { "properties": { "auto_trigger_checks": { "description": "Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default.", "items": { "properties": { "app_id": { "description": "The `id` of the GitHub App.", "type": "integer" }, "setting": { "default": true, "description": "Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them.", "type": "boolean" } }, "required": [ "app_id", "setting" ], "type": "object" }, "type": "array" } }, "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-suite-preference" } }, "schema": { "$ref": "#/components/schemas/check-suite-preference" } } }, "description": "Response" } }, "summary": "Update repository preferences for check suites", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}": { "get": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.\n\nGets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#get-a-check-suite" }, "operationId": "checks/get-suite", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-suite-id" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-suite" } }, "schema": { "$ref": "#/components/schemas/check-suite" } } }, "description": "Response" } }, "summary": "Get a check suite", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "suites" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs": { "get": { "description": "**Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.\n\nLists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite" }, "operationId": "checks/list-for-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" }, { "description": "Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs.", "in": "query", "name": "filter", "required": false, "schema": { "default": "latest", "enum": [ "latest", "all" ], "type": "string" } }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/check-run-paginated" } }, "schema": { "properties": { "check_runs": { "items": { "$ref": "#/components/schemas/check-run" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "check_runs" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List check runs in a check suite", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "runs" } } }, "/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest": { "post": { "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.\n\nTo rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/checks#rerequest-a-check-suite" }, "operationId": "checks/rerequest-suite", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/check-suite-id" } ], "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response" } }, "summary": "Rerequest a check suite", "tags": [ "checks" ], "x-github": { "category": "checks", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "suites" } } }, "/repos/{owner}/{repo}/code-scanning/alerts": { "get": { "description": "Lists code scanning alerts.\n\nTo 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.\n\nGitHub Apps must have the `security_events` read\npermission to use this endpoint.\n\nThe response includes a `most_recent_instance` object.\nThis provides details of the most recent instance of this alert\nfor the default branch (or for the specified Git reference if you used `ref` in the request).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository" }, "operationId": "code-scanning/list-alerts-for-repo", "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" }, { "description": "The property by which to sort the results.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created", "updated" ], "type": "string" } }, { "description": "If specified, only code scanning alerts with this state will be returned.", "in": "query", "name": "state", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-alert-state" } }, { "description": "If specified, only code scanning alerts with this severity will be returned.", "in": "query", "name": "severity", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-alert-severity" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-items" } }, "schema": { "items": { "$ref": "#/components/schemas/code-scanning-alert-items" }, "type": "array" } } }, "description": "Response" }, "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" } }, "summary": "List code scanning alerts for a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#get-a-code-scanning-alert" }, "operationId": "code-scanning/get-alert", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/alert-number" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert" } }, "schema": { "$ref": "#/components/schemas/code-scanning-alert" } } }, "description": "Response" }, "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" } }, "summary": "Get a code scanning alert", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } }, "patch": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#update-a-code-scanning-alert" }, "operationId": "code-scanning/update-alert", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/alert-number" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "dismissed_comment": "This alert is not actually correct, because there's a sanitizer included in the library.", "dismissed_reason": "false positive", "state": "dismissed" } } }, "schema": { "properties": { "dismissed_comment": { "$ref": "#/components/schemas/code-scanning-alert-dismissed-comment" }, "dismissed_reason": { "$ref": "#/components/schemas/code-scanning-alert-dismissed-reason" }, "state": { "$ref": "#/components/schemas/code-scanning-alert-set-state" } }, "required": [ "state" ], "type": "object" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-dismissed" } }, "schema": { "$ref": "#/components/schemas/code-scanning-alert" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_write" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "Update a code scanning alert", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": { "get": { "description": "Lists all instances of the specified code scanning alert.\nYou must use an access token with the `security_events` scope to use this endpoint with private repos,\nthe `public_repo` scope also grants permission to read security events on public repos only.\nGitHub Apps must have the `security_events` read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-instances-of-a-code-scanning-alert" }, "operationId": "code-scanning/list-alert-instances", "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": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-alert-instances" } }, "schema": { "items": { "$ref": "#/components/schemas/code-scanning-alert-instance" }, "type": "array" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List instances of a code scanning alert", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/analyses": { "get": { "description": "Lists the details of all code scanning analyses for a repository,\nstarting with the most recent.\nThe response is paginated and you can use the `page` and `per_page` parameters\nto list the analyses you're interested in.\nBy default 30 analyses are listed per page.\n\nThe `rules_count` field in the response give the number of rules\nthat were run in the analysis.\nFor very old analyses this data is not available,\nand `0` is returned in this field.\n\nYou must use an access token with the `security_events` scope to use this endpoint with private repos,\nthe `public_repo` scope also grants permission to read security events on public repos only.\nGitHub Apps must have the `security_events` read permission to use this endpoint.\n\n**Deprecation notice**:\nThe `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository" }, "operationId": "code-scanning/list-recent-analyses", "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" }, { "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`.", "in": "query", "name": "ref", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-ref" } }, { "description": "Filter analyses belonging to the same SARIF upload.", "in": "query", "name": "sarif_id", "required": false, "schema": { "$ref": "#/components/schemas/code-scanning-analysis-sarif-id" } }, { "$ref": "#/components/parameters/direction" }, { "description": "The property by which to sort the results.", "in": "query", "name": "sort", "required": false, "schema": { "default": "created", "enum": [ "created" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-analysis-items" } }, "schema": { "items": { "$ref": "#/components/schemas/code-scanning-analysis" }, "type": "array" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List code scanning analyses for a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}": { "delete": { "description": "Deletes a specified code scanning analysis from a repository. For\nprivate repositories, you must use an access token with the `repo` scope. For public repositories,\nyou must use an access token with `public_repo` scope.\nGitHub Apps must have the `security_events` write permission to use this endpoint.\n\nYou can delete one analysis at a time.\nTo delete a series of analyses, start with the most recent analysis and work backwards.\nConceptually, the process is similar to the undo function in a text editor.\n\nWhen you list the analyses for a repository,\none or more will be identified as deletable in the response:\n\n```\n\"deletable\": true\n```\n\nAn analysis is deletable when it's the most recent in a set of analyses.\nTypically, a repository will have multiple sets of analyses\nfor each enabled code scanning tool,\nwhere a set is determined by a unique combination of analysis values:\n\n* `ref`\n* `tool`\n* `category`\n\nIf you attempt to delete an analysis that is not the most recent in a set,\nyou'll get a 400 response with the message:\n\n```\nAnalysis specified is not deletable.\n```\n\nThe response from a successful `DELETE` operation provides you with\ntwo alternative URLs for deleting the next analysis in the set:\n`next_analysis_url` and `confirm_delete_url`.\nUse the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis\nin a set. This is a useful option if you want to preserve at least one analysis\nfor the specified tool in your repository.\nUse the `confirm_delete_url` URL if you are content to remove all analyses for a tool.\nWhen you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`\nin the 200 response is `null`.\n\nAs an example of the deletion process,\nlet's imagine that you added a workflow that configured a particular code scanning tool\nto analyze the code in a repository. This tool has added 15 analyses:\n10 on the default branch, and another 5 on a topic branch.\nYou therefore have two separate sets of analyses for this tool.\nYou've now decided that you want to remove all of the analyses for the tool.\nTo do this you must make 15 separate deletion requests.\nTo start, you must find an analysis that's identified as deletable.\nEach set of analyses always has one that's identified as deletable.\nHaving found the deletable analysis for one of the two sets,\ndelete this analysis and then continue deleting the next analysis in the set until they're all deleted.\nThen repeat the process for the second set.\nThe procedure therefore consists of a nested loop:\n\n**Outer loop**:\n* List the analyses for the repository, filtered by tool.\n* Parse this list to find a deletable analysis. If found:\n\n **Inner loop**:\n * Delete the identified analysis.\n * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.\n\nThe above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#delete-a-code-scanning-analysis-from-a-repository" }, "operationId": "code-scanning/delete-analysis", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.", "in": "path", "name": "analysis_id", "required": true, "schema": { "type": "integer" } }, { "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.`", "in": "query", "name": "confirm_delete", "required": false, "schema": { "nullable": true, "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default-response": { "$ref": "#/components/examples/code-scanning-analysis-deletion" } }, "schema": { "$ref": "#/components/schemas/code-scanning-analysis-deletion" } } }, "description": "Response" }, "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" } }, "summary": "Delete a code scanning analysis from a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } }, "get": { "description": "Gets a specified code scanning analysis for a repository.\nYou must use an access token with the `security_events` scope to use this endpoint with private repos,\nthe `public_repo` scope also grants permission to read security events on public repos only.\nGitHub Apps must have the `security_events` read permission to use this endpoint.\n\nThe default JSON response contains fields that describe the analysis.\nThis includes the Git reference and commit SHA to which the analysis relates,\nthe datetime of the analysis, the name of the code scanning tool,\nand the number of alerts.\n\nThe `rules_count` field in the default response give the number of rules\nthat were run in the analysis.\nFor very old analyses this data is not available,\nand `0` is returned in this field.\n\nIf you use the Accept header `application/sarif+json`,\nthe response contains the analysis data that was uploaded.\nThis is formatted as\n[SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html).", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository" }, "operationId": "code-scanning/get-analysis", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.", "in": "path", "name": "analysis_id", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "response": { "$ref": "#/components/examples/code-scanning-analysis-default" } }, "schema": { "$ref": "#/components/schemas/code-scanning-analysis" } }, "application/json+sarif": { "examples": { "response": { "$ref": "#/components/examples/code-scanning-analysis-sarif" } }, "schema": { "additionalProperties": true, "type": "object" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "Get a code scanning analysis for a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/code-scanning/codeql/databases": { "get": { "description": "Lists the CodeQL databases that are available in a repository.\n\nFor private repositories, you must use an access token with the `security_events` scope.\nFor public repositories, you can use tokens with the `security_events` or `public_repo` scope.\nGitHub Apps must have the `contents` read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-codeql-databases" }, "operationId": "code-scanning/list-codeql-databases", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-codeql-databases" } }, "schema": { "items": { "$ref": "#/components/schemas/code-scanning-codeql-database" }, "type": "array" } } }, "description": "Response" }, "403": { "$ref": "#/components/responses/code_scanning_forbidden_read" }, "404": { "$ref": "#/components/responses/not_found" }, "503": { "$ref": "#/components/responses/service_unavailable" } }, "summary": "List CodeQL databases for a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}": { "get": { "description": "Gets a CodeQL database for a language in a repository.\n\nBy default this endpoint returns JSON metadata about the CodeQL database. To\ndownload the CodeQL database binary content, set the `Accept` header of the request\nto [`application/zip`](https://docs.github.com/rest/overview/media-types), and make sure\nyour HTTP client is configured to follow redirects or use the `Location` header\nto make a second request to get the redirect URL.\n\nFor private repositories, you must use an access token with the `security_events` scope.\nFor public repositories, you can use tokens with the `security_events` or `public_repo` scope.\nGitHub Apps must have the `contents` read permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#get-codeql-database" }, "operationId": "code-scanning/get-codeql-database", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The language of the CodeQL database.", "in": "path", "name": "language", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-codeql-database" } }, "schema": { "$ref": "#/components/schemas/code-scanning-codeql-database" } } }, "description": "Response" }, "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" } }, "summary": "Get a CodeQL database for a repository", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": null } } }, "/repos/{owner}/{repo}/code-scanning/sarifs": { "post": { "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.\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.\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/reference/code-scanning#get-information-about-a-sarif-upload).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#upload-a-sarif-file" }, "operationId": "code-scanning/upload-sarif", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "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" } } }, "schema": { "properties": { "checkout_uri": { "description": "The base directory used in the analysis, as it appears in the SARIF file.\nThis property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.", "example": "file:///github/workspace/", "format": "uri", "type": "string" }, "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" }, "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.\nThis 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" ], "type": "object" } } }, "required": true }, "responses": { "202": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-sarif-upload" } }, "schema": { "$ref": "#/components/schemas/code-scanning-sarifs-receipt" } } }, "description": "Response" }, "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" } }, "summary": "Upload an analysis as SARIF data", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}": { "get": { "description": "Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see \"[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository).\" You must use an access token with the `security_events` scope to use this endpoint 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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/code-scanning#list-recent-code-scanning-analyses-for-a-repository" }, "operationId": "code-scanning/get-sarif", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The SARIF ID obtained after uploading.", "in": "path", "name": "sarif_id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/code-scanning-sarif-upload-status" } }, "schema": { "$ref": "#/components/schemas/code-scanning-sarifs-status" } } }, "description": "Response" }, "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" } }, "summary": "Get information about a SARIF upload", "tags": [ "code-scanning" ], "x-github": { "category": "code-scanning", "enabledForGitHubApps": true, "githubCloudOnly": false } } }, "/repos/{owner}/{repo}/codeowners/errors": { "get": { "description": "List any syntax errors that are detected in the CODEOWNERS\nfile.\n\nFor more information about the correct CODEOWNERS syntax,\nsee \"[About code owners](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).\"", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/repos#list-codeowners-errors" }, "operationId": "repos/codeowners-errors", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "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", "name": "ref", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codeowners-errors" } }, "schema": { "$ref": "#/components/schemas/codeowners-errors" } } }, "description": "Response" }, "404": { "description": "Resource not found" } }, "summary": "List CODEOWNERS errors", "tags": [ "repos" ], "x-github": { "category": "repos", "enabledForGitHubApps": true, "githubCloudOnly": false, "previews": [], "subcategory": null } } }, "/repos/{owner}/{repo}/codespaces": { "get": { "description": "Lists the codespaces associated to a specified repository and the authenticated user.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user" }, "operationId": "codespaces/list-in-repository-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-list-for-repository" } }, "schema": { "properties": { "codespaces": { "items": { "$ref": "#/components/schemas/codespace" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "codespaces" ], "type": "object" } } }, "description": "Response" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "List codespaces in a repository for the authenticated user", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } }, "post": { "description": "Creates a codespace owned by the authenticated user in the specified repository.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#create-a-codespace-in-a-repository" }, "operationId": "codespaces/create-with-repo-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "machine": "standardLinux32gb", "ref": "main" } } }, "schema": { "nullable": true, "properties": { "client_ip": { "description": "IP for location auto-detection when proxying a request", "type": "string" }, "devcontainer_path": { "description": "Path to devcontainer.json config to use for this codespace", "type": "string" }, "display_name": { "description": "Display name for this codespace", "type": "string" }, "idle_timeout_minutes": { "description": "Time in minutes before codespace stops from inactivity", "type": "integer" }, "location": { "description": "Location for this codespace. Assigned by IP if not provided", "type": "string" }, "machine": { "description": "Machine type to use for this codespace", "type": "string" }, "multi_repo_permissions_opt_out": { "description": "Whether to authorize requested permissions from devcontainer.json", "type": "boolean" }, "ref": { "description": "Git ref (typically a branch 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" }, "working_directory": { "description": "Working directory for this codespace", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespace" } }, "schema": { "$ref": "#/components/schemas/codespace" } } }, "description": "Response when the codespace was successfully created" }, "202": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespace" } }, "schema": { "$ref": "#/components/schemas/codespace" } } }, "description": "Response when the codespace creation partially failed but is being retried in the background" }, "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" } }, "summary": "Create a codespace in a repository", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/codespaces/devcontainers": { "get": { "description": "Lists the devcontainer.json files associated with a specified repository and the authenticated user. These files\nspecify launchpoint configurations for codespaces created within the repository.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_metadata` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-devcontainers-in-a-repository-for-the-authenticated-user" }, "operationId": "codespaces/list-devcontainers-in-repository-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-list-devcontainers-for-repository" } }, "schema": { "properties": { "devcontainers": { "items": { "properties": { "name": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path" ], "type": "object" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "devcontainers" ], "type": "object" } } }, "description": "Response" }, "400": { "$ref": "#/components/responses/bad_request" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "List devcontainer configurations in a repository for the authenticated user", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/codespaces/machines": { "get": { "description": "List the machine types available for a given repository based on its configuration.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_metadata` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-available-machine-types-for-a-repository" }, "operationId": "codespaces/repo-machines-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The location to check for available machines. Assigned by IP if not provided.", "in": "query", "name": "location", "schema": { "example": "WestUs2", "type": "string" } }, { "description": "IP for location auto-detection when proxying a request", "in": "query", "name": "client_ip", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespace-machines-list" } }, "schema": { "properties": { "machines": { "items": { "$ref": "#/components/schemas/codespace-machine" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "machines" ], "type": "object" } } }, "description": "Response" }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" }, "500": { "$ref": "#/components/responses/internal_error" } }, "summary": "List available machine types for a repository", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "machines" } } }, "/repos/{owner}/{repo}/codespaces/new": { "get": { "description": "Gets the default attributes for codespaces created by the user with the repository.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#preview-attributes-for-a-new-codespace" }, "operationId": "codespaces/pre-flight-with-repo-for-authenticated-user", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "description": "The branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked.", "in": "query", "name": "ref", "schema": { "example": "main", "type": "string" } }, { "description": "An alternative IP for default location auto-detection, such as when proxying a request.", "in": "query", "name": "client_ip", "schema": { "example": "1.2.3.4", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-list-devcontainers-for-repository" } }, "schema": { "properties": { "billable_owner": { "$ref": "#/components/schemas/simple-user" }, "defaults": { "properties": { "devcontainer_path": { "nullable": true, "type": "string" }, "location": { "type": "string" } }, "required": [ "location", "devcontainer_path" ], "type": "object" } }, "type": "object" } } }, "description": "Response when a user is able to create codespaces from the repository." }, "401": { "$ref": "#/components/responses/requires_authentication" }, "403": { "$ref": "#/components/responses/forbidden" }, "404": { "$ref": "#/components/responses/not_found" } }, "summary": "Get default attributes for a codespace", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": null } } }, "/repos/{owner}/{repo}/codespaces/secrets": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#list-repository-secrets" }, "operationId": "codespaces/list-repo-secrets", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-codespaces-secret-paginated" } }, "schema": { "properties": { "secrets": { "items": { "$ref": "#/components/schemas/repo-codespaces-secret" }, "type": "array" }, "total_count": { "type": "integer" } }, "required": [ "total_count", "secrets" ], "type": "object" } } }, "description": "Response", "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "summary": "List repository secrets", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "repository-secrets" } } }, "/repos/{owner}/{repo}/codespaces/secrets/public-key": { "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#get-a-repository-public-key" }, "operationId": "codespaces/get-repo-public-key", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/codespaces-public-key" } }, "schema": { "$ref": "#/components/schemas/codespaces-public-key" } } }, "description": "Response" } }, "summary": "Get a repository public key", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": false, "githubCloudOnly": false, "subcategory": "repository-secrets" } } }, "/repos/{owner}/{repo}/codespaces/secrets/{secret_name}": { "delete": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#delete-a-repository-secret" }, "operationId": "codespaces/delete-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "204": { "description": "Response" } }, "summary": "Delete a repository secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "repository-secrets" } }, "get": { "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.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#get-a-repository-secret" }, "operationId": "codespaces/get-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "responses": { "200": { "content": { "application/json": { "examples": { "default": { "$ref": "#/components/examples/repo-codespaces-secret" } }, "schema": { "$ref": "#/components/schemas/repo-codespaces-secret" } } }, "description": "Response" } }, "summary": "Get a repository secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "repository-secrets" } }, "put": { "description": "Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `repo` scope to use this endpoint. GitHub Apps must have write access to the `codespaces_secrets`\nrepository permission to use this endpoint.\n\n#### Example of encrypting a secret using Node.js\n\nEncrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.\n\n```\nconst sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n```\n\n#### Example of encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example of encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example of encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/reference/codespaces#create-or-update-a-repository-secret" }, "operationId": "codespaces/create-or-update-repo-secret", "parameters": [ { "$ref": "#/components/parameters/owner" }, { "$ref": "#/components/parameters/repo" }, { "$ref": "#/components/parameters/secret-name" } ], "requestBody": { "content": { "application/json": { "examples": { "default": { "value": { "encrypted_value": "c2VjcmV0", "key_id": "012345678912345678" } } }, "schema": { "properties": { "encrypted_value": { "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/reference/codespaces#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})$", "type": "string" }, "key_id": { "description": "ID of the key you used to encrypt the secret.", "type": "string" } }, "type": "object" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "examples": { "default": { "value": null } }, "schema": { "$ref": "#/components/schemas/empty-object" } } }, "description": "Response when creating a secret" }, "204": { "description": "Response when updating a secret" } }, "summary": "Create or update a repository secret", "tags": [ "codespaces" ], "x-github": { "category": "codespaces", "enabledForGitHubApps": true, "githubCloudOnly": false, "subcategory": "repository-secrets" } } }, "/repos/{owner}/{repo}/collaborators": { "get": { "description": "For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.\nOrganization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.\n\nTeam members will include the members of child teams.\n\nYou must authenticate using an access token with the `read:org` and `repo` scopes with push access to use this\nendpoint. GitHub Apps must have the `members` organization permission and `metadata` repository permission to use this\nendpoint.", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators" }, "operationId": "repos/list-collaborators", "parameters": [ { "$ref": "#/components/parameters/owner" }, {