v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,4581,08113.3 MB
code-security

Create a code security configuration for an enterprise

Creates 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.

post/enterprises/{enterprise}/code-security/configurations

Path parameters

enterprisestring required

The slug version of the enterprise name.

Request body

namestring required

The name of the code security configuration. Must be unique within the enterprise.

descriptionstring

A description of the code security configuration

advanced_security'enabled' | 'disabled' | 'code_security' | 'secret_protection'

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.

code_security'enabled' | 'disabled' | 'not_set'

The enablement status of GitHub Code Security features.

dependency_graph'enabled' | 'disabled' | 'not_set'

The enablement status of Dependency Graph

dependency_graph_autosubmit_action'enabled' | 'disabled' | 'not_set'

The enablement status of Automatic dependency submission

dependabot_alerts'enabled' | 'disabled' | 'not_set'

The enablement status of Dependabot alerts

dependabot_security_updates'enabled' | 'disabled' | 'not_set'

The enablement status of Dependabot security updates

code_scanning_default_setup'enabled' | 'disabled' | 'not_set'

The enablement status of code scanning default setup

code_scanning_delegated_alert_dismissal'enabled' | 'disabled' | 'not_set'

The enablement status of code scanning delegated alert dismissal

secret_protection'enabled' | 'disabled' | 'not_set'

The enablement status of GitHub Secret Protection features.

secret_scanning'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning

secret_scanning_push_protection'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning push protection

secret_scanning_validity_checks'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning validity checks

secret_scanning_non_provider_patterns'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning non provider patterns

secret_scanning_generic_secrets'enabled' | 'disabled' | 'not_set'

The enablement status of Copilot secret scanning

secret_scanning_delegated_alert_dismissal'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning delegated alert dismissal

secret_scanning_extended_metadata'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning extended metadata

private_vulnerability_reporting'enabled' | 'disabled' | 'not_set'

The enablement status of private vulnerability reporting

enforcement'enforced' | 'unenforced'

The enforcement status for a security configuration

Response

Successfully created code security configuration

idinteger

The ID of the code security configuration

namestring

The name of the code security configuration. Must be unique within the organization.

target_type'global' | 'organization' | 'enterprise'

The type of the code security configuration.

descriptionstring nullable

A description of the code security configuration

advanced_security'enabled' | 'disabled' | 'code_security' | 'secret_protection'

The enablement status of GitHub Advanced Security

dependency_graph'enabled' | 'disabled' | 'not_set'

The enablement status of Dependency Graph

dependency_graph_autosubmit_action'enabled' | 'disabled' | 'not_set'

The enablement status of Automatic dependency submission

dependabot_alerts'enabled' | 'disabled' | 'not_set'

The enablement status of Dependabot alerts

dependabot_security_updates'enabled' | 'disabled' | 'not_set'

The enablement status of Dependabot security updates

dependabot_delegated_alert_dismissal'enabled' | 'disabled' | 'not_set' nullable

The enablement status of Dependabot delegated alert dismissal

code_scanning_default_setup'enabled' | 'disabled' | 'not_set'

The enablement status of code scanning default setup

code_scanning_delegated_alert_dismissal'enabled' | 'disabled' | 'not_set'

The enablement status of code scanning delegated alert dismissal

secret_scanning'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning

secret_scanning_push_protection'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning push protection

secret_scanning_delegated_bypass'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning delegated bypass

secret_scanning_validity_checks'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning validity checks

secret_scanning_non_provider_patterns'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning non-provider patterns

secret_scanning_generic_secrets'enabled' | 'disabled' | 'not_set'

The enablement status of Copilot secret scanning

secret_scanning_delegated_alert_dismissal'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning delegated alert dismissal

secret_scanning_extended_metadata'enabled' | 'disabled' | 'not_set'

The enablement status of secret scanning extended metadata

private_vulnerability_reporting'enabled' | 'disabled' | 'not_set'

The enablement status of private vulnerability reporting

enforcement'enforced' | 'unenforced'

The enforcement status for a security configuration

urlstring uri

The URL of the configuration

html_urlstring uri

The URL of the configuration

created_atstring date-time
updated_atstring date-time