v56

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

Update code security and analysis features for an enterprise

[!WARNING] Closing down notice: The ability to update code security and analysis settings for an enterprise is closing down. Please use code security configurations instead. For more information, see the changelog.

Updates the settings for advanced security, Dependabot alerts, secret scanning, and push protection for new repositories in an enterprise.

The authenticated user must be an administrator of the enterprise to use this endpoint.

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

patch/enterprises/{enterprise}/code_security_and_analysis

Path parameters

enterprisestring required

The slug version of the enterprise name.

Request body

advanced_security_enabled_for_new_repositoriesboolean

Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see "About GitHub Advanced Security."

advanced_security_enabled_new_user_namespace_reposboolean

Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. For more information, see "About GitHub Advanced Security."

dependabot_alerts_enabled_for_new_repositoriesboolean

Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "About Dependabot alerts."

secret_scanning_enabled_for_new_repositoriesboolean

Whether secret scanning is automatically enabled for new repositories. For more information, see "About secret scanning."

secret_scanning_push_protection_enabled_for_new_repositoriesboolean

Whether secret scanning push protection is automatically enabled for new repositories. For more information, see "Protecting pushes with secret scanning."

secret_scanning_push_protection_custom_linkstring nullable

The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see "Protecting pushes with secret scanning." To disable this functionality, set this field to null.

secret_scanning_non_provider_patterns_enabled_for_new_repositoriesboolean nullable

Whether secret scanning of non-provider patterns is enabled for new repositories under this enterprise.

Response

Action started