---
title: "Update code security and analysis features for an enterprise"
method: PATCH
path: "/enterprises/{enterprise}/code_security_and_analysis"
tags: ["enterprise-admin"]
---

# Update code security and analysis features for an enterprise

`PATCH /enterprises/{enterprise}/code_security_and_analysis`

Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.
To use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.

## Path parameters

- `enterprise` string, required

## Request body

- object
  - `dependabot_alerts_enabled_for_new_repositories` boolean — Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "[About Dependabot alerts](https://docs.github.com/enterprise-server@3.8/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)."

## Response `204`

Action started

## Other responses

- `404` — Resource not found
- `422` — The action could not be taken due to an in progress enablement, or a policy is preventing enablement

---

[API](https://skmtc.dev/github/apis/enterprise-server.md) · [All operations](https://skmtc.dev/github/apis/enterprise-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/github/enterprise-server/revisions/cee8edf7d809/schema)
