Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

Revocation

Use the REST API to revoke credentials that you have found exposed on GitHub or elsewhere.

Revoke a list of credentials

Submit a list of credentials to be revoked. This endpoint is intended to revoke credentials the caller does not own and may have found exposed on GitHub.com or elsewhere. It can also be used for credentials associated with an old user account that you no longer have access to. Credential owners will be notified of the revocation.

This endpoint currently accepts the following credential types:

  • Personal access tokens (classic)
  • Fine-grained personal access tokens

Revoked credentials may impact users on GitHub Free, Pro, & Team and GitHub Enterprise Cloud, and GitHub Enterprise Cloud with Enterprise Managed Users. GitHub cannot reactivate any credentials that have been revoked; new credentials will need to be generated.

To prevent abuse, this API is limited to only 60 unauthenticated requests per hour and a max of 1000 tokens per API request.

Note

Any authenticated requests will return a 403.

"Revoke a list of credentials" のきめ細かいアクセス トークン

このエンドポイントは、次の粒度の細かいトークンの種類で動作します:

粒度の細かいトークンにはアクセス許可が必要ありません。

"Revoke a list of credentials" のパラメーター

ヘッダー
名前, Type, 説明
accept string

Setting to application/vnd.github+json is recommended.

本文のパラメーター
名前, Type, 説明
credentials array of strings 必須

A list of credentials to be revoked, up to 1000 per request.

"Revoke a list of credentials" の HTTP 応答状態コード

状態コード説明
202

Accepted

422

Validation failed, or the endpoint has been spammed.

500

Internal Error

"Revoke a list of credentials" のコード サンプル

要求の例

post/credentials/revoke
curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/credentials/revoke \ -d '{"credentials":["ghp_1234567890abcdef1234567890abcdef12345678","ghp_abcdef1234567890abcdef1234567890abcdef12"]}'

Accepted