v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
enterprise-admin

Revoke a single credential type for a user in an enterprise

Revokes a single credential type (for example, classic personal access tokens) for a single user within the enterprise. This removes the sign-in authorizations for that credential type across all organizations in the enterprise for the user.

For Enterprise Managed User (EMU) enterprises, you can optionally also destroy the actual credential of that type owned by the user by setting the revoke_credentials parameter to true.

This operation is performed asynchronously. A background job will be queued to process the revocations.

[!WARNING] If you use a personal access token to call this endpoint and target yourself, that token may also be revoked or destroyed as part of this operation.

The authenticated user must be an enterprise owner or have the write_enterprise_credentials permission to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

post/enterprises/{enterprise}/credential-authorizations/{username}/revoke-credential-type

Path parameters

enterprisestring required

The slug version of the enterprise name.

usernamestring required

The handle for the GitHub user account.

Request body

credential_type'classic_pat' | 'fine_grained_pat' | 'ssh_key' | 'oauth_app_token' required

The type of credential to revoke for the user.

revoke_credentialsboolean

Whether to also destroy the actual credential of this type owned by the user. This option is only available for Enterprise Managed User (EMU) enterprises. When set to true, the credential of the given type owned by the user will be destroyed in addition to the credential authorizations. Note that oauth_app_token credentials cannot be destroyed; for that type only the credential authorizations are revoked.

Response

Accepted - The revocation request has been queued

messagestring

A message indicating the revocation has been queued

warningstring

A warning message if the token used for this request may be revoked