Puntos de conexión de API REST para autorizaciones de credenciales de empresa
Use la API REST para administrar las autorizaciones de credenciales de empresa.
Revoke all credential authorizations for an enterprise
Revokes all credential authorizations for all organizations within the enterprise. This includes any guest, outside, or repository collaborators.
For Enterprise Managed User (EMU) enterprises, you can optionally also destroy all
credentials (PATs v1, PATs v2, and SSH keys) owned by enterprise members 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, 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.
Tokens de acceso granulares para "Revoke all credential authorizations for an enterprise"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Enterprise credentials" enterprise permissions (write)
Parámetros para "Revoke all credential authorizations for an enterprise"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
| Nombre, Tipo, Descripción |
|---|
revoke_credentials boolean Whether to also destroy the actual credentials (PATs and SSH keys) owned by
enterprise members. This option is only available for Enterprise Managed User
(EMU) enterprises. When set to Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Revoke all credential authorizations for an enterprise"
| código de estado | Descripción |
|---|---|
202 | Accepted - The revocation request has been queued |
403 | Forbidden |
404 | Resource not found |
422 | Validation error - The |
Ejemplos de código para "Revoke all credential authorizations for an enterprise"
Si accede a GitHub en GHE.com, reemplace api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/credential-authorizations/revoke-all \
-d '{"revoke_credentials":false}'Accepted - The revocation request has been queued
Status: 202{
"message": "Credential authorization revocation has been queued"
}Revoke a single credential type for an enterprise
Revokes a single credential type (for example, classic personal access tokens) across all organizations within the enterprise. This removes the sign-in authorizations for that credential type for every member of the enterprise.
For Enterprise Managed User (EMU) enterprises, you can optionally also destroy the
actual credentials of that type owned by enterprise members 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, 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.
Tokens de acceso granulares para "Revoke a single credential type for an enterprise"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Enterprise credentials" enterprise permissions (write)
Parámetros para "Revoke a single credential type for an enterprise"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
| Nombre, Tipo, Descripción |
|---|
credential_type string ObligatorioThe type of credential to revoke across the enterprise. Puede ser uno de los siguientes: |
revoke_credentials boolean Whether to also destroy the actual credentials of this type owned by
enterprise members. This option is only available for Enterprise Managed
User (EMU) enterprises. When set to Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Revoke a single credential type for an enterprise"
| código de estado | Descripción |
|---|---|
202 | Accepted - The revocation request has been queued |
403 | Forbidden |
404 | Resource not found |
422 | Validation error - The |
Ejemplos de código para "Revoke a single credential type for an enterprise"
Si accede a GitHub en GHE.com, reemplace api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/credential-authorizations/revoke-credential-type \
-d '{"credential_type":"classic_pat","revoke_credentials":false}'Accepted - The revocation request has been queued
Status: 202{
"message": "Credential type revocation has been queued"
}Revoke credential authorizations for a user in an enterprise
Revokes all credential authorizations for a single user within the enterprise. This includes any credential authorizations the user has across all organizations in the enterprise.
For Enterprise Managed User (EMU) enterprises, you can optionally also destroy all
credentials (PATs v1, PATs v2, and SSH keys) 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.
Tokens de acceso granulares para "Revoke credential authorizations for a user in an enterprise"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Enterprise credentials" enterprise permissions (write)
Parámetros para "Revoke credential authorizations for a user in an enterprise"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
username string ObligatorioThe handle for the GitHub user account. |
| Nombre, Tipo, Descripción |
|---|
revoke_credentials boolean Whether to also destroy the actual credentials (PATs and SSH keys) owned by
the user. This option is only available for Enterprise Managed User (EMU)
enterprises. When set to Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Revoke credential authorizations for a user in an enterprise"
| código de estado | Descripción |
|---|---|
202 | Accepted - The revocation request has been queued |
403 | Forbidden |
404 | Resource not found |
422 | Validation error - The target user cannot be revoked, or |
Ejemplos de código para "Revoke credential authorizations for a user in an enterprise"
Si accede a GitHub en GHE.com, reemplace api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/credential-authorizations/USERNAME/revoke \
-d '{"revoke_credentials":false}'Accepted - The revocation request has been queued
Status: 202{
"message": "Credential authorization revocation for user 'octocat' has been queued"
}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.
Tokens de acceso granulares para "Revoke a single credential type for a user in an enterprise"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Enterprise credentials" enterprise permissions (write)
Parámetros para "Revoke a single credential type for a user in an enterprise"
| Nombre, Tipo, Descripción |
|---|
accept string Setting to |
| Nombre, Tipo, Descripción |
|---|
enterprise string ObligatorioThe slug version of the enterprise name. |
username string ObligatorioThe handle for the GitHub user account. |
| Nombre, Tipo, Descripción |
|---|
credential_type string ObligatorioThe type of credential to revoke for the user. Puede ser uno de los siguientes: |
revoke_credentials boolean 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 Valor predeterminado: |
Códigos de estado de respuesta HTTP para "Revoke a single credential type for a user in an enterprise"
| código de estado | Descripción |
|---|---|
202 | Accepted - The revocation request has been queued |
403 | Forbidden |
404 | Resource not found |
422 | Validation error - The |
Ejemplos de código para "Revoke a single credential type for a user in an enterprise"
Si accede a GitHub en GHE.com, reemplace api.github.com por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com.
Ejemplo de solicitud
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/enterprises/ENTERPRISE/credential-authorizations/USERNAME/revoke-credential-type \
-d '{"credential_type":"classic_pat","revoke_credentials":false}'Accepted - The revocation request has been queued
Status: 202{
"message": "Credential type revocation for user 'octocat' has been queued"
}