Sample - GitHub REST API
PATCH/enterprises/{enterprise}/code-security/configurations/{configuration_id}

Update a custom code security configuration for an enterprise

Updates a code security configuration in an enterprise.

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

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

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 23 body fields
enterprisestringrequired
The slug version of the enterprise name.
configuration_idintegerrequired
The unique identifier of the code security configuration.
namestringoptional
The name of the code security configuration. Must be unique across the enterprise.
descriptionstringoptional
A description of the code security configuration
advanced_securitystringoptional
The enablement status of GitHub Advanced Security features. `enabled` will enable both Code Security and Secret Protection features. > [!WARNING] > `code_security` and `secret_protection` are deprecated values for this field. Prefer the individual `code_security` and `secret_protection` fields to set the status of these features.
Allowed:enableddisabledcode_securitysecret_protection
code_securitystringoptional
The enablement status of GitHub Code Security features.
Allowed:enableddisablednot_set
dependency_graphstringoptional
The enablement status of Dependency Graph
Allowed:enableddisablednot_set
dependency_graph_autosubmit_actionstringoptional
The enablement status of Automatic dependency submission
Allowed:enableddisablednot_set
dependency_graph_autosubmit_action_optionsobjectoptional
Feature options for Automatic dependency submission
dependabot_alertsstringoptional
The enablement status of Dependabot alerts
Allowed:enableddisablednot_set
dependabot_security_updatesstringoptional
The enablement status of Dependabot security updates
Allowed:enableddisablednot_set
code_scanning_default_setupstringoptional
The enablement status of code scanning default setup
Allowed:enableddisablednot_set
code_scanning_default_setup_optionsobjectoptional
Feature options for code scanning default setup
code_scanning_optionsobjectoptional
Security Configuration feature options for code scanning
code_scanning_delegated_alert_dismissalstringoptional
The enablement status of code scanning delegated alert dismissal
Allowed:enableddisablednot_setDefault:disabled
secret_protectionstringoptional
The enablement status of GitHub Secret Protection features.
Allowed:enableddisablednot_set
secret_scanningstringoptional
The enablement status of secret scanning
Allowed:enableddisablednot_set
secret_scanning_push_protectionstringoptional
The enablement status of secret scanning push protection
Allowed:enableddisablednot_set
secret_scanning_validity_checksstringoptional
The enablement status of secret scanning validity checks
Allowed:enableddisablednot_set
secret_scanning_non_provider_patternsstringoptional
The enablement status of secret scanning non-provider patterns
Allowed:enableddisablednot_set
secret_scanning_generic_secretsstringoptional
The enablement status of Copilot secret scanning
Allowed:enableddisablednot_setDefault:disabled
secret_scanning_delegated_alert_dismissalstringoptional
The enablement status of secret scanning delegated alert dismissal
Allowed:enableddisablednot_setDefault:disabled
secret_scanning_extended_metadatastringoptional
The enablement status of secret scanning extended metadata
Allowed:enableddisablednot_setDefault:disabled
private_vulnerability_reportingstringoptional
The enablement status of private vulnerability reporting
Allowed:enableddisablednot_set
enforcementstringoptional
The enforcement status for a security configuration
Allowed:enforcedunenforced

5 status codes
200Response
idintegeroptional
The ID of the code security configuration
namestringoptional
The name of the code security configuration. Must be unique within the organization.
target_typestringoptional
The type of the code security configuration.
Allowed:globalorganizationenterprise
descriptionstringoptional
A description of the code security configuration
advanced_securitystringoptional
The enablement status of GitHub Advanced Security
Allowed:enableddisabledcode_securitysecret_protection
dependency_graphstringoptional
The enablement status of Dependency Graph
Allowed:enableddisablednot_set
dependency_graph_autosubmit_actionstringoptional
The enablement status of Automatic dependency submission
Allowed:enableddisablednot_set
dependency_graph_autosubmit_action_optionsobjectoptional
Feature options for Automatic dependency submission
dependabot_alertsstringoptional
The enablement status of Dependabot alerts
Allowed:enableddisablednot_set
dependabot_security_updatesstringoptional
The enablement status of Dependabot security updates
Allowed:enableddisablednot_set
dependabot_delegated_alert_dismissalstringoptional
The enablement status of Dependabot delegated alert dismissal
Allowed:enableddisablednot_set
code_scanning_optionsobjectoptional
Feature options for code scanning
code_scanning_default_setupstringoptional
The enablement status of code scanning default setup
Allowed:enableddisablednot_set
code_scanning_default_setup_optionsobjectoptional
Feature options for code scanning default setup
code_scanning_delegated_alert_dismissalstringoptional
The enablement status of code scanning delegated alert dismissal
Allowed:enableddisablednot_set
secret_scanningstringoptional
The enablement status of secret scanning
Allowed:enableddisablednot_set
secret_scanning_push_protectionstringoptional
The enablement status of secret scanning push protection
Allowed:enableddisablednot_set
secret_scanning_delegated_bypassstringoptional
The enablement status of secret scanning delegated bypass
Allowed:enableddisablednot_set
secret_scanning_delegated_bypass_optionsobjectoptional
Feature options for secret scanning delegated bypass
secret_scanning_validity_checksstringoptional
The enablement status of secret scanning validity checks
Allowed:enableddisablednot_set
secret_scanning_non_provider_patternsstringoptional
The enablement status of secret scanning non-provider patterns
Allowed:enableddisablednot_set
secret_scanning_generic_secretsstringoptional
The enablement status of Copilot secret scanning
Allowed:enableddisablednot_set
secret_scanning_delegated_alert_dismissalstringoptional
The enablement status of secret scanning delegated alert dismissal
Allowed:enableddisablednot_set
secret_scanning_extended_metadatastringoptional
The enablement status of secret scanning extended metadata
Allowed:enableddisablednot_set
private_vulnerability_reportingstringoptional
The enablement status of private vulnerability reporting
Allowed:enableddisablednot_set
enforcementstringoptional
The enforcement status for a security configuration
Allowed:enforcedunenforced
urlstringoptional
The URL of the configuration
html_urlstringoptional
The URL of the configuration
created_atstringoptional
updated_atstringoptional
304Not modified
403Forbidden
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
409Conflict
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 403 is returned: Forbidden. A 404 is returned: Resource not found. A 409 is returned: Conflict.