Skip to main content
Die REST-API verfügt jetzt über eine Versionskontrolle. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung.

Widerruf

Verwende die REST-API, um Anmeldeinformationen zu widerrufen, die du auf GitHub oder an anderer Stelle gefunden hast.

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. Credential owners will be notified of the revocation.

This endpoint currently accepts the following credential types:

  • classic personal access tokens
  • fine-grained personal access tokens

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

Differenzierte Zugriffstoken für "Revoke a list of credentials"

Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen.:

Das differenzierte Token erfordert keine Berechtigungen.

Parameter für „Revoke a list of credentials“

Header
Name, type, BESCHREIBUNG
accept string

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

Textparameter
Name, type, BESCHREIBUNG
credentials array of strings Erforderlich

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

HTTP-Antwortstatuscodes für „Revoke a list of credentials“

StatuscodeBESCHREIBUNG
202

Accepted

422

Validation failed, or the endpoint has been spammed.

500

Internal Error

Codebeispiele für „Revoke a list of credentials“

Anforderungsbeispiel

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" \ http(s)://HOSTNAME/api/v3/credentials/revoke \ -d '{"credentials":["ghp_1234567890abcdef1234567890abcdef12345678","ghp_abcdef1234567890abcdef1234567890abcdef12"]}'

Accepted

Status: 202