UNPKG

@simulacrum/github-api-simulator

Version:

Provides common functionality to frontend app and plugins.

1,411 lines (1,410 loc) 11.3 MB
{ "openapi": "3.1.0", "info": { "version": "1.1.4", "title": "GitHub v3 REST API", "description": "GitHub's v3 REST API.", "license": { "name": "MIT", "url": "https://spdx.org/licenses/MIT" }, "termsOfService": "https://docs.github.com/articles/github-terms-of-service", "contact": { "name": "Support", "url": "https://support.github.com/contact?tags=dotcom-rest-api" }, "x-github-plan": "api.github.com" }, "tags": [ { "name": "actions", "description": "Endpoints to manage GitHub Actions using the REST API." }, { "name": "activity", "description": "Activity APIs provide access to notifications, subscriptions, and timelines." }, { "name": "apps", "description": "Information for integrations and installations." }, { "name": "billing", "description": "Monitor charges and usage from Actions and Packages." }, { "name": "checks", "description": "Rich interactions with checks run by your integrations." }, { "name": "code-scanning", "description": "Retrieve code scanning alerts from a repository." }, { "name": "codes-of-conduct", "description": "Insight into codes of conduct for your communities." }, { "name": "emojis", "description": "List emojis available to use on GitHub." }, { "name": "dependabot", "description": "Endpoints to manage Dependabot." }, { "name": "dependency-graph", "description": "Endpoints to access Dependency Graph features." }, { "name": "gists", "description": "View, modify your gists." }, { "name": "git", "description": "Raw Git functionality." }, { "name": "gitignore", "description": "View gitignore templates" }, { "name": "issues", "description": "Interact with GitHub Issues." }, { "name": "licenses", "description": "View various OSS licenses." }, { "name": "markdown", "description": "Render GitHub flavored markdown" }, { "name": "merge-queue", "description": "Interact with GitHub Merge Queues." }, { "name": "meta", "description": "Endpoints that give information about the API." }, { "name": "migrations", "description": "Move projects to or from GitHub." }, { "name": "oidc", "description": "Endpoints to manage GitHub OIDC configuration using the REST API." }, { "name": "orgs", "description": "Interact with GitHub Orgs." }, { "name": "packages", "description": "Manage packages for authenticated users and organizations." }, { "name": "projects", "description": "Interact with GitHub Projects." }, { "name": "pulls", "description": "Interact with GitHub Pull Requests." }, { "name": "rate-limit", "description": "Check your current rate limit status" }, { "name": "reactions", "description": "Interact with reactions to various GitHub entities." }, { "name": "repos", "description": "Interact with GitHub Repos." }, { "name": "search", "description": "Look for stuff on GitHub." }, { "name": "secret-scanning", "description": "Retrieve secret scanning alerts from a repository." }, { "name": "teams", "description": "Interact with GitHub Teams." }, { "name": "users", "description": "Interact with and view information about users and also current user." }, { "name": "codespaces", "description": "Endpoints to manage Codespaces using the REST API." }, { "name": "copilot", "description": "Endpoints to manage Copilot using the REST API." }, { "name": "security-advisories", "description": "Manage security advisories." }, { "name": "interactions", "description": "Owner or admin management of users interactions." }, { "name": "classroom", "description": "Interact with GitHub Classroom." }, { "name": "desktop", "description": "Desktop specific endpoints." }, { "name": "enterprise-teams", "description": "Endpoints to manage GitHub Enterprise Teams." }, { "name": "code-security", "description": "Endpoints to manage Code security using the REST API." }, { "name": "private-registries", "description": "Manage private registry configurations." }, { "name": "hosted-compute", "description": "Manage hosted compute networking resources." } ], "servers": [ { "url": "https://api.github.com" } ], "externalDocs": { "description": "GitHub v3 REST API", "url": "https://docs.github.com/rest/" }, "paths": { "/": { "get": { "summary": "GitHub API Root", "description": "Get Hypermedia links to resources accessible in GitHub's REST API", "tags": [ "meta" ], "operationId": "meta/root", "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/root" }, "examples": { "default": { "$ref": "#/components/examples/root" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "meta", "subcategory": "meta" }, "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/meta/meta#github-api-root" } } }, "/advisories": { "get": { "summary": "List global security advisories", "description": "Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.\n\nBy default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see \"[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories).\"", "tags": [ "security-advisories" ], "operationId": "security-advisories/list-global-advisories", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories" }, "parameters": [ { "name": "ghsa_id", "in": "query", "description": "If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned.", "schema": { "type": "string" } }, { "name": "type", "in": "query", "description": "If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware.", "schema": { "type": "string", "enum": [ "reviewed", "malware", "unreviewed" ], "default": "reviewed" } }, { "name": "cve_id", "description": "If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned.", "in": "query", "schema": { "type": "string" } }, { "name": "ecosystem", "in": "query", "description": "If specified, only advisories for these ecosystems will be returned.", "schema": { "$ref": "#/components/schemas/security-advisory-ecosystems" } }, { "name": "severity", "in": "query", "description": "If specified, only advisories with these severities will be returned.", "schema": { "type": "string", "enum": [ "unknown", "low", "medium", "high", "critical" ] } }, { "name": "cwes", "in": "query", "description": "If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.\n\nExample: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22`", "schema": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } }, { "name": "is_withdrawn", "in": "query", "description": "Whether to only return advisories that have been withdrawn.", "schema": { "type": "boolean" } }, { "name": "affects", "in": "query", "description": "If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified.\nIf the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages.\n\nExample: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0`", "schema": { "oneOf": [ { "type": "string" }, { "type": "array", "maxItems": 1000, "items": { "type": "string" } } ] } }, { "name": "published", "in": "query", "description": "If specified, only return advisories that were published on a date or date range.\n\nFor more information on the syntax of the date range, see \"[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).\"", "schema": { "type": "string" } }, { "name": "updated", "in": "query", "description": "If specified, only return advisories that were updated on a date or date range.\n\nFor more information on the syntax of the date range, see \"[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).\"", "schema": { "type": "string" } }, { "name": "modified", "description": "If specified, only show advisories that were updated or published on a date or date range.\n\nFor more information on the syntax of the date range, see \"[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).\"", "in": "query", "schema": { "type": "string" } }, { "name": "epss_percentage", "in": "query", "description": "If specified, only return advisories that have an EPSS percentage score that matches the provided value.\nThe EPSS percentage represents the likelihood of a CVE being exploited.", "schema": { "type": "string" } }, { "name": "epss_percentile", "in": "query", "description": "If specified, only return advisories that have an EPSS percentile score that matches the provided value.\nThe EPSS percentile represents the relative rank of the CVE's likelihood of being exploited compared to other CVEs.", "schema": { "type": "string" } }, { "$ref": "#/components/parameters/pagination-before" }, { "$ref": "#/components/parameters/pagination-after" }, { "$ref": "#/components/parameters/direction" }, { "name": "per_page", "description": "The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 30 } }, { "name": "sort", "description": "The property to sort the results by.", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "updated", "published", "epss_percentage", "epss_percentile" ], "default": "published" } } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/global-advisory" } }, "examples": { "default": { "$ref": "#/components/examples/global-advisory-items" } } } } }, "429": { "description": "Too many requests", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/basic-error" } } } }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "security-advisories", "subcategory": "global-advisories" } } }, "/advisories/{ghsa_id}": { "get": { "summary": "Get a global security advisory", "description": "Gets a global security advisory using its GitHub Security Advisory (GHSA) identifier.", "tags": [ "security-advisories" ], "operationId": "security-advisories/get-global-advisory", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory" }, "parameters": [ { "$ref": "#/components/parameters/ghsa_id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/global-advisory" }, "examples": { "default": { "$ref": "#/components/examples/global-advisory" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "security-advisories", "subcategory": "global-advisories" } } }, "/app": { "get": { "summary": "Get the authenticated app", "description": "Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the \"[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)\" endpoint.\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.", "tags": [ "apps" ], "operationId": "apps/get-authenticated", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#get-the-authenticated-app" }, "parameters": [ ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/integration" }, "examples": { "default": { "$ref": "#/components/examples/integration" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "apps" } } }, "/app-manifests/{code}/conversions": { "post": { "summary": "Create a GitHub App from a manifest", "description": "Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.", "tags": [ "apps" ], "operationId": "apps/create-from-manifest", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest" }, "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/integration" }, { "type": "object", "properties": { "client_id": { "type": "string" }, "client_secret": { "type": "string" }, "webhook_secret": { "type": [ "string", "null" ] }, "pem": { "type": "string" } }, "required": [ "client_id", "client_secret", "webhook_secret", "pem" ], "additionalProperties": true } ] }, "examples": { "default": { "$ref": "#/components/examples/integration-from-manifest" } } } } }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed_simple" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "apps" } } }, "/app/hook/config": { "get": { "summary": "Get a webhook configuration for an app", "description": "Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\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.", "tags": [ "apps" ], "operationId": "apps/get-webhook-config-for-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app" }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } }, "patch": { "summary": "Update a webhook configuration for an app", "description": "Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"[Creating a GitHub App](/developers/apps/creating-a-github-app).\"\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.", "tags": [ "apps" ], "operationId": "apps/update-webhook-config-for-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app" }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "$ref": "#/components/schemas/webhook-config-url" }, "content_type": { "$ref": "#/components/schemas/webhook-config-content-type" }, "secret": { "$ref": "#/components/schemas/webhook-config-secret" }, "insecure_ssl": { "$ref": "#/components/schemas/webhook-config-insecure-ssl" } } }, "examples": { "default": { "value": { "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/webhook-config" }, "examples": { "default": { "$ref": "#/components/examples/webhook-config" } } } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } } }, "/app/hook/deliveries": { "get": { "summary": "List deliveries for an app webhook", "description": "Returns a list of webhook deliveries for the webhook configured for a GitHub App.\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.", "tags": [ "apps" ], "operationId": "apps/list-webhook-deliveries", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/cursor" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/hook-delivery-item" } }, "examples": { "default": { "$ref": "#/components/examples/hook-delivery-items" } } } } }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } } }, "/app/hook/deliveries/{delivery_id}": { "get": { "summary": "Get a delivery for an app webhook", "description": "Returns a delivery for the webhook configured for a GitHub App.\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.", "tags": [ "apps" ], "operationId": "apps/get-webhook-delivery", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook" }, "parameters": [ { "$ref": "#/components/parameters/delivery-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/hook-delivery" }, "examples": { "default": { "$ref": "#/components/examples/hook-delivery" } } } } }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } } }, "/app/hook/deliveries/{delivery_id}/attempts": { "post": { "summary": "Redeliver a delivery for an app webhook", "description": "Redeliver a delivery for the webhook configured for a GitHub App.\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.", "tags": [ "apps" ], "operationId": "apps/redeliver-webhook-delivery", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook" }, "parameters": [ { "$ref": "#/components/parameters/delivery-id" } ], "responses": { "202": { "$ref": "#/components/responses/accepted" }, "400": { "$ref": "#/components/responses/bad_request" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "webhooks" } } }, "/app/installation-requests": { "get": { "summary": "List installation requests for the authenticated app", "description": "Lists all the pending installation requests for the authenticated GitHub App.", "tags": [ "apps" ], "operationId": "apps/list-installation-requests-for-authenticated-app", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "List of integration installation requests", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/integration-installation-request" } }, "examples": { "exampleKey1": { "$ref": "#/components/examples/integration-installation-request-paginated" } } } } }, "304": { "$ref": "#/components/responses/not_modified" }, "401": { "$ref": "#/components/responses/requires_authentication" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "apps" } } }, "/app/installations": { "get": { "summary": "List installations for the authenticated app", "description": "The permissions the installation has are included under the `permissions` 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.", "tags": [ "apps" ], "operationId": "apps/list-installations", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/per-page" }, { "$ref": "#/components/parameters/page" }, { "$ref": "#/components/parameters/since" }, { "name": "outdated", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "The permissions the installation has are included under the `permissions` key.", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/installation" } }, "examples": { "default": { "$ref": "#/components/examples/base-installation-items" } } } }, "headers": { "Link": { "$ref": "#/components/headers/link" } } } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "apps" } } }, "/app/installations/{installation_id}": { "get": { "summary": "Get an installation for the authenticated app", "description": "Enables an authenticated GitHub App to find an installation's information using the installation id.\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.", "tags": [ "apps" ], "operationId": "apps/get-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/installation" }, "examples": { "default": { "$ref": "#/components/examples/base-installation" } } } } }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "apps" } }, "delete": { "summary": "Delete an installation for the authenticated app", "description": "Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the \"[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)\" endpoint.\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.", "tags": [ "apps" ], "operationId": "apps/delete-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "apps" } } }, "/app/installations/{installation_id}/access_tokens": { "post": { "summary": "Create an installation access token for an app", "description": "Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.\n\nOptionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.\n\nOptionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.\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.", "tags": [ "apps" ], "operationId": "apps/create-installation-access-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "repositories": { "description": "List of repository names that the token should have access to", "type": "array", "items": { "type": "string", "examples": [ "rails" ] } }, "repository_ids": { "description": "List of repository IDs that the token should have access to", "type": "array", "items": { "type": "integer" }, "examples": [ 1 ] }, "permissions": { "$ref": "#/components/schemas/app-permissions" } } }, "examples": { "default": { "value": { "repositories": [ "Hello-World" ], "permissions": { "issues": "write", "contents": "read" } } } } } } }, "responses": { "201": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/installation-token" }, "examples": { "default": { "$ref": "#/components/examples/installation-token" } } } } }, "403": { "$ref": "#/components/responses/forbidden" }, "401": { "$ref": "#/components/responses/requires_authentication" }, "404": { "$ref": "#/components/responses/not_found" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": true, "category": "apps", "subcategory": "apps" } } }, "/app/installations/{installation_id}/suspended": { "put": { "summary": "Suspend an app installation", "description": "Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.\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.", "tags": [ "apps" ], "operationId": "apps/suspend-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#suspend-an-app-installation" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "apps" } }, "delete": { "summary": "Unsuspend an app installation", "description": "Removes a GitHub App installation suspension.\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.", "tags": [ "apps" ], "operationId": "apps/unsuspend-installation", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation" }, "parameters": [ { "$ref": "#/components/parameters/installation-id" } ], "responses": { "204": { "description": "Response" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "apps" } } }, "/applications/{client_id}/grant": { "delete": { "summary": "Delete an app authorization", "description": "OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.\nDeleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).", "operationId": "apps/delete-authorization", "tags": [ "apps" ], "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "access_token": { "type": "string", "description": "The OAuth access token used to authenticate to the GitHub API." } }, "required": [ "access_token" ] }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "204": { "description": "Response" }, "422": { "$ref": "#/components/responses/validation_failed" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } } }, "/applications/{client_id}/token": { "post": { "summary": "Check a token", "description": "OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/check-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/oauth-applications#check-a-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth or GitHub application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "200": { "description": "Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authorization" }, "examples": { "default": { "$ref": "#/components/examples/authorization-with-user" } } } } }, "422": { "$ref": "#/components/responses/validation_failed" }, "404": { "$ref": "#/components/responses/not_found" } }, "x-github": { "githubCloudOnly": false, "enabledForGitHubApps": false, "category": "apps", "subcategory": "oauth-applications" } }, "patch": { "summary": "Reset a token", "description": "OAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the \"token\" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`.", "tags": [ "apps" ], "operationId": "apps/reset-token", "externalDocs": { "description": "API method documentation", "url": "https://docs.github.com/rest/apps/oauth-applications#reset-a-token" }, "parameters": [ { "$ref": "#/components/parameters/client-id" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "access_token": { "description": "The access_token of the OAuth or GitHub application.", "type": "string" } }, "required": [ "access_token" ], "type": "object" }, "examples": { "default": { "value": { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a" } } } } } }, "responses": { "200": { "description": "Response", "content": { "appli