---
title: "Set a code security configuration as a default for an enterprise"
method: PUT
path: "/enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"
tags: ["code-security"]
---

# Set a code security configuration as a default for an enterprise

`PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults`

Sets a code security configuration as a default to be applied to new repositories in your enterprise.

This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.

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

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

## Path parameters

- `enterprise` string, required
- `configuration_id` integer, required

## Request body

- object
  - `default_for_new_repos` 'all' | 'none' | 'private_and_internal' | 'public' — Specify which types of repository this security configuration should be applied to by default.

## Response `200`

Default successfully changed.

- object
  - `default_for_new_repos` 'all' | 'none' | 'private_and_internal' | 'public' — Specifies which types of repository this security configuration is applied to by default.
  - `configuration` CodeSecurityConfiguration — A code security configuration
    - `id` integer — The ID of the code security configuration
    - `name` string — 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.
    - `description` string, 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
    - `dependency_graph_autosubmit_action_options` object — Feature options for Automatic dependency submission
      - `labeled_runners` boolean — Whether to use runners labeled with 'dependency-submission' or standard GitHub runners.
    - `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_options` object, nullable — Feature options for code scanning
      - `allow_advanced` boolean, nullable — Whether to allow repos which use advanced setup
    - `code_scanning_default_setup` 'enabled' | 'disabled' | 'not_set' — The enablement status of code scanning default setup
    - `code_scanning_default_setup_options` object, nullable — Feature options for code scanning default setup
      - `runner_type` 'standard' | 'labeled' | 'not_set', nullable — Whether to use labeled runners or standard GitHub runners.
      - `runner_label` string, nullable — The label of the runner to use for code scanning when runner_type is 'labeled'.
    - `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_delegated_bypass_options` object — Feature options for secret scanning delegated bypass
      - `reviewers` object[] — The bypass reviewers for secret scanning delegated bypass
        - `reviewer_id` integer, required — The ID of the team or role selected as a bypass reviewer
        - `reviewer_type` 'TEAM' | 'ROLE', required — The type of the bypass reviewer
        - `mode` 'ALWAYS' | 'EXEMPT' — The bypass mode for the reviewer
        - `security_configuration_id` integer — The ID of the security configuration associated with this bypass reviewer
    - `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
    - `url` string, uri — The URL of the configuration
    - `html_url` string, uri — The URL of the configuration
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `403` — Forbidden
- `404` — Resource not found

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
